From e894193e51fa09d1cbb9a67ac88012790ff82f69 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 8 Dec 2015 19:02:37 -0500 Subject: [PATCH] Move location of assistive MathML to be more closely related to the position of the typeset math. Issue #1235. --- unpacked/extensions/AssistiveMML.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/unpacked/extensions/AssistiveMML.js b/unpacked/extensions/AssistiveMML.js index c60ea84d1..e0f344e2c 100644 --- 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"); }