Last modified: 2014-10-19 15:08:43 UTC
Created attachment 16303 [details] screenshot I tested the MathML SVG mode and it seems that the height is incorrect and the bottom of the image is cut-off. http://en.wikipedia.beta.wmflabs.org/wiki/User:Physikerwelt screenshot attached. Apple Safari
Thanks for reporting this. I'm not sure if that's a problem of the Math extension of a problem of the SVG itself. Does the SVG http://en.wikipedia.beta.wmflabs.org/w/index.php?title=Special:MathShowImage&hash=826676a6a5ad24552f0d5af1593434cc&mode=5 cropped for you as well?
I played a bit with the options. I think the hight is too small. If we'd add a few percent to the height the problem would be solved. Do you think that would be a good solution?
Does MathJax still returns the image height in relative CSS units (ex)? I'm not sure we can be convert them reliably into px...
I don't think the problem is in the height (increasing it will only scale the image) but other CSS effects, leading to clipping. From a quick try, stripping the style from the SVG seems to fix this so perhaps having the inline style both within the SVG and on the img tag is causing trouble.
Found it. It's primarily the styling on the SVG element itself. That adds two 2px of margin (which are not part of the SVG sizes). Then on the inline image element, we add another 2px. Remove those two and everything works just fine.
You can test on http://en.wikipedia.beta.wmflabs.org/wiki/User:Physikerwelt by replacing the img url of the mathml image to point to: http://upload.beta.wmflabs.org/wikipedia/en/2/2a/Math-svg-inline-test.svg
That means it's a problem on the server side.
Change 165861 had a related patch set uploaded by GWicke: Bug 70119: Strip style from SVG image https://gerrit.wikimedia.org/r/165861
Change 165861 merged by jenkins-bot: Bug 70119: Strip style from SVG image https://gerrit.wikimedia.org/r/165861
Change 165949 had a related patch set uploaded by GWicke: Revert "Bug 70119: Strip style from SVG image" https://gerrit.wikimedia.org/r/165949
Change 165949 merged by GWicke: Revert "Bug 70119: Strip style from SVG image" https://gerrit.wikimedia.org/r/165949
This should be basically fixed for new formulas. Old formulas already in the database might still have the old margins, and will need to be cleared. I believe that one way to do this is is ?action=purge&mathpurge=true, although in my tests that did not work reliably. I'm keeping this bug open until this is verified fixed in production.