Fix handling of colored backgrounds on math elements in IE, and on mspace/mpadded elements in IE < 8.
This commit is contained in:
parent
993715cc03
commit
6aba7a2170
|
@ -879,8 +879,8 @@
|
||||||
delete jax.HTMLCSS;
|
delete jax.HTMLCSS;
|
||||||
},
|
},
|
||||||
|
|
||||||
getHD: function (span) {
|
getHD: function (span,force) {
|
||||||
if (span.bbox && this.config.noReflows) {return {h:span.bbox.h, d:span.bbox.d}}
|
if (span.bbox && this.config.noReflows && !force) {return {h:span.bbox.h, d:span.bbox.d}}
|
||||||
var position = span.style.position;
|
var position = span.style.position;
|
||||||
span.style.position = "absolute";
|
span.style.position = "absolute";
|
||||||
this.HDimg.style.height = "0px";
|
this.HDimg.style.height = "0px";
|
||||||
|
@ -1096,7 +1096,7 @@
|
||||||
createSpace: function (span,h,d,w,color,isSpace) {
|
createSpace: function (span,h,d,w,color,isSpace) {
|
||||||
if (h < -d) {d = -h} // make sure h is above d
|
if (h < -d) {d = -h} // make sure h is above d
|
||||||
var H = this.Em(h+d), D = this.Em(-d);
|
var H = this.Em(h+d), D = this.Em(-d);
|
||||||
if (this.msieInlineBlockAlignBug) {D = this.Em(HTMLCSS.getHD(span.parentNode).d-d)}
|
if (this.msieInlineBlockAlignBug) {D = this.Em(HTMLCSS.getHD(span.parentNode,true).d-d)}
|
||||||
if (span.isBox || isSpace) {
|
if (span.isBox || isSpace) {
|
||||||
var scale = (span.scale == null ? 1 : span.scale);
|
var scale = (span.scale == null ? 1 : span.scale);
|
||||||
span.bbox = {exactW: true, h: h*scale, d: d*scale, w: w*scale, rw: w*scale, lw: 0};
|
span.bbox = {exactW: true, h: h*scale, d: d*scale, w: w*scale, rw: w*scale, lw: 0};
|
||||||
|
@ -2860,10 +2860,6 @@
|
||||||
// problem in strict HTML mode
|
// problem in strict HTML mode
|
||||||
stack.style.fontSize = nobr.parentNode.style.fontSize; nobr.parentNode.style.fontSize = "";
|
stack.style.fontSize = nobr.parentNode.style.fontSize; nobr.parentNode.style.fontSize = "";
|
||||||
if (this.data[0] != null) {
|
if (this.data[0] != null) {
|
||||||
if (HTMLCSS.msieColorBug) {
|
|
||||||
if (this.background) {this.data[0].background = this.background; delete this.background}
|
|
||||||
if (this.mathbackground) {this.data[0].mathbackground = this.mathbackground; delete this.mathbackground}
|
|
||||||
}
|
|
||||||
MML.mbase.prototype.displayAlign = HUB.config.displayAlign;
|
MML.mbase.prototype.displayAlign = HUB.config.displayAlign;
|
||||||
MML.mbase.prototype.displayIndent = HUB.config.displayIndent;
|
MML.mbase.prototype.displayIndent = HUB.config.displayIndent;
|
||||||
if (String(HUB.config.displayIndent).match(/^0($|[a-z%])/i))
|
if (String(HUB.config.displayIndent).match(/^0($|[a-z%])/i))
|
||||||
|
@ -2943,10 +2939,21 @@
|
||||||
// Move the background color, of any
|
// Move the background color, of any
|
||||||
//
|
//
|
||||||
if (color) {
|
if (color) {
|
||||||
color.style.marginLeft = HTMLCSS.Em(parseFloat(color.style.marginLeft)+shift);
|
var L = parseFloat(color.style.marginLeft||"0")+shift,
|
||||||
|
R = parseFloat(color.style.marginRight||"0")-shift;
|
||||||
|
color.style.marginLeft = HTMLCSS.Em(L);
|
||||||
color.style.marginRight =
|
color.style.marginRight =
|
||||||
HTMLCSS.Em(parseFloat(color.style.marginRight)-shift
|
HTMLCSS.Em(R + (values.indentalign === "right" ?
|
||||||
+ (values.indentalign === "right" ? Math.min(0,span.bbox.w+shift) - span.bbox.w : 0));
|
Math.min(0,span.bbox.w+shift) - span.bbox.w : 0));
|
||||||
|
if (HTMLCSS.msieColorBug && values.indentalign === "right") {
|
||||||
|
if (parseFloat(color.style.marginLeft) > 0) {
|
||||||
|
var padding = MathJax.HTML.addElement(color.parentNode,"span");
|
||||||
|
padding.style.marginLeft = HTMLCSS.Em(R+Math.min(0,span.bbox.w+shift));
|
||||||
|
color.nextSibling.style.marginRight = "0em";
|
||||||
|
}
|
||||||
|
color.nextSibling.style.marginLeft = "0em";
|
||||||
|
color.style.marginRight = color.style.marginLeft = "0em";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3020,7 +3027,7 @@
|
||||||
HTMLCSS.Augment({
|
HTMLCSS.Augment({
|
||||||
PaddingWidthBug: true,
|
PaddingWidthBug: true,
|
||||||
msieAccentBug: true,
|
msieAccentBug: true,
|
||||||
msieColorBug: true,
|
msieColorBug: (mode < 8), // negative margin-right doesn't work to position color
|
||||||
msieColorPositionBug: true, // needs position:relative to put color behind text
|
msieColorPositionBug: true, // needs position:relative to put color behind text
|
||||||
msieRelativeWidthBug: quirks,
|
msieRelativeWidthBug: quirks,
|
||||||
msieDisappearingBug: (mode >= 8), // inline math disappears
|
msieDisappearingBug: (mode >= 8), // inline math disappears
|
||||||
|
|
Loading…
Reference in New Issue
Block a user