Fix a number of issues found by running IE8.
This commit is contained in:
parent
46676fd233
commit
ae8ae0cb72
|
@ -1042,7 +1042,7 @@ MathJax.HTML = {
|
||||||
Element: function (type,def,contents) {
|
Element: function (type,def,contents) {
|
||||||
var obj = document.createElement(type), id;
|
var obj = document.createElement(type), id;
|
||||||
if (def) {
|
if (def) {
|
||||||
if (def.style) {
|
if (def.hasOwnProperty("style")) {
|
||||||
var style = def.style; def.style = {};
|
var style = def.style; def.style = {};
|
||||||
for (id in style) {if (style.hasOwnProperty(id))
|
for (id in style) {if (style.hasOwnProperty(id))
|
||||||
{def.style[id.replace(/-([a-z])/g,this.ucMatch)] = style[id]}}
|
{def.style[id.replace(/-([a-z])/g,this.ucMatch)] = style[id]}}
|
||||||
|
|
|
@ -148,7 +148,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
|
||||||
// tip.style.filter = CHTML.config.styles["#MathJax_CHTML_Tooltip"].filter;
|
// tip.style.filter = CHTML.config.styles["#MathJax_CHTML_Tooltip"].filter;
|
||||||
if (this === currentTip) return;
|
if (this === currentTip) return;
|
||||||
tip.style.left = x+"px"; tip.style.top = y+"px";
|
tip.style.left = x+"px"; tip.style.top = y+"px";
|
||||||
tip.innerHTML = '<mjx-chtml><mjx-math></mjx-math></mjx-chtml>';
|
tip.innerHTML = '<span class="mjx-chtml"><span class="mjx-math"></span></span>';
|
||||||
CHTML.getMetrics(jax);
|
CHTML.getMetrics(jax);
|
||||||
try {this.data[1].toCommonHTML(tip.firstChild.firstChild)} catch(err) {
|
try {this.data[1].toCommonHTML(tip.firstChild.firstChild)} catch(err) {
|
||||||
if (!err.restart) throw err;
|
if (!err.restart) throw err;
|
||||||
|
|
|
@ -306,6 +306,11 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//
|
||||||
|
// Just use default toCommonHTML for EI8
|
||||||
|
//
|
||||||
|
if (!document.createElementNS) delete MML.menclose.prototype.toCommonHTML;
|
||||||
|
|
||||||
MathJax.Hub.Startup.signal.Post("CommonHTML menclose Ready");
|
MathJax.Hub.Startup.signal.Post("CommonHTML menclose Ready");
|
||||||
MathJax.Ajax.loadComplete(CHTML.autoloadDir+"/menclose.js");
|
MathJax.Ajax.loadComplete(CHTML.autoloadDir+"/menclose.js");
|
||||||
});
|
});
|
||||||
|
|
|
@ -506,7 +506,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
|
||||||
// Propagate full-width equations, and reserve room for equation plus label
|
// Propagate full-width equations, and reserve room for equation plus label
|
||||||
//
|
//
|
||||||
node.style.width = this.CHTML.pwidth = "100%";
|
node.style.width = this.CHTML.pwidth = "100%";
|
||||||
node.style.minWidth = this.CHTML.mwidth = CHTML.Em(tw);
|
node.style.minWidth = this.CHTML.mwidth = CHTML.Em(Math.max(0,tw));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -549,7 +549,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
|
||||||
var row = []; options.rows.push(row);
|
var row = []; options.rows.push(row);
|
||||||
var label = CHTML.Element("mjx-label"); options.labels.push(label);
|
var label = CHTML.Element("mjx-label"); options.labels.push(label);
|
||||||
this.CHTMLaddChild(label,0,options);
|
this.CHTMLaddChild(label,0,options);
|
||||||
options.labeled = true;
|
if (this.data[0]) options.labeled = true;
|
||||||
//
|
//
|
||||||
// Add the cells to the row
|
// Add the cells to the row
|
||||||
//
|
//
|
||||||
|
|
|
@ -121,6 +121,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
|
||||||
this.CHTMLaddLine(stack,start,[],state,ENDVALUES,broken);
|
this.CHTMLaddLine(stack,start,[],state,ENDVALUES,broken);
|
||||||
|
|
||||||
node.style.width = stack.style.width = this.CHTML.pwidth = "100%";
|
node.style.width = stack.style.width = this.CHTML.pwidth = "100%";
|
||||||
|
this.CHTML.mwidth = CHTML.Em(this.CHTML.w);
|
||||||
this.CHTML.isMultiline = parent.CHTML.isMultiline = true;
|
this.CHTML.isMultiline = parent.CHTML.isMultiline = true;
|
||||||
stack.style.verticalAlign = CHTML.Em(state.d - this.CHTML.d);
|
stack.style.verticalAlign = CHTML.Em(state.d - this.CHTML.d);
|
||||||
|
|
||||||
|
|
|
@ -828,7 +828,7 @@
|
||||||
var c = this.unicodeChar(n);
|
var c = this.unicodeChar(n);
|
||||||
var HDW = this.getHDW(c,unknown.className);
|
var HDW = this.getHDW(c,unknown.className);
|
||||||
// ### FIXME: provide a means of setting the height and depth for individual characters
|
// ### FIXME: provide a means of setting the height and depth for individual characters
|
||||||
unknown[n] = [.8,.2,HDW.w,0,HDW.w,{a:(HDW.h-HDW.d)/2, h:HDW.h, d:HDW.d}];
|
unknown[n] = [.8,.2,HDW.w,0,HDW.w,{a:Math.max(0,(HDW.h-HDW.d)/2), h:HDW.h, d:HDW.d}];
|
||||||
unknown[n].c = c;
|
unknown[n].c = c;
|
||||||
},
|
},
|
||||||
styledText: function (variant,text) {
|
styledText: function (variant,text) {
|
||||||
|
@ -842,7 +842,7 @@
|
||||||
var unknown = this.STYLEDTEXT[id];
|
var unknown = this.STYLEDTEXT[id];
|
||||||
if (!unknown["_"+text]) {
|
if (!unknown["_"+text]) {
|
||||||
var HDW = this.getHDW(text,variant.className||"",style);
|
var HDW = this.getHDW(text,variant.className||"",style);
|
||||||
unknown["_"+text] = [.8,.2,HDW.w,0,HDW.w,{a:(HDW.h-HDW.d)/2, h:HDW.h, d:HDW.d}];
|
unknown["_"+text] = [.8,.2,HDW.w,0,HDW.w,{a:Math.max(0,(HDW.h-HDW.d)/2), h:HDW.h, d:HDW.d}];
|
||||||
unknown["_"+text].c = text;
|
unknown["_"+text].c = text;
|
||||||
}
|
}
|
||||||
return {type:"unknown", n:"_"+text, font:unknown, style:style, rscale:variant.rscale};
|
return {type:"unknown", n:"_"+text, font:unknown, style:style, rscale:variant.rscale};
|
||||||
|
@ -1031,7 +1031,7 @@
|
||||||
ext.style.marginTop = CHTML.Em(-c-EFUZZ/2/k);
|
ext.style.marginTop = CHTML.Em(-c-EFUZZ/2/k);
|
||||||
var TEXT = ext.textContent, text = "\n"+TEXT;
|
var TEXT = ext.textContent, text = "\n"+TEXT;
|
||||||
while (--n > 0) TEXT += text;
|
while (--n > 0) TEXT += text;
|
||||||
ext.firstChild.textContent = TEXT;
|
ext.textContent = TEXT;
|
||||||
node.appendChild(ext);
|
node.appendChild(ext);
|
||||||
if (delim.mid) {
|
if (delim.mid) {
|
||||||
node.appendChild(mid);
|
node.appendChild(mid);
|
||||||
|
@ -1089,7 +1089,7 @@
|
||||||
right.style.marginleft = CHTML.Em(-rbox.l);
|
right.style.marginleft = CHTML.Em(-rbox.l);
|
||||||
var TEXT = ext.textContent, text = TEXT;
|
var TEXT = ext.textContent, text = TEXT;
|
||||||
while (--n > 0) TEXT += text;
|
while (--n > 0) TEXT += text;
|
||||||
ext.firstChild.textContent = TEXT;
|
ext.textContent = TEXT;
|
||||||
node.appendChild(ext);
|
node.appendChild(ext);
|
||||||
if (delim.mid) {
|
if (delim.mid) {
|
||||||
node.appendChild(mid);
|
node.appendChild(mid);
|
||||||
|
@ -1516,7 +1516,7 @@
|
||||||
BBOX.mwidth = this.data[0].CHTML.mwidth;
|
BBOX.mwidth = this.data[0].CHTML.mwidth;
|
||||||
style.width = "100%";
|
style.width = "100%";
|
||||||
} else if (BBOX.pwidth) {
|
} else if (BBOX.pwidth) {
|
||||||
BBOX.mwidth = BBOX.w;
|
BBOX.mwidth = CHTML.Em(BBOX.w);
|
||||||
style.width = "100%";
|
style.width = "100%";
|
||||||
} else if (BBOX.w < 0) {
|
} else if (BBOX.w < 0) {
|
||||||
style.width = "0px";
|
style.width = "0px";
|
||||||
|
@ -1526,7 +1526,7 @@
|
||||||
// ### FIXME: adjust for width, height, vertical-align?
|
// ### FIXME: adjust for width, height, vertical-align?
|
||||||
for (var i = 0, m = CHTML.BBOX.styleAdjust.length; i < m; i++) {
|
for (var i = 0, m = CHTML.BBOX.styleAdjust.length; i < m; i++) {
|
||||||
var data = CHTML.BBOX.styleAdjust[i];
|
var data = CHTML.BBOX.styleAdjust[i];
|
||||||
if (style[data[0]]) BBOX.adjust(style[data[0]],data[1],data[2],data[3]);
|
if (data && style[data[0]]) BBOX.adjust(style[data[0]],data[1],data[2],data[3]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1573,7 +1573,7 @@
|
||||||
if (!values.weight && values.mathvariant.match(/bold/)) values.weight = "bold";
|
if (!values.weight && values.mathvariant.match(/bold/)) values.weight = "bold";
|
||||||
if (!values.style && values.mathvariant.match(/italic/)) values.style = "italic";
|
if (!values.style && values.mathvariant.match(/italic/)) values.style = "italic";
|
||||||
this.CHTMLvariant = {fonts:[], noRemap:true, cache:{}, style: {
|
this.CHTMLvariant = {fonts:[], noRemap:true, cache:{}, style: {
|
||||||
"font-family":values.family, "font-weight":values.weight, "font-style":values.style
|
"font-family":values.family, "font-weight":values.weight||"normal", "font-style":values.style||"normal"
|
||||||
}};
|
}};
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1700,7 +1700,7 @@
|
||||||
if (!node.getAttribute("role")) node.setAttribute("role","math");
|
if (!node.getAttribute("role")) node.setAttribute("role","math");
|
||||||
if (this.CHTML.pwidth) {
|
if (this.CHTML.pwidth) {
|
||||||
node.parentNode.style.width = this.CHTML.pwidth;
|
node.parentNode.style.width = this.CHTML.pwidth;
|
||||||
node.parentNode.style.minWidth = this.CHTML.mwidth;
|
node.parentNode.style.minWidth = this.CHTML.mwidth||CHTML.Em(this.CHTML.w);
|
||||||
} else if (!this.isMultiline && this.Get("display") === "block") {
|
} else if (!this.isMultiline && this.Get("display") === "block") {
|
||||||
var values = this.getValues("indentalignfirst","indentshiftfirst","indentalign","indentshift");
|
var values = this.getValues("indentalignfirst","indentshiftfirst","indentalign","indentshift");
|
||||||
if (values.indentalignfirst !== MML.INDENTALIGN.INDENTALIGN) values.indentalign = values.indentalignfirst;
|
if (values.indentalignfirst !== MML.INDENTALIGN.INDENTALIGN) values.indentalign = values.indentalignfirst;
|
||||||
|
@ -1984,7 +1984,7 @@
|
||||||
bbox.w = bbox.r = w; bbox.h = bbox.t = h; bbox.d = bbox.b = d; bbox.l = 0;
|
bbox.w = bbox.r = w; bbox.h = bbox.t = h; bbox.d = bbox.b = d; bbox.l = 0;
|
||||||
if (w < 0) {node.style.marginRight = CHTML.Em(w); w = 0}
|
if (w < 0) {node.style.marginRight = CHTML.Em(w); w = 0}
|
||||||
node.style.width = CHTML.Em(w);
|
node.style.width = CHTML.Em(w);
|
||||||
node.style.height = CHTML.Em(h+d);
|
node.style.height = CHTML.Em(Math.max(0,h+d));
|
||||||
if (d) node.style.verticalAlign = CHTML.Em(-d);
|
if (d) node.style.verticalAlign = CHTML.Em(-d);
|
||||||
this.CHTMLhandleBBox(node);
|
this.CHTMLhandleBBox(node);
|
||||||
this.CHTMLhandleColor(node);
|
this.CHTMLhandleColor(node);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user