commit e894193e51fa09d1cbb9a67ac88012790ff82f69
parent d77687489869c987f5d61c97f308d5667ca2691b
Author: Davide P. Cervone <dpvc@union.edu>
Date: Tue, 8 Dec 2015 19:02:37 -0500
Move location of assistive MathML to be more closely related to the position of the typeset math. Issue #1235.
Diffstat:
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/unpacked/extensions/AssistiveMML.js b/unpacked/extensions/AssistiveMML.js
@@ -36,6 +36,7 @@
styles: {
".MJX_Assistive_MathML": {
position:"absolute!important",
+ top: 0, left: 0,
clip: (HUB.Browser.isMSIE && (document.documentMode||0) < 8 ?
"rect(1px 1px 1px 1px)" : "rect(1px, 1px, 1px, 1px)"),
padding: "1px 0 0 0!important",
@@ -44,6 +45,9 @@
width: "1px!important",
overflow: "hidden!important",
display:"block!important"
+ },
+ ".MJX_Assistive_MathML.MJX_Assistive_MathML_Block": {
+ width: "100%!important"
}
}
},
@@ -94,11 +98,14 @@
return MathJax.Callback.After(["HandleMML",this,state],err.restart);
}
frame.setAttribute("data-mathml",mml);
- span = HTML.addElement(frame,"span",{
- isMathJax: true, className: "MJX_Assistive_MathML"
+ span = HTML.addElement(frame,"span",{
+ isMathJax: true,
+ className: "MJX_Assistive_MathML"
+ + (jax.root.Get("display") === "block" ? " MJX_Assistive_MathML_Block" : "")
});
- span.innerHTML = mml;
- frame.setAttribute("role", "presentation");
+ span.innerHTML = mml;
+ frame.style.position = "relative";
+ frame.setAttribute("role", "presentation");
frame.firstChild.setAttribute("aria-hidden","true");
span.setAttribute("role", "presentation");
}