Follow-up of bug 152244 comment 32. Currently, MathOperator::stretchTo is called with the desired ascent/descent. When m_stretchType == StretchType::GlyphAssembly, this is used to set the desired vertical position of the operator. However, when m_stretchType == StretchType::SizeVariant the actual ascent/descent of the glyph is used for painting, and this may not correspond at all to the original MathOperator::stretchTo request. One easy way to fix that is to make MathOperator::stretchTo calculate a parameter m_verticalOffset when m_stretchType != StretchType::GlyphAssembly which would measure the difference between targetCenter = (-ascent + descent) / 2 and glyphCenter = (-m_ascent + m_descent) / 2. Then that parameter can be used to apply a shift during MathOperator::paint. Or maybe MathOperator::stretchTo should only take the target height as the parameter and it will be up to the MathOperator::paint caller to adjust the vertical offset (although that would probably mean that the shift will be stored in the caller's class). There is a test from the MathML in HTML5 test suite but it does not work well in WebKit yet: http://tests.mathml-association.org/mathml/presentation-markup/operators/mo-axis-height-1.html
Created attachment 281964 [details] Patch Here is an experimental patch showing the idea. Not sure it handles all the cases.
Created attachment 281965 [details] Screenshot of MathML torture test 14, XITS fonts This screenshot shows the improvement of the patch for MathML torture test 14, XITS fonts.
Created attachment 283605 [details] Patch
So I'm not sure what happened with mo-axis-height-1.html. It seems that the previous import and test expectation was just wrong :-( Anyway, after bug 158884 on http://tests.mathml-association.org/mathml/presentation-markup/operators/mo-axis-height-1.html the size variant test fails and the glyph assembly test passes. With the uploaded patch, the size variant test should pass too ;-) I still need to retrieve some pixel results for iOS/Mac, rebaseline and upload a new patch...
Comment on attachment 283605 [details] Patch Attachment 283605 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/1678588 New failing tests: mathml/opentype/opentype-stretchy.html mathml/presentation/mo-stretch.html
Created attachment 283610 [details] Archive of layout-test-results from ews101 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-yosemite Platform: Mac OS X 10.10.5
Comment on attachment 283605 [details] Patch Attachment 283605 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/1678589 New failing tests: mathml/opentype/opentype-stretchy.html mathml/presentation/mo-stretch.html
Created attachment 283611 [details] Archive of layout-test-results from ews106 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Comment on attachment 283605 [details] Patch Attachment 283605 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/1678593 New failing tests: mathml/opentype/opentype-stretchy.html mathml/presentation/mo-stretch.html
Created attachment 283614 [details] Archive of layout-test-results from ews117 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews117 Port: mac-yosemite Platform: Mac OS X 10.10.5
Comment on attachment 283605 [details] Patch Attachment 283605 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/1678594 New failing tests: mathml/opentype/opentype-stretchy.html mathml/presentation/mo-stretch.html
Created attachment 283615 [details] Archive of layout-test-results from ews125 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews125 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.5
Created attachment 283617 [details] Patch
Can someone please review this patch?
Comment on attachment 283617 [details] Patch This change looks fine. r=me.
Committed r203289: <http://trac.webkit.org/changeset/203289>
Committed r203339: <http://trac.webkit.org/changeset/203339>