Add some comments, and clear the list of DOM elements once we are done with it.

This commit is contained in:
Davide P. Cervone 2013-09-23 21:19:04 -04:00
parent ed932ec458
commit bbf543a840

View File

@ -950,6 +950,11 @@
// //
parent.style.width = (math.firstChild.scrollWidth/nMML.ex/nMML.scale).toFixed(3) + "ex"; parent.style.width = (math.firstChild.scrollWidth/nMML.ex/nMML.scale).toFixed(3) + "ex";
} }
//
// Firefox gets the widths of <mtd> elements wrong, so run
// through them (now that the math is part of the page) and
// fix them up. Use ex's so that they print properly (see above).
//
for (var i = 0, m = nMML.adjustWidths.length; i < m; i++) { for (var i = 0, m = nMML.adjustWidths.length; i < m; i++) {
var tag = nMML.adjustWidths[i]; var tag = nMML.adjustWidths[i];
var style = tag.getAttribute("style") || ""; var style = tag.getAttribute("style") || "";
@ -959,6 +964,7 @@
tag.setAttribute("style",style+"width:"+width+"ex"); tag.setAttribute("style",style+"width:"+width+"ex");
} }
} }
nMML.adjustWidths = []; // clear it so we don't hold onto the DOM elements
} }
}); });