Skip to content
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

SVG Zoom fails in Firefox when math contains characters not in the MathJax fonts #441

Closed
dpvc opened this issue Apr 18, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@dpvc
Copy link
Member

commented Apr 18, 2013

In SVG output mode, Firefox throws an error when trying to create the zoom box when the expression contains characters that aren't in the MathJax fonts.

When an unknown character is used, MathJax renders it with a <text> node, and then measures the size of the node via getBBox(). This is done using a special SVG element in which the text has been palaced (for measurement purposes), but if that special SVG element isn't in the DOM (i.e., is just an unconnected node), Firefox fails.

The Translate() routine attaches the text SVG element temporarily and then removes it, but the Zoom() routine didn't do that, and so the SVG element is detached, causing the error. The solution is to attach the element during zoom as well.

@ghost ghost assigned dpvc Apr 18, 2013

dpvc pushed a commit to dpvc/MathJax that referenced this issue Apr 18, 2013

Davide P. Cervone
Make sure textSVG is attached during zooming (prevents error when mat…
…h contains characters outside of the MathJax fonts). Resolves issue mathjax#441.
@dpvc

This comment has been minimized.

Copy link
Member Author

commented Apr 18, 2013

The issue441 branch of my fork of MathJax include the fix for this.

@fred-wang

This comment has been minimized.

Copy link
Contributor

commented Apr 19, 2013

I'll add the crashtest

UI/zoom-box-6.html

=> In testsuite, ready for release

dpvc pushed a commit to dpvc/MathJax that referenced this issue Apr 19, 2013

@dpvc

This comment has been minimized.

Copy link
Member Author

commented Apr 19, 2013

=> Merged

@dpvc dpvc closed this May 17, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.