Skip to content

Commit 89f0f9d

Browse files
committed
Firefox NativeMML still doesn't get the width right even if we set it properly on the <math>, so set it on the containing <span> instead. Resolves issue #88 again (and finally, I hope).
1 parent 70ea836 commit 89f0f9d

File tree

7 files changed

+10
-16
lines changed

7 files changed

+10
-16
lines changed

config/AM_HTMLorMML-full.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/Accessible-full.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/MML_HTMLorMML-full.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/TeX-AMS-MML_HTMLorMML-full.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/TeX-MML-AM_HTMLorMML-full.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jax/output/NativeMML/jax.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unpacked/jax/output/NativeMML/jax.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -573,18 +573,12 @@
573573
}
574574
parent.appendChild(math);
575575
//
576-
// Firefox can't get the width of <math> elements right, so
576+
// Firefox can't seem to get the width of <math> elements right, so
577577
// use an <mrow> to get the actual width and set the style on the
578-
// <math> element to match.
578+
// parent element to match. Even if we set the <math> width properly,
579+
// it doesn't seem to propagate up to the <span> correctly.
579580
//
580-
if (nMML.widthBug && math.scrollWidth < math.firstChild.scrollWidth) {
581-
var style = "width:"+math.firstChild.scrollWidth+"px";
582-
if (this.style) {
583-
if (this.style.match(/(^|;| )width:/)) {style = this.style}
584-
else {style += "; "+this.style}
585-
}
586-
math.setAttribute("style",style);
587-
}
581+
if (nMML.widthBug) {parent.style.width = math.firstChild.scrollWidth+"px"}
588582
}
589583
});
590584

0 commit comments

Comments
 (0)