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).

This commit is contained in:
Davide P. Cervone 2012-02-15 11:58:15 -05:00
parent 70ea836047
commit 89f0f9d307
7 changed files with 10 additions and 16 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -573,18 +573,12 @@
}
parent.appendChild(math);
//
// Firefox can't get the width of <math> elements right, so
// Firefox can't seem to get the width of <math> elements right, so
// use an <mrow> to get the actual width and set the style on the
// <math> element to match.
// parent element to match. Even if we set the <math> width properly,
// it doesn't seem to propagate up to the <span> correctly.
//
if (nMML.widthBug && math.scrollWidth < math.firstChild.scrollWidth) {
var style = "width:"+math.firstChild.scrollWidth+"px";
if (this.style) {
if (this.style.match(/(^|;| )width:/)) {style = this.style}
else {style += "; "+this.style}
}
math.setAttribute("style",style);
}
if (nMML.widthBug) {parent.style.width = math.firstChild.scrollWidth+"px"}
}
});