-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong placement of MathML in SVG with Safari #3302
Comments
I believe you are correct about the Safari bug that underlies this. Version 4 removes the For v3, you can use <style>
foreignObject > mjx-container {
position: unset !important;
will-change: unset !important;
}
</style> to reset those CSS styles, which should allow MathJax output to work in your SVGs. |
Thanks! That's reassuring.
Oh, so that's the actual reason for Is |
It depends on one's goal. The reason this is used is so that the assistive MathML will be at the same location as the MathJax typeset math. Because many screen readers highlight the text being read (this helps some readers who are not visually impaired but have other disabilities follow the reading as it progresses), we want that highlighting to display at the location of the math when it is read. The easiest way to do that is by using an absolute position for the MathML container within a relatively positioned typeset math container. It would be possible to do this in other ways, but they are more fragile, such as using a negative |
Thanks for the detailed answer.
I hadn't thought of that! At any rate: based on what you said, I will configure my MathJax so that for WebKit, in foreignObject, it uses negative |
OK. Good luck, and let us know how it works out. |
This is the current BookML workaround: @media (-webkit-transform-2d) {
foreignObject>mjx-container[jax="CHTML"] {
position: initial !important;
will-change: initial;
&>mjx-assistive-mml {
width: 1px !important;
height: 1px !important;
position: initial !important;
margin-inline-start: -1px !important;
vertical-align: 1px !important;
}
}
} This renders correctly even in WebKit browsers. |
Thanks for the details! |
Issue Summary
On Safari, certain MathML-in-SVG is rendered in the top left corner of the image regardless of its intended position. This is definitely a Safari bug (reasonable guess is https://bugs.webkit.org/show_bug.cgi?id=23113), but I am hoping MathJax can include a workaround for the time being.
For instance: resetting the
position
andwill-change
CSS properties of<mjx-container>
resolves the problem, although it probably messes up the alignment if the MathML is not the only content within<foreignObject>
.Steps to Reproduce:
Add MathML in the scope of a transform. For example:
renders as
instead of
Technical details:
I am loading MathJax via
The text was updated successfully, but these errors were encountered: