From bbf543a8403728778753cc72e2876370dd1e995d Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 23 Sep 2013 21:19:04 -0400 Subject: [PATCH] Add some comments, and clear the list of DOM elements once we are done with it. --- unpacked/jax/output/NativeMML/jax.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unpacked/jax/output/NativeMML/jax.js b/unpacked/jax/output/NativeMML/jax.js index 712419291..dbc5ac7fa 100644 --- a/unpacked/jax/output/NativeMML/jax.js +++ b/unpacked/jax/output/NativeMML/jax.js @@ -950,6 +950,11 @@ // parent.style.width = (math.firstChild.scrollWidth/nMML.ex/nMML.scale).toFixed(3) + "ex"; } + // + // Firefox gets the widths of 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++) { var tag = nMML.adjustWidths[i]; var style = tag.getAttribute("style") || ""; @@ -959,6 +964,7 @@ tag.setAttribute("style",style+"width:"+width+"ex"); } } + nMML.adjustWidths = []; // clear it so we don't hold onto the DOM elements } });