Add useProcessingFrame internal config and enable for Firefox, Safari, Chrome.
This commit is contained in:
parent
960e9a0eda
commit
9d76ae713c
|
@ -369,19 +369,23 @@
|
||||||
var prev = script.previousSibling;
|
var prev = script.previousSibling;
|
||||||
if (prev && String(prev.className).match(/^MathJax(_MathML|_Display)?$/))
|
if (prev && String(prev.className).match(/^MathJax(_MathML|_Display)?$/))
|
||||||
{prev.parentNode.removeChild(prev)}
|
{prev.parentNode.removeChild(prev)}
|
||||||
var math = script.MathJax.elementJax.root, span, div, frame;
|
var math = script.MathJax.elementJax.root, span, div;
|
||||||
span = div = this.Element("span",{
|
span = div = this.Element("span",{
|
||||||
className:"MathJax", oncontextmenu:this.ContextMenu, onmousedown: this.Mousedown,
|
className:"MathJax", oncontextmenu:this.ContextMenu, onmousedown: this.Mousedown,
|
||||||
onmouseover:this.Mouseover, onclick:this.Click, ondblclick:this.DblClick
|
onmouseover:this.Mouseover, onclick:this.Click, ondblclick:this.DblClick
|
||||||
});
|
});
|
||||||
if (math.Get("display") === "block") {
|
var blockMode = (math.Get("display") === "block");
|
||||||
|
if (blockMode) {
|
||||||
div = this.Element("div",{className:"MathJax_Display", style:{width:"100%", position:"relative"}});
|
div = this.Element("div",{className:"MathJax_Display", style:{width:"100%", position:"relative"}});
|
||||||
div.appendChild(span);
|
div.appendChild(span);
|
||||||
}
|
}
|
||||||
// (screen readers don't know about role="math" yet, so use "textbox" instead)
|
// (screen readers don't know about role="math" yet, so use "textbox" instead)
|
||||||
div.setAttribute("role","textbox"); div.setAttribute("aria-readonly","true");
|
div.setAttribute("role","textbox"); div.setAttribute("aria-readonly","true");
|
||||||
frame = this.Element("div",{className:"MathJax_Processing"});
|
var frame = div;
|
||||||
frame.appendChild(div);
|
if (this.useProcessingFrame) {
|
||||||
|
frame = this.Element((blockMode ? "div" : "span"),{className:"MathJax_Processing"});
|
||||||
|
frame.appendChild(div);
|
||||||
|
}
|
||||||
script.parentNode.insertBefore(frame,script); var isHidden;
|
script.parentNode.insertBefore(frame,script); var isHidden;
|
||||||
try {this.getScales(span,span); isHidden = (this.em === 0 || String(this.em) === "NaN")} catch (err) {isHidden = true}
|
try {this.getScales(span,span); isHidden = (this.em === 0 || String(this.em) === "NaN")} catch (err) {isHidden = true}
|
||||||
if (isHidden) {this.hiddenDiv.appendChild(frame); this.getScales(span,span)}
|
if (isHidden) {this.hiddenDiv.appendChild(frame); this.getScales(span,span)}
|
||||||
|
@ -393,7 +397,7 @@
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
if (isHidden) {script.parentNode.insertBefore(frame,script);}
|
if (isHidden) {script.parentNode.insertBefore(frame,script);}
|
||||||
frame.parentNode.replaceChild(div,frame);
|
if (this.useProcessingFrame) frame.parentNode.replaceChild(div,frame);
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -468,10 +472,10 @@
|
||||||
|
|
||||||
getScales: function (span,mj) {
|
getScales: function (span,mj) {
|
||||||
span.parentNode.insertBefore(this.HDMspan,span);
|
span.parentNode.insertBefore(this.HDMspan,span);
|
||||||
this.HDMspan.className = ""; this.HDspan.id = ""; this.HDMspan.style.fontSize = "";
|
this.HDMspan.className = ""; this.HDMspan.id = ""; this.HDMspan.style.fontSize = "";
|
||||||
this.HDMimg.style.height = "1px"; this.HDMimg.style.width = "60ex";
|
this.HDMimg.style.height = "1px"; this.HDMimg.style.width = "60ex";
|
||||||
var ex = this.HDMspan.offsetWidth/60;
|
var ex = this.HDMspan.offsetWidth/60;
|
||||||
this.HDMspan.className = "MathJax"; this.HDspan.id = "MathJax_getScales";
|
this.HDMspan.className = "MathJax"; this.HDMspan.id = "MathJax_getScales";
|
||||||
this.HDMimg.style.width = "60em";
|
this.HDMimg.style.width = "60em";
|
||||||
var em = this.outerEm = this.HDMspan.offsetWidth/60;
|
var em = this.outerEm = this.HDMspan.offsetWidth/60;
|
||||||
var scale = Math.floor((ex/this.TeX.x_height) / em * this.config.scale);
|
var scale = Math.floor((ex/this.TeX.x_height) / em * this.config.scale);
|
||||||
|
@ -2137,6 +2141,7 @@
|
||||||
(HUB.config.root+"/").substr(0,root.length) === root) {webFonts = "otf"}
|
(HUB.config.root+"/").substr(0,root.length) === root) {webFonts = "otf"}
|
||||||
}
|
}
|
||||||
HTMLCSS.Augment({
|
HTMLCSS.Augment({
|
||||||
|
useProcessingFrame: true,
|
||||||
ffVerticalAlignBug: true,
|
ffVerticalAlignBug: true,
|
||||||
AccentBug: true,
|
AccentBug: true,
|
||||||
allowWebFonts: webFonts
|
allowWebFonts: webFonts
|
||||||
|
@ -2160,6 +2165,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
useProcessingFrame: true,
|
||||||
rfuzz: .05,
|
rfuzz: .05,
|
||||||
AccentBug: true,
|
AccentBug: true,
|
||||||
AdjustSurd: true,
|
AdjustSurd: true,
|
||||||
|
@ -2181,6 +2187,7 @@
|
||||||
|
|
||||||
Chrome: function (browser) {
|
Chrome: function (browser) {
|
||||||
HTMLCSS.Augment({
|
HTMLCSS.Augment({
|
||||||
|
useProcessingFrame: true,
|
||||||
rfuzz: .05,
|
rfuzz: .05,
|
||||||
AccentBug: true,
|
AccentBug: true,
|
||||||
AdjustSurd: true,
|
AdjustSurd: true,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user