Title: [203289] trunk
Revision
203289
Author
[email protected]
Date
2016-07-15 11:47:16 -0700 (Fri, 15 Jul 2016)

Log Message

MathOperator: Improve alignment for vertical size variant
https://bugs.webkit.org/show_bug.cgi?id=158866

Patch by Frederic Wang <[email protected]> on 2016-07-15
Reviewed by Brent Fulgham.

Source/WebCore:

The MathOperator class may stretch operators with either a large glyph or a glyph assembly.
In the latter case, the assembly is adjusted to match the stretch ascent and descent
requested by the callers. But in the former case the glyph ascent and descent are used
instead. We solve this by making MathOperator::stretchTo only take a targetSize and let
callers do the vertical alignment they want. This improves the rendering of fences with some
math fonts (e.g. XITS) and allows to pass the two cases of mo-axis-height-1.html.

Test: imported/mathml-in-html5/mathml/presentation-markup/operators/mo-axis-height-1.html

* rendering/mathml/MathOperator.cpp:
(WebCore::MathOperator::stretchTo): Merge vertical and horizontal stretching into the same
function with only the targetSize as a parameter.
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::stretchTo): Updated to use the new signature.
(WebCore::RenderMathMLOperator::verticalStretchedOperatorShift): Helper function to calculate
the shift necessary to align the baseline of the MathOperator instance with the one of the
RenderMathMLOperator.
(WebCore::RenderMathMLOperator::firstLineBaseline): Adjust the baseline.
* rendering/mathml/RenderMathMLOperator.h: Declare verticalStretchedOperatorShift.
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::layoutBlock): Use the new signature. This function aligns the top
of the radical with the overbar so we do not need to adjust baseline alignment here.

LayoutTests:

We import the latest version of mo-axis-height-1.html and update the expectation now that we
pass the two cases (size variant and glyph assembly). We also rebaseline some pixel tests.

* imported/mathml-in-html5/fonts/math/axisheight5000-verticalarrow14000.woff: Updated.
* imported/mathml-in-html5/mathml/presentation-markup/operators/mo-axis-height-1-expected.txt: Updated to expect PASS.
* imported/mathml-in-html5/mathml/presentation-markup/operators/mo-axis-height-1.html: Updated to include the two tests.
* platform/gtk/mathml/opentype/vertical-expected.png: Rebaseline to take into account better alignment of size variant.
* platform/gtk/mathml/opentype/vertical-expected.txt: Ditto.
* platform/gtk/mathml/presentation/mo-stretch-expected.png: Ditto.
* platform/gtk/mathml/presentation/mo-stretch-expected.txt: Ditto.
* platform/ios-simulator/mathml/opentype/opentype-stretchy-expected.txt: Ditto.
* platform/ios-simulator/mathml/presentation/mo-stretch-expected.txt: Ditto.
* platform/mac/mathml/opentype/opentype-stretchy-expected.txt: Ditto.
* platform/mac/mathml/presentation/mo-stretch-expected.txt: Ditto.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (203288 => 203289)


--- trunk/LayoutTests/ChangeLog	2016-07-15 18:39:27 UTC (rev 203288)
+++ trunk/LayoutTests/ChangeLog	2016-07-15 18:47:16 UTC (rev 203289)
@@ -1,3 +1,25 @@
+2016-07-15  Frederic Wang  <[email protected]>
+
+        MathOperator: Improve alignment for vertical size variant
+        https://bugs.webkit.org/show_bug.cgi?id=158866
+
+        Reviewed by Brent Fulgham.
+
+        We import the latest version of mo-axis-height-1.html and update the expectation now that we
+        pass the two cases (size variant and glyph assembly). We also rebaseline some pixel tests.
+
+        * imported/mathml-in-html5/fonts/math/axisheight5000-verticalarrow14000.woff: Updated.
+        * imported/mathml-in-html5/mathml/presentation-markup/operators/mo-axis-height-1-expected.txt: Updated to expect PASS.
+        * imported/mathml-in-html5/mathml/presentation-markup/operators/mo-axis-height-1.html: Updated to include the two tests.
+        * platform/gtk/mathml/opentype/vertical-expected.png: Rebaseline to take into account better alignment of size variant.
+        * platform/gtk/mathml/opentype/vertical-expected.txt: Ditto.
+        * platform/gtk/mathml/presentation/mo-stretch-expected.png: Ditto.
+        * platform/gtk/mathml/presentation/mo-stretch-expected.txt: Ditto.
+        * platform/ios-simulator/mathml/opentype/opentype-stretchy-expected.txt: Ditto.
+        * platform/ios-simulator/mathml/presentation/mo-stretch-expected.txt: Ditto.
+        * platform/mac/mathml/opentype/opentype-stretchy-expected.txt: Ditto.
+        * platform/mac/mathml/presentation/mo-stretch-expected.txt: Ditto.
+
 2016-07-15  Brady Eidson  <[email protected]>
 
         WebKit should prevent push/replace state with username in URL.

Modified: trunk/LayoutTests/imported/mathml-in-html5/fonts/math/axisheight5000-verticalarrow14000.woff (203288 => 203289)


--- trunk/LayoutTests/imported/mathml-in-html5/fonts/math/axisheight5000-verticalarrow14000.woff	2016-07-15 18:39:27 UTC (rev 203288)
+++ trunk/LayoutTests/imported/mathml-in-html5/fonts/math/axisheight5000-verticalarrow14000.woff	2016-07-15 18:47:16 UTC (rev 203289)
@@ -1,15 +1,12 @@
-wOFFOTTO	hCFF Tn\xC1\x8EFFTMhyȐ\xACMATH\x84\x81hTK"OS/2\@`\xF81\x92cmap\xFC@JCB\xE2Phead.6	\xBA\xE0\xD1hhea8$=\xEBhmtx\xD0maxpTPname\x9C^x\x98\xB7\xAF$post< \xFF\x863x\x9Cc`d``b妺M\xF1\xFC6_\xB8\x99_E.G\x99\xCCC\xA6\x99_\x98mRL ,\xA8
-Fx\x9Cc`d``~\xC1\xC0\xC0\x90&AlFT\xC0P\xA02Px\x9Cc`a~\xC18\x81\x81\x95\x81\x81\x99\x87ك\x81\x81a\x84fr`\xB0f4\xD2\xAC\x9C0\xC0\xC4
+wOFFOTTO<	\xBCCFF T*\xA2S(\xEEKFFTM\x80y\xE2\xE9ZMATH\x9C\x8D\x82XQ&#OS/2\@`\xF81\x92cmap\xFC@JCB\xE2Phead.6	\xD5Mhhea8$=\xEBhmtx,\xD0maxpTPname\x9C^x\x99\xB7\xAF%post< \xFF\x863x\x9Cc`d``⯗=\xD5\xE2\xF9m\xBE2p3\xBF\x8A0\NO\xF8\x8AL3\xBF\xF0\xB2RL V5dx\x9Cc`d``~\xC1\xC0\xC0\x90&AlFT\xC0P\xA02Px\x9Cc`a~\xC18\x81\x81\x95\x81\x81\x99\x87ك\x81\x81a\x84fr`\xB0f4\xD2\xAC\x9C0\xC0\xC4
 Ƞ\x81AAq\xF3 +I-(!#\x81\xA3\xC9x\x9C\xBD\x91Kj\xC30E\xAF\x9Dt\x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x9E
+\xF301H0\xC8\xE1tD\xA5\x83\x83\x90%T\xAD\x82$\xCE\xC4\xC0,\xC9\xC0b\xB6.L\xAC \x8A\xF9\x90`\x83\xB2@rLP\x84\\xE3x\x9Cc~\xC1\xC0\xC0\xC4\xA2\xD7
\ No newline at end of file

Modified: trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/operators/mo-axis-height-1-expected.txt (203288 => 203289)


--- trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/operators/mo-axis-height-1-expected.txt	2016-07-15 18:39:27 UTC (rev 203288)
+++ trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/operators/mo-axis-height-1-expected.txt	2016-07-15 18:47:16 UTC (rev 203289)
@@ -1,5 +1,8 @@
+ 
+↨
 
 
-FAIL AxisHeight assert_approx_equals: mo: axis height expected 50 +/- 1 but got 70
+PASS AxisHeight (size variant) 
+PASS AxisHeight (glyph assembly) 
 

Modified: trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/operators/mo-axis-height-1.html (203288 => 203289)


--- trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/operators/mo-axis-height-1.html	2016-07-15 18:39:27 UTC (rev 203288)
+++ trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/operators/mo-axis-height-1.html	2016-07-15 18:47:16 UTC (rev 203289)
@@ -18,7 +18,7 @@
 </style>
 <script>
   var emToPx = 10 / 1000; // font-size: 10px, font.em = 1000
-  var epsilon = 1;
+  var epsilon = 5;
 
   function getBox(aId) {
     return document.getElementById(aId).getBoundingClientRect();
@@ -34,11 +34,23 @@
   function runTests() {
     test(function() {
       var v1 = 5000 * emToPx;
-      var moMiddle = (getBox("mo").bottom + getBox("mo").top) / 2;
-      assert_approx_equals(getBox("baseline").bottom - moMiddle,
+      var moMiddle = (getBox("mo1").bottom + getBox("mo1").top) / 2;
+      assert_approx_equals(getBox("mo1").height,
+                           14000 * emToPx, epsilon, "mo: size");
+      assert_approx_equals(getBox("baseline1").bottom - moMiddle,
                            v1, epsilon, "mo: axis height");
-    }, "AxisHeight");
+    }, "AxisHeight (size variant)");
 
+    test(function() {
+      var v1 = 5000 * emToPx;
+      var moMiddle = (getBox("mo2").bottom + getBox("mo2").top) / 2;
+      assert_approx_equals(getBox("mo2").height,
+                           2 * (getBox("target2").height - v1),
+                           epsilon, "mo: size");
+      assert_approx_equals(getBox("baseline2").bottom - moMiddle,
+                           v1, epsilon, "mo: axis height");
+    }, "AxisHeight (glyph assembly)");
+
     done();
   }
 </script>
@@ -47,11 +59,20 @@
   <p>
     <math style="font-family: axisheight5000-verticalarrow14000;">
       <mrow>
-        <mspace id="baseline" mathbackground="blue" width="100px" height="1px"/>
-        <mo id="mo" mathcolor="green">&#x21A8;</mo>
-        <mspace mathbackground="black" width="10px" height="100px"/>
+        <mspace id="baseline1" mathbackground="blue" width="50px" height="1px"/>
+        <mpadded voffset="50px"><mspace mathbackground="cyan" width="50px" height="1px"/></mpadded>
+        <mo id="mo1" symmetric="true" mathcolor="green">&#x21A8;</mo>
+        <mspace mathbackground="gray" width="10px" height="50px"/>
       </mrow>
     </math>
+    <math style="font-family: axisheight5000-verticalarrow14000;">
+      <mrow>
+        <mspace id="baseline2" mathbackground="blue" width="50px" height="1px"/>
+        <mpadded voffset="50px"><mspace mathbackground="cyan" width="50px" height="1px"/></mpadded>
+        <mo id="mo2" symmetric="true" mathcolor="green">&#x21A8;</mo>
+        <mspace id="target2" mathbackground="gray" width="10px" height="200px"/>
+      </mrow>
+    </math>
   </p>
 </body>
 </html>

Modified: trunk/LayoutTests/platform/gtk/mathml/opentype/vertical-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/gtk/mathml/opentype/vertical-expected.txt (203288 => 203289)


--- trunk/LayoutTests/platform/gtk/mathml/opentype/vertical-expected.txt	2016-07-15 18:39:27 UTC (rev 203288)
+++ trunk/LayoutTests/platform/gtk/mathml/opentype/vertical-expected.txt	2016-07-15 18:47:16 UTC (rev 203289)
@@ -1,10 +1,10 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
-layer at (0,0) size 800x358
-  RenderBlock {HTML} at (0,0) size 800x358
-    RenderBody {BODY} at (8,16) size 784x326
-      RenderBlock {P} at (0,0) size 784x18
-        RenderMathMLMath {math} at (0,2) size 98x16
+layer at (0,0) size 800x362
+  RenderBlock {HTML} at (0,0) size 800x362
+    RenderBody {BODY} at (8,16) size 784x330
+      RenderBlock {P} at (0,0) size 784x19
+        RenderMathMLMath {math} at (0,0) size 98x16
           RenderMathMLOperator {mo} at (0,0) size 4x16
             RenderBlock (anonymous) at (0,0) size 4x16
               RenderText {#text} at (0,-45) size 4x106
@@ -65,10 +65,10 @@
             RenderBlock (anonymous) at (0,0) size 6x16
               RenderText {#text} at (0,-45) size 6x106
                 text run at (0,-45) width 6: "\x{27E9}"
-          RenderMathMLSpace {mspace} at (97,4) size 0x8
+          RenderMathMLSpace {mspace} at (97,8) size 0x8
         RenderText {#text} at (0,0) size 0x0
-      RenderBlock {P} at (0,34) size 784x24
-        RenderMathMLMath {math} at (0,0) size 126x24
+      RenderBlock {P} at (0,35) size 784x27
+        RenderMathMLMath {math} at (0,3) size 126x24
           RenderMathMLOperator {mo} at (0,0) size 7x24
             RenderBlock (anonymous) at (0,0) size 4x16
               RenderText {#text} at (0,-45) size 4x106
@@ -130,60 +130,60 @@
               RenderText {#text} at (0,-45) size 6x106
                 text run at (0,-45) width 6: "\x{27E9}"
           RenderMathMLSpace {mspace} at (125,0) size 0x16
-        RenderText {#text} at (125,2) size 5x17
-          text run at (125,2) width 5: " "
-        RenderMathMLMath {math} at (129,0) size 210x23
-          RenderMathMLOperator {mo} at (0,1) size 17x22
+        RenderText {#text} at (125,5) size 5x17
+          text run at (125,5) width 5: " "
+        RenderMathMLMath {math} at (129,0) size 210x22
+          RenderMathMLOperator {mo} at (0,0) size 17x22
             RenderBlock (anonymous) at (0,0) size 8x15
               RenderText {#text} at (0,-46) size 8x106
                 text run at (0,-46) width 8: "\x{2191}"
-          RenderMathMLOperator {mo} at (16,1) size 18x22
+          RenderMathMLOperator {mo} at (16,0) size 18x22
             RenderBlock (anonymous) at (0,0) size 8x15
               RenderText {#text} at (0,-45) size 8x106
                 text run at (0,-45) width 8: "\x{2193}"
-          RenderMathMLOperator {mo} at (33,3) size 18x18
+          RenderMathMLOperator {mo} at (33,2) size 18x18
             RenderBlock (anonymous) at (0,0) size 8x18
               RenderText {#text} at (0,-44) size 8x106
                 text run at (0,-44) width 8: "\x{2195}"
-          RenderMathMLOperator {mo} at (50,1) size 20x22
+          RenderMathMLOperator {mo} at (50,0) size 20x22
             RenderBlock (anonymous) at (0,0) size 10x14
               RenderText {#text} at (0,-46) size 10x106
                 text run at (0,-46) width 10: "\x{21A5}"
-          RenderMathMLOperator {mo} at (69,1) size 20x22
+          RenderMathMLOperator {mo} at (69,0) size 20x22
             RenderBlock (anonymous) at (0,0) size 10x14
               RenderText {#text} at (0,-46) size 10x106
                 text run at (0,-46) width 10: "\x{21A7}"
-          RenderMathMLOperator {mo} at (88,4) size 17x16
+          RenderMathMLOperator {mo} at (88,3) size 17x16
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,-45) size 7x106
                 text run at (0,-45) width 7: "\x{21BE}"
-          RenderMathMLOperator {mo} at (104,4) size 17x16
+          RenderMathMLOperator {mo} at (104,3) size 17x16
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,-45) size 7x106
                 text run at (0,-45) width 7: "\x{21C2}"
-          RenderMathMLOperator {mo} at (120,4) size 16x16
+          RenderMathMLOperator {mo} at (120,3) size 16x16
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,-45) size 7x106
                 text run at (0,-45) width 7: "\x{21BF}"
-          RenderMathMLOperator {mo} at (136,4) size 16x16
+          RenderMathMLOperator {mo} at (136,3) size 16x16
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,-45) size 7x106
                 text run at (0,-45) width 7: "\x{21C3}"
-          RenderMathMLOperator {mo} at (151,1) size 20x22
+          RenderMathMLOperator {mo} at (151,0) size 20x22
             RenderBlock (anonymous) at (0,0) size 10x15
               RenderText {#text} at (0,-46) size 10x106
                 text run at (0,-46) width 10: "\x{21D1}"
-          RenderMathMLOperator {mo} at (170,1) size 20x22
+          RenderMathMLOperator {mo} at (170,0) size 20x22
             RenderBlock (anonymous) at (0,0) size 10x15
               RenderText {#text} at (0,-45) size 10x106
                 text run at (0,-45) width 10: "\x{21D3}"
-          RenderMathMLOperator {mo} at (189,4) size 20x16
+          RenderMathMLOperator {mo} at (189,3) size 20x16
             RenderBlock (anonymous) at (0,0) size 10x16
               RenderText {#text} at (0,-45) size 10x106
                 text run at (0,-45) width 10: "\x{21D5}"
-          RenderMathMLSpace {mspace} at (208,0) size 0x16
+          RenderMathMLSpace {mspace} at (208,3) size 0x16
         RenderText {#text} at (0,0) size 0x0
-      RenderBlock {P} at (0,74) size 784x42
+      RenderBlock {P} at (0,78) size 784x42
         RenderMathMLMath {math} at (0,0) size 158x42
           RenderMathMLOperator {mo} at (0,1) size 8x40
             RenderBlock (anonymous) at (0,0) size 4x16
@@ -247,7 +247,7 @@
                 text run at (0,-45) width 6: "\x{27E9}"
           RenderMathMLSpace {mspace} at (157,1) size 0x24
         RenderText {#text} at (0,0) size 0x0
-      RenderBlock {P} at (0,132) size 784x58
+      RenderBlock {P} at (0,136) size 784x58
         RenderMathMLMath {math} at (0,0) size 192x58
           RenderMathMLOperator {mo} at (0,1) size 11x56
             RenderBlock (anonymous) at (0,0) size 4x16
@@ -363,7 +363,7 @@
                 text run at (0,-45) width 10: "\x{21D5}"
           RenderMathMLSpace {mspace} at (209,0) size 0x32
         RenderText {#text} at (0,0) size 0x0
-      RenderBlock {P} at (0,206) size 784x120
+      RenderBlock {P} at (0,210) size 784x120
         RenderMathMLMath {math} at (0,0) size 192x120
           RenderMathMLOperator {mo} at (0,0) size 11x120
             RenderBlock (anonymous) at (0,0) size 4x16

Modified: trunk/LayoutTests/platform/gtk/mathml/presentation/mo-stretch-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/gtk/mathml/presentation/mo-stretch-expected.txt (203288 => 203289)


--- trunk/LayoutTests/platform/gtk/mathml/presentation/mo-stretch-expected.txt	2016-07-15 18:39:27 UTC (rev 203288)
+++ trunk/LayoutTests/platform/gtk/mathml/presentation/mo-stretch-expected.txt	2016-07-15 18:47:16 UTC (rev 203289)
@@ -1,8 +1,8 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
-layer at (0,0) size 800x268
-  RenderBlock {HTML} at (0,0) size 800x268
-    RenderBody {BODY} at (8,8) size 784x252
+layer at (0,0) size 800x269
+  RenderBlock {HTML} at (0,0) size 800x269
+    RenderBody {BODY} at (8,8) size 784x253
       RenderMathMLMath {math} at (0,0) size 130x36
         RenderMathMLRow {mrow} at (0,0) size 130x36
           RenderMathMLOperator {mo} at (0,6) size 8x24
@@ -53,11 +53,11 @@
             RenderBlock (anonymous) at (0,0) size 4x16
               RenderText {#text} at (0,-45) size 4x106
                 text run at (0,-45) width 4: "|"
-          RenderMathMLOperator {mo} at (106,10) size 7x16
+          RenderMathMLOperator {mo} at (106,6) size 7x16
             RenderBlock (anonymous) at (0,0) size 6x16
               RenderText {#text} at (0,-45) size 6x106
                 text run at (0,-45) width 6: "\x{2016}"
-          RenderMathMLOperator {mo} at (112,10) size 18x16
+          RenderMathMLOperator {mo} at (112,6) size 18x16
             RenderBlock (anonymous) at (0,0) size 8x16
               RenderText {#text} at (0,-45) size 8x106
                 text run at (0,-45) width 8: "\x{2225}"
@@ -125,65 +125,65 @@
           RenderMathMLSpace {mspace} at (169,0) size 0x76
       RenderText {#text} at (169,97) size 5x17
         text run at (169,97) width 5: " "
-      RenderMathMLMath {math} at (173,61) size 170x92
-        RenderMathMLRow {mrow} at (0,0) size 170x92
-          RenderMathMLOperator {mo} at (0,0) size 14x92
+      RenderMathMLMath {math} at (173,57) size 170x96
+        RenderMathMLRow {mrow} at (0,0) size 170x96
+          RenderMathMLOperator {mo} at (0,4) size 14x92
             RenderBlock (anonymous) at (0,0) size 6x16
               RenderText {#text} at (0,-45) size 6x106
                 text run at (0,-45) width 6: "("
-          RenderMathMLOperator {mo} at (14,0) size 14x92
+          RenderMathMLOperator {mo} at (14,4) size 14x92
             RenderBlock (anonymous) at (0,0) size 6x16
               RenderText {#text} at (0,-45) size 6x106
                 text run at (0,-45) width 6: ")"
-          RenderMathMLOperator {mo} at (28,0) size 14x92
+          RenderMathMLOperator {mo} at (28,4) size 14x92
             RenderBlock (anonymous) at (0,0) size 8x16
               RenderText {#text} at (0,-45) size 8x106
                 text run at (0,-45) width 8: "{"
-          RenderMathMLOperator {mo} at (42,0) size 14x92
+          RenderMathMLOperator {mo} at (42,4) size 14x92
             RenderBlock (anonymous) at (0,0) size 8x16
               RenderText {#text} at (0,-45) size 8x106
                 text run at (0,-45) width 8: "}"
-          RenderMathMLOperator {mo} at (56,0) size 11x92
+          RenderMathMLOperator {mo} at (56,4) size 11x92
             RenderBlock (anonymous) at (0,0) size 4x16
               RenderText {#text} at (0,-45) size 4x106
                 text run at (0,-45) width 4: "["
-          RenderMathMLOperator {mo} at (67,0) size 11x92
+          RenderMathMLOperator {mo} at (67,4) size 11x92
             RenderBlock (anonymous) at (0,0) size 4x16
               RenderText {#text} at (0,-45) size 4x106
                 text run at (0,-45) width 4: "]"
-          RenderMathMLOperator {mo} at (78,0) size 11x92
+          RenderMathMLOperator {mo} at (78,4) size 11x92
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,-45) size 7x106
                 text run at (0,-45) width 7: "\x{2308}"
-          RenderMathMLOperator {mo} at (89,0) size 11x92
+          RenderMathMLOperator {mo} at (89,4) size 11x92
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,-45) size 7x106
                 text run at (0,-45) width 7: "\x{2309}"
-          RenderMathMLOperator {mo} at (100,0) size 11x92
+          RenderMathMLOperator {mo} at (100,4) size 11x92
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,-45) size 7x106
                 text run at (0,-45) width 7: "\x{230A}"
-          RenderMathMLOperator {mo} at (111,0) size 11x92
+          RenderMathMLOperator {mo} at (111,4) size 11x92
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,-45) size 7x106
                 text run at (0,-45) width 7: "\x{230B}"
-          RenderMathMLOperator {mo} at (122,28) size 17x36
+          RenderMathMLOperator {mo} at (122,32) size 17x36
             RenderBlock (anonymous) at (0,0) size 11x18
               RenderText {#text} at (0,-44) size 11x106
                 text run at (0,-44) width 11: "\x{222B}"
-          RenderMathMLOperator {mo} at (138,0) size 9x92
+          RenderMathMLOperator {mo} at (138,4) size 9x92
             RenderBlock (anonymous) at (0,0) size 4x16
               RenderText {#text} at (0,-45) size 4x106
                 text run at (0,-45) width 4: "|"
-          RenderMathMLOperator {mo} at (146,17) size 8x58
+          RenderMathMLOperator {mo} at (146,0) size 8x58
             RenderBlock (anonymous) at (0,0) size 6x16
               RenderText {#text} at (0,-45) size 6x106
                 text run at (0,-45) width 6: "\x{2016}"
-          RenderMathMLOperator {mo} at (153,17) size 17x58
+          RenderMathMLOperator {mo} at (153,0) size 17x58
             RenderBlock (anonymous) at (0,0) size 8x16
               RenderText {#text} at (0,-45) size 8x106
                 text run at (0,-45) width 8: "\x{2225}"
-          RenderMathMLSpace {mspace} at (169,0) size 0x51
+          RenderMathMLSpace {mspace} at (169,4) size 0x51
       RenderText {#text} at (342,97) size 5x17
         text run at (342,97) width 5: " "
       RenderMathMLMath {math} at (346,89) size 142x36
@@ -236,11 +236,11 @@
             RenderBlock (anonymous) at (0,0) size 4x16
               RenderText {#text} at (0,-45) size 4x106
                 text run at (0,-45) width 4: "|"
-          RenderMathMLOperator {mo} at (120,6) size 7x24
+          RenderMathMLOperator {mo} at (120,0) size 7x24
             RenderBlock (anonymous) at (0,0) size 6x16
               RenderText {#text} at (0,-45) size 6x106
                 text run at (0,-45) width 6: "\x{2016}"
-          RenderMathMLOperator {mo} at (126,6) size 16x24
+          RenderMathMLOperator {mo} at (126,0) size 16x24
             RenderBlock (anonymous) at (0,0) size 8x16
               RenderText {#text} at (0,-45) size 8x106
                 text run at (0,-45) width 8: "\x{2225}"
@@ -248,63 +248,63 @@
       RenderText {#text} at (487,97) size 5x17
         text run at (487,97) width 5: " "
       RenderBR {BR} at (0,0) size 0x0
-      RenderMathMLMath {math} at (0,178) size 185x75
-        RenderMathMLRoot {msqrt} at (0,0) size 185x75
-          RenderMathMLOperator {mo} at (17,2) size 14x73
+      RenderMathMLMath {math} at (0,178) size 185x76
+        RenderMathMLRoot {msqrt} at (0,0) size 185x76
+          RenderMathMLOperator {mo} at (17,3) size 14x73
             RenderBlock (anonymous) at (0,0) size 6x16
               RenderText {#text} at (0,-45) size 6x106
                 text run at (0,-45) width 6: "("
-          RenderMathMLOperator {mo} at (31,2) size 14x73
+          RenderMathMLOperator {mo} at (31,3) size 14x73
             RenderBlock (anonymous) at (0,0) size 6x16
               RenderText {#text} at (0,-45) size 6x106
                 text run at (0,-45) width 6: ")"
-          RenderMathMLOperator {mo} at (45,2) size 14x73
+          RenderMathMLOperator {mo} at (45,3) size 14x73
             RenderBlock (anonymous) at (0,0) size 8x16
               RenderText {#text} at (0,-45) size 8x106
                 text run at (0,-45) width 8: "{"
-          RenderMathMLOperator {mo} at (59,2) size 14x73
+          RenderMathMLOperator {mo} at (59,3) size 14x73
             RenderBlock (anonymous) at (0,0) size 8x16
               RenderText {#text} at (0,-45) size 8x106
                 text run at (0,-45) width 8: "}"
-          RenderMathMLOperator {mo} at (73,2) size 11x73
+          RenderMathMLOperator {mo} at (73,3) size 11x73
             RenderBlock (anonymous) at (0,0) size 4x16
               RenderText {#text} at (0,-45) size 4x106
                 text run at (0,-45) width 4: "["
-          RenderMathMLOperator {mo} at (84,2) size 11x73
+          RenderMathMLOperator {mo} at (84,3) size 11x73
             RenderBlock (anonymous) at (0,0) size 4x16
               RenderText {#text} at (0,-45) size 4x106
                 text run at (0,-45) width 4: "]"
-          RenderMathMLOperator {mo} at (95,2) size 11x73
+          RenderMathMLOperator {mo} at (95,3) size 11x73
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,-45) size 7x106
                 text run at (0,-45) width 7: "\x{2308}"
-          RenderMathMLOperator {mo} at (106,2) size 11x73
+          RenderMathMLOperator {mo} at (106,3) size 11x73
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,-45) size 7x106
                 text run at (0,-45) width 7: "\x{2309}"
-          RenderMathMLOperator {mo} at (117,2) size 11x73
+          RenderMathMLOperator {mo} at (117,3) size 11x73
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,-45) size 7x106
                 text run at (0,-45) width 7: "\x{230A}"
-          RenderMathMLOperator {mo} at (128,2) size 11x73
+          RenderMathMLOperator {mo} at (128,3) size 11x73
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,-45) size 7x106
                 text run at (0,-45) width 7: "\x{230B}"
-          RenderMathMLOperator {mo} at (139,20) size 17x37
+          RenderMathMLOperator {mo} at (139,21) size 17x37
             RenderBlock (anonymous) at (0,0) size 11x18
               RenderText {#text} at (0,-44) size 11x106
                 text run at (0,-44) width 11: "\x{222B}"
-          RenderMathMLOperator {mo} at (155,2) size 9x73
+          RenderMathMLOperator {mo} at (155,3) size 9x73
             RenderBlock (anonymous) at (0,0) size 4x16
               RenderText {#text} at (0,-45) size 4x106
                 text run at (0,-45) width 4: "|"
-          RenderMathMLOperator {mo} at (163,17) size 7x43
+          RenderMathMLOperator {mo} at (163,2) size 7x43
             RenderBlock (anonymous) at (0,0) size 6x16
               RenderText {#text} at (0,-45) size 6x106
                 text run at (0,-45) width 6: "\x{2016}"
-          RenderMathMLOperator {mo} at (169,17) size 16x43
+          RenderMathMLOperator {mo} at (169,2) size 16x43
             RenderBlock (anonymous) at (0,0) size 8x16
               RenderText {#text} at (0,-45) size 8x106
                 text run at (0,-45) width 8: "\x{2225}"
-          RenderMathMLSpace {mspace} at (184,2) size 0x42
+          RenderMathMLSpace {mspace} at (184,3) size 0x42
       RenderText {#text} at (0,0) size 0x0

Modified: trunk/LayoutTests/platform/ios-simulator/mathml/opentype/opentype-stretchy-expected.txt (203288 => 203289)


--- trunk/LayoutTests/platform/ios-simulator/mathml/opentype/opentype-stretchy-expected.txt	2016-07-15 18:39:27 UTC (rev 203288)
+++ trunk/LayoutTests/platform/ios-simulator/mathml/opentype/opentype-stretchy-expected.txt	2016-07-15 18:47:16 UTC (rev 203289)
@@ -1,25 +1,25 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
-layer at (0,0) size 800x342
-  RenderBlock {HTML} at (0,0) size 800x342
-    RenderBody {BODY} at (8,16) size 784x310
-      RenderBlock {P} at (0,0) size 784x36
-        RenderMathMLMath {math} at (0,21) size 26x11
+layer at (0,0) size 800x341
+  RenderBlock {HTML} at (0,0) size 800x341
+    RenderBody {BODY} at (8,16) size 784x309
+      RenderBlock {P} at (0,0) size 784x35
+        RenderMathMLMath {math} at (0,20) size 26x11
           RenderMathMLRow {mrow} at (0,0) size 26x11
             RenderMathMLOperator {mo} at (0,0) size 26x11
               RenderBlock (anonymous) at (0,0) size 3x3
                 RenderText {#text} at (0,-3) size 3x0
                   text run at (0,-3) width 3: "\x{219F}"
-        RenderText {#text} at (26,16) size 4x19
-          text run at (26,16) width 4: " "
-        RenderMathMLMath {math} at (30,11) size 26x21
+        RenderText {#text} at (26,15) size 4x19
+          text run at (26,15) width 4: " "
+        RenderMathMLMath {math} at (30,10) size 26x21
           RenderMathMLRow {mrow} at (0,0) size 26x21
             RenderMathMLOperator {mo} at (0,0) size 26x21
               RenderBlock (anonymous) at (0,0) size 3x3
                 RenderText {#text} at (0,-3) size 3x0
                   text run at (0,-3) width 3: "\x{219F}"
-        RenderText {#text} at (56,16) size 4x19
-          text run at (56,16) width 4: " "
+        RenderText {#text} at (56,15) size 4x19
+          text run at (56,15) width 4: " "
         RenderMathMLMath {math} at (60,0) size 26x31
           RenderMathMLRow {mrow} at (0,0) size 26x31
             RenderMathMLOperator {mo} at (0,0) size 26x31
@@ -27,7 +27,7 @@
                 RenderText {#text} at (0,-3) size 3x0
                   text run at (0,-3) width 3: "\x{219F}"
         RenderText {#text} at (0,0) size 0x0
-      RenderBlock {P} at (0,52) size 784x155
+      RenderBlock {P} at (0,51) size 784x155
         RenderMathMLMath {math} at (0,0) size 47x150
           RenderMathMLRow {mrow} at (0,0) size 47x150
             RenderMathMLOperator {mo} at (0,0) size 47x150
@@ -35,7 +35,7 @@
                 RenderText {#text} at (0,-3) size 3x0
                   text run at (0,-3) width 3: "\x{219F}"
         RenderText {#text} at (0,0) size 0x0
-      RenderBlock {P} at (0,223) size 784x87
+      RenderBlock {P} at (0,222) size 784x87
         RenderMathMLMath {math} at (0,0) size 84x82
           RenderMathMLRow {mrow} at (0,0) size 84x82
             RenderMathMLOperator {mo} at (0,0) size 84x82

Modified: trunk/LayoutTests/platform/ios-simulator/mathml/presentation/mo-stretch-expected.txt (203288 => 203289)


--- trunk/LayoutTests/platform/ios-simulator/mathml/presentation/mo-stretch-expected.txt	2016-07-15 18:39:27 UTC (rev 203288)
+++ trunk/LayoutTests/platform/ios-simulator/mathml/presentation/mo-stretch-expected.txt	2016-07-15 18:47:16 UTC (rev 203289)
@@ -3,7 +3,7 @@
 layer at (0,0) size 800x252
   RenderBlock {HTML} at (0,0) size 800x252
     RenderBody {BODY} at (8,8) size 784x236
-      RenderMathMLMath {math} at (0,2) size 58x18
+      RenderMathMLMath {math} at (0,3) size 58x18
         RenderMathMLRow {mrow} at (0,0) size 58x18
           RenderMathMLOperator {mo} at (0,1) size 6x15
             RenderBlock (anonymous) at (0,0) size 6x16
@@ -13,11 +13,11 @@
             RenderBlock (anonymous) at (0,0) size 6x16
               RenderText {#text} at (0,0) size 6x17
                 text run at (0,0) width 6: ")"
-          RenderMathMLOperator {mo} at (10,1) size 9x16
+          RenderMathMLOperator {mo} at (10,0) size 9x16
             RenderBlock (anonymous) at (0,0) size 8x17
               RenderText {#text} at (0,1) size 8x17
                 text run at (0,1) width 8: "{"
-          RenderMathMLOperator {mo} at (18,1) size 8x16
+          RenderMathMLOperator {mo} at (18,0) size 8x16
             RenderBlock (anonymous) at (0,0) size 8x17
               RenderText {#text} at (0,1) size 8x17
                 text run at (0,1) width 8: "}"
@@ -29,19 +29,19 @@
             RenderBlock (anonymous) at (0,0) size 6x16
               RenderText {#text} at (0,0) size 6x17
                 text run at (0,0) width 6: "]"
-          RenderMathMLOperator {mo} at (36,13) size 0x0
+          RenderMathMLOperator {mo} at (36,8) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{2308}"
-          RenderMathMLOperator {mo} at (36,13) size 0x0
+          RenderMathMLOperator {mo} at (36,8) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{2309}"
-          RenderMathMLOperator {mo} at (36,13) size 0x0
+          RenderMathMLOperator {mo} at (36,8) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{230A}"
-          RenderMathMLOperator {mo} at (36,13) size 0x0
+          RenderMathMLOperator {mo} at (36,8) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{230B}"
@@ -53,11 +53,11 @@
             RenderBlock (anonymous) at (0,0) size 4x18
               RenderText {#text} at (0,1) size 4x17
                 text run at (0,1) width 4: "|"
-          RenderMathMLOperator {mo} at (48,13) size 0x0
+          RenderMathMLOperator {mo} at (48,4) size 0x0
             RenderBlock (anonymous) at (0,0) size 5x13
               RenderText {#text} at (0,0) size 5x17
                 text run at (0,0) width 5: "\x{2016}"
-          RenderMathMLOperator {mo} at (48,13) size 10x0
+          RenderMathMLOperator {mo} at (48,4) size 10x0
             RenderBlock (anonymous) at (0,0) size 11x13
               RenderText {#text} at (0,0) size 11x17
                 text run at (0,0) width 11: "\x{2225}"
@@ -90,19 +90,19 @@
             RenderBlock (anonymous) at (0,0) size 6x16
               RenderText {#text} at (0,0) size 6x17
                 text run at (0,0) width 6: "]"
-          RenderMathMLOperator {mo} at (40,75) size 0x0
+          RenderMathMLOperator {mo} at (40,71) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{2308}"
-          RenderMathMLOperator {mo} at (40,75) size 0x0
+          RenderMathMLOperator {mo} at (40,71) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{2309}"
-          RenderMathMLOperator {mo} at (40,75) size 0x0
+          RenderMathMLOperator {mo} at (40,71) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{230A}"
-          RenderMathMLOperator {mo} at (40,75) size 0x0
+          RenderMathMLOperator {mo} at (40,71) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{230B}"
@@ -114,11 +114,11 @@
             RenderBlock (anonymous) at (0,0) size 4x18
               RenderText {#text} at (0,1) size 4x17
                 text run at (0,1) width 4: "|"
-          RenderMathMLOperator {mo} at (58,75) size 0x0
+          RenderMathMLOperator {mo} at (58,38) size 0x0
             RenderBlock (anonymous) at (0,0) size 5x13
               RenderText {#text} at (0,0) size 5x17
                 text run at (0,0) width 5: "\x{2016}"
-          RenderMathMLOperator {mo} at (58,75) size 10x0
+          RenderMathMLOperator {mo} at (58,38) size 10x0
             RenderBlock (anonymous) at (0,0) size 11x13
               RenderText {#text} at (0,0) size 11x17
                 text run at (0,0) width 11: "\x{2225}"
@@ -151,19 +151,19 @@
             RenderBlock (anonymous) at (0,0) size 6x16
               RenderText {#text} at (0,0) size 6x17
                 text run at (0,0) width 6: "]"
-          RenderMathMLOperator {mo} at (40,50) size 0x0
+          RenderMathMLOperator {mo} at (40,46) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{2308}"
-          RenderMathMLOperator {mo} at (40,50) size 0x0
+          RenderMathMLOperator {mo} at (40,46) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{2309}"
-          RenderMathMLOperator {mo} at (40,50) size 0x0
+          RenderMathMLOperator {mo} at (40,46) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{230A}"
-          RenderMathMLOperator {mo} at (40,50) size 0x0
+          RenderMathMLOperator {mo} at (40,46) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{230B}"
@@ -175,11 +175,11 @@
             RenderBlock (anonymous) at (0,0) size 4x18
               RenderText {#text} at (0,1) size 4x17
                 text run at (0,1) width 4: "|"
-          RenderMathMLOperator {mo} at (58,50) size 0x0
+          RenderMathMLOperator {mo} at (58,25) size 0x0
             RenderBlock (anonymous) at (0,0) size 5x13
               RenderText {#text} at (0,0) size 5x17
                 text run at (0,0) width 5: "\x{2016}"
-          RenderMathMLOperator {mo} at (58,50) size 10x0
+          RenderMathMLOperator {mo} at (58,25) size 10x0
             RenderBlock (anonymous) at (0,0) size 11x13
               RenderText {#text} at (0,0) size 11x17
                 text run at (0,0) width 11: "\x{2225}"
@@ -212,19 +212,19 @@
             RenderBlock (anonymous) at (0,0) size 6x16
               RenderText {#text} at (0,0) size 6x17
                 text run at (0,0) width 6: "]"
-          RenderMathMLOperator {mo} at (39,20) size 0x0
+          RenderMathMLOperator {mo} at (39,16) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{2308}"
-          RenderMathMLOperator {mo} at (39,20) size 0x0
+          RenderMathMLOperator {mo} at (39,16) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{2309}"
-          RenderMathMLOperator {mo} at (39,20) size 0x0
+          RenderMathMLOperator {mo} at (39,16) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{230A}"
-          RenderMathMLOperator {mo} at (39,20) size 0x0
+          RenderMathMLOperator {mo} at (39,16) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{230B}"
@@ -232,15 +232,15 @@
             RenderBlock (anonymous) at (0,0) size 5x16
               RenderText {#text} at (0,1) size 5x17
                 text run at (0,1) width 5: "\x{222B}"
-          RenderMathMLOperator {mo} at (51,7) size 8x18
+          RenderMathMLOperator {mo} at (51,8) size 8x18
             RenderBlock (anonymous) at (0,0) size 4x18
               RenderText {#text} at (0,1) size 4x17
                 text run at (0,1) width 4: "|"
-          RenderMathMLOperator {mo} at (58,20) size 0x0
+          RenderMathMLOperator {mo} at (58,10) size 0x0
             RenderBlock (anonymous) at (0,0) size 5x13
               RenderText {#text} at (0,0) size 5x17
                 text run at (0,0) width 5: "\x{2016}"
-          RenderMathMLOperator {mo} at (58,20) size 10x0
+          RenderMathMLOperator {mo} at (58,10) size 10x0
             RenderBlock (anonymous) at (0,0) size 11x13
               RenderText {#text} at (0,0) size 11x17
                 text run at (0,0) width 11: "\x{2225}"
@@ -274,19 +274,19 @@
             RenderBlock (anonymous) at (0,0) size 6x16
               RenderText {#text} at (0,0) size 6x17
                 text run at (0,0) width 6: "]"
-          RenderMathMLOperator {mo} at (49,41) size 0x0
+          RenderMathMLOperator {mo} at (49,37) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{2308}"
-          RenderMathMLOperator {mo} at (49,41) size 0x0
+          RenderMathMLOperator {mo} at (49,37) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{2309}"
-          RenderMathMLOperator {mo} at (49,41) size 0x0
+          RenderMathMLOperator {mo} at (49,37) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{230A}"
-          RenderMathMLOperator {mo} at (49,41) size 0x0
+          RenderMathMLOperator {mo} at (49,37) size 0x0
             RenderBlock (anonymous) at (0,0) size 7x16
               RenderText {#text} at (0,1) size 7x17
                 text run at (0,1) width 7: "\x{230B}"
@@ -298,11 +298,11 @@
             RenderBlock (anonymous) at (0,0) size 4x18
               RenderText {#text} at (0,1) size 4x17
                 text run at (0,1) width 4: "|"
-          RenderMathMLOperator {mo} at (67,41) size 0x0
+          RenderMathMLOperator {mo} at (67,21) size 0x0
             RenderBlock (anonymous) at (0,0) size 5x13
               RenderText {#text} at (0,0) size 5x17
                 text run at (0,0) width 5: "\x{2016}"
-          RenderMathMLOperator {mo} at (67,41) size 10x0
+          RenderMathMLOperator {mo} at (67,21) size 10x0
             RenderBlock (anonymous) at (0,0) size 11x13
               RenderText {#text} at (0,0) size 11x17
                 text run at (0,0) width 11: "\x{2225}"

Modified: trunk/LayoutTests/platform/mac/mathml/opentype/opentype-stretchy-expected.txt (203288 => 203289)


--- trunk/LayoutTests/platform/mac/mathml/opentype/opentype-stretchy-expected.txt	2016-07-15 18:39:27 UTC (rev 203288)
+++ trunk/LayoutTests/platform/mac/mathml/opentype/opentype-stretchy-expected.txt	2016-07-15 18:47:16 UTC (rev 203289)
@@ -1,25 +1,25 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
-layer at (0,0) size 800x339
-  RenderBlock {HTML} at (0,0) size 800x339
-    RenderBody {BODY} at (8,16) size 784x307
-      RenderBlock {P} at (0,0) size 784x35
-        RenderMathMLMath {math} at (0,21) size 26x11
+layer at (0,0) size 800x338
+  RenderBlock {HTML} at (0,0) size 800x338
+    RenderBody {BODY} at (8,16) size 784x306
+      RenderBlock {P} at (0,0) size 784x34
+        RenderMathMLMath {math} at (0,20) size 26x11
           RenderMathMLRow {mrow} at (0,0) size 26x11
             RenderMathMLOperator {mo} at (0,0) size 26x11
               RenderBlock (anonymous) at (0,0) size 3x3
                 RenderText {#text} at (0,-3) size 3x0
                   text run at (0,-3) width 3: "\x{219F}"
-        RenderText {#text} at (26,17) size 4x18
-          text run at (26,17) width 4: " "
-        RenderMathMLMath {math} at (30,11) size 26x21
+        RenderText {#text} at (26,16) size 4x18
+          text run at (26,16) width 4: " "
+        RenderMathMLMath {math} at (30,10) size 26x21
           RenderMathMLRow {mrow} at (0,0) size 26x21
             RenderMathMLOperator {mo} at (0,0) size 26x21
               RenderBlock (anonymous) at (0,0) size 3x3
                 RenderText {#text} at (0,-3) size 3x0
                   text run at (0,-3) width 3: "\x{219F}"
-        RenderText {#text} at (56,17) size 4x18
-          text run at (56,17) width 4: " "
+        RenderText {#text} at (56,16) size 4x18
+          text run at (56,16) width 4: " "
         RenderMathMLMath {math} at (60,0) size 26x31
           RenderMathMLRow {mrow} at (0,0) size 26x31
             RenderMathMLOperator {mo} at (0,0) size 26x31
@@ -27,7 +27,7 @@
                 RenderText {#text} at (0,-3) size 3x0
                   text run at (0,-3) width 3: "\x{219F}"
         RenderText {#text} at (0,0) size 0x0
-      RenderBlock {P} at (0,51) size 784x154
+      RenderBlock {P} at (0,50) size 784x154
         RenderMathMLMath {math} at (0,0) size 47x150
           RenderMathMLRow {mrow} at (0,0) size 47x150
             RenderMathMLOperator {mo} at (0,0) size 47x150
@@ -35,7 +35,7 @@
                 RenderText {#text} at (0,-3) size 3x0
                   text run at (0,-3) width 3: "\x{219F}"
         RenderText {#text} at (0,0) size 0x0
-      RenderBlock {P} at (0,221) size 784x86
+      RenderBlock {P} at (0,220) size 784x86
         RenderMathMLMath {math} at (0,0) size 84x82
           RenderMathMLRow {mrow} at (0,0) size 84x82
             RenderMathMLOperator {mo} at (0,0) size 84x82

Modified: trunk/LayoutTests/platform/mac/mathml/presentation/mo-stretch-expected.txt (203288 => 203289)


--- trunk/LayoutTests/platform/mac/mathml/presentation/mo-stretch-expected.txt	2016-07-15 18:39:27 UTC (rev 203288)
+++ trunk/LayoutTests/platform/mac/mathml/presentation/mo-stretch-expected.txt	2016-07-15 18:47:16 UTC (rev 203289)
@@ -5,27 +5,27 @@
     RenderBody {BODY} at (8,8) size 784x240
       RenderMathMLMath {math} at (0,0) size 108x25
         RenderMathMLRow {mrow} at (0,0) size 108x25
-          RenderMathMLOperator {mo} at (0,5) size 6x14
+          RenderMathMLOperator {mo} at (0,6) size 6x14
             RenderBlock (anonymous) at (0,0) size 6x14
               RenderText {#text} at (0,-6) size 6x24
                 text run at (0,-6) width 6: "("
-          RenderMathMLOperator {mo} at (5,5) size 6x14
+          RenderMathMLOperator {mo} at (5,6) size 6x14
             RenderBlock (anonymous) at (0,0) size 6x14
               RenderText {#text} at (0,-6) size 6x24
                 text run at (0,-6) width 6: ")"
-          RenderMathMLOperator {mo} at (10,5) size 9x14
+          RenderMathMLOperator {mo} at (10,6) size 9x14
             RenderBlock (anonymous) at (0,0) size 8x14
               RenderText {#text} at (0,-6) size 8x24
                 text run at (0,-6) width 8: "{"
-          RenderMathMLOperator {mo} at (18,5) size 8x14
+          RenderMathMLOperator {mo} at (18,6) size 8x14
             RenderBlock (anonymous) at (0,0) size 8x14
               RenderText {#text} at (0,-6) size 8x24
                 text run at (0,-6) width 8: "}"
-          RenderMathMLOperator {mo} at (25,5) size 7x14
+          RenderMathMLOperator {mo} at (25,6) size 7x14
             RenderBlock (anonymous) at (0,0) size 6x14
               RenderText {#text} at (0,-6) size 6x24
                 text run at (0,-6) width 6: "["
-          RenderMathMLOperator {mo} at (31,5) size 6x14
+          RenderMathMLOperator {mo} at (31,6) size 6x14
             RenderBlock (anonymous) at (0,0) size 6x14
               RenderText {#text} at (0,-6) size 6x24
                 text run at (0,-6) width 6: "]"
@@ -53,11 +53,11 @@
             RenderBlock (anonymous) at (0,0) size 4x12
               RenderText {#text} at (0,-6) size 4x24
                 text run at (0,-6) width 4: "|"
-          RenderMathMLOperator {mo} at (81,5) size 9x15
+          RenderMathMLOperator {mo} at (81,1) size 9x15
             RenderBlock (anonymous) at (0,0) size 9x16
               RenderText {#text} at (0,-5) size 9x24
                 text run at (0,-5) width 9: "\x{2016}"
-          RenderMathMLOperator {mo} at (89,5) size 19x15
+          RenderMathMLOperator {mo} at (89,1) size 19x15
             RenderBlock (anonymous) at (0,0) size 9x16
               RenderText {#text} at (0,-5) size 9x24
                 text run at (0,-5) width 9: "\x{2225}"
@@ -196,11 +196,11 @@
             RenderBlock (anonymous) at (0,0) size 6x14
               RenderText {#text} at (0,-6) size 6x24
                 text run at (0,-6) width 6: ")"
-          RenderMathMLOperator {mo} at (14,9) size 9x14
+          RenderMathMLOperator {mo} at (14,10) size 9x14
             RenderBlock (anonymous) at (0,0) size 8x14
               RenderText {#text} at (0,-6) size 8x24
                 text run at (0,-6) width 8: "{"
-          RenderMathMLOperator {mo} at (22,9) size 8x14
+          RenderMathMLOperator {mo} at (22,10) size 8x14
             RenderBlock (anonymous) at (0,0) size 8x14
               RenderText {#text} at (0,-6) size 8x24
                 text run at (0,-6) width 8: "}"
@@ -236,11 +236,11 @@
             RenderBlock (anonymous) at (0,0) size 4x12
               RenderText {#text} at (0,-6) size 4x24
                 text run at (0,-6) width 4: "|"
-          RenderMathMLOperator {mo} at (87,9) size 10x15
+          RenderMathMLOperator {mo} at (87,3) size 10x15
             RenderBlock (anonymous) at (0,0) size 9x16
               RenderText {#text} at (0,-5) size 9x24
                 text run at (0,-5) width 9: "\x{2016}"
-          RenderMathMLOperator {mo} at (96,9) size 18x15
+          RenderMathMLOperator {mo} at (96,3) size 18x15
             RenderBlock (anonymous) at (0,0) size 9x16
               RenderText {#text} at (0,-5) size 9x24
                 text run at (0,-5) width 9: "\x{2225}"

Modified: trunk/Source/WebCore/ChangeLog (203288 => 203289)


--- trunk/Source/WebCore/ChangeLog	2016-07-15 18:39:27 UTC (rev 203288)
+++ trunk/Source/WebCore/ChangeLog	2016-07-15 18:47:16 UTC (rev 203289)
@@ -1,3 +1,33 @@
+2016-07-15  Frederic Wang  <[email protected]>
+
+        MathOperator: Improve alignment for vertical size variant
+        https://bugs.webkit.org/show_bug.cgi?id=158866
+
+        Reviewed by Brent Fulgham.
+
+        The MathOperator class may stretch operators with either a large glyph or a glyph assembly.
+        In the latter case, the assembly is adjusted to match the stretch ascent and descent
+        requested by the callers. But in the former case the glyph ascent and descent are used
+        instead. We solve this by making MathOperator::stretchTo only take a targetSize and let
+        callers do the vertical alignment they want. This improves the rendering of fences with some
+        math fonts (e.g. XITS) and allows to pass the two cases of mo-axis-height-1.html.
+
+        Test: imported/mathml-in-html5/mathml/presentation-markup/operators/mo-axis-height-1.html
+
+        * rendering/mathml/MathOperator.cpp:
+        (WebCore::MathOperator::stretchTo): Merge vertical and horizontal stretching into the same
+        function with only the targetSize as a parameter.
+        * rendering/mathml/RenderMathMLOperator.cpp:
+        (WebCore::RenderMathMLOperator::stretchTo): Updated to use the new signature.
+        (WebCore::RenderMathMLOperator::verticalStretchedOperatorShift): Helper function to calculate
+        the shift necessary to align the baseline of the MathOperator instance with the one of the
+        RenderMathMLOperator.
+        (WebCore::RenderMathMLOperator::firstLineBaseline): Adjust the baseline.
+        * rendering/mathml/RenderMathMLOperator.h: Declare verticalStretchedOperatorShift.
+        * rendering/mathml/RenderMathMLRoot.cpp:
+        (WebCore::RenderMathMLRoot::layoutBlock): Use the new signature. This function aligns the top
+        of the radical with the overbar so we do not need to adjust baseline alignment here.
+
 2016-07-15  Brady Eidson  <[email protected]>
 
         WebKit should prevent push/replace state with username in URL.

Modified: trunk/Source/WebCore/rendering/mathml/MathOperator.cpp (203288 => 203289)


--- trunk/Source/WebCore/rendering/mathml/MathOperator.cpp	2016-07-15 18:39:27 UTC (rev 203288)
+++ trunk/Source/WebCore/rendering/mathml/MathOperator.cpp	2016-07-15 18:47:16 UTC (rev 203289)
@@ -394,24 +394,19 @@
     setGlyphAssembly(assemblyData);
 }
 
-void MathOperator::stretchTo(const RenderStyle& style, LayoutUnit ascent, LayoutUnit descent)
+void MathOperator::stretchTo(const RenderStyle& style, LayoutUnit targetSize)
 {
-    ASSERT(m_operatorType == Type::VerticalOperator);
-    calculateStretchyData(style, false, ascent + descent);
+    ASSERT(m_operatorType == Type::VerticalOperator || m_operatorType == Type::HorizontalOperator);
+    calculateStretchyData(style, false, targetSize);
     if (m_stretchType == StretchType::GlyphAssembly) {
-        m_ascent = ascent;
-        m_descent = descent;
+        if (m_operatorType == Type::VerticalOperator) {
+            m_ascent = targetSize;
+            m_descent = 0;
+        } else
+            m_width = targetSize;
     }
 }
 
-void MathOperator::stretchTo(const RenderStyle& style, LayoutUnit width)
-{
-    ASSERT(m_operatorType == Type::HorizontalOperator);
-    calculateStretchyData(style, false, width);
-    if (m_stretchType == StretchType::GlyphAssembly)
-        m_width = width;
-}
-
 LayoutRect MathOperator::paintGlyph(const RenderStyle& style, PaintInfo& info, const GlyphData& data, const LayoutPoint& origin, GlyphPaintTrimming trim)
 {
     FloatRect glyphBounds = boundsForGlyph(data);

Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp (203288 => 203289)


--- trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp	2016-07-15 18:39:27 UTC (rev 203288)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp	2016-07-15 18:47:16 UTC (rev 203289)
@@ -203,7 +203,7 @@
     m_stretchHeightAboveBaseline *= aspect;
     m_stretchDepthBelowBaseline *= aspect;
 
-    m_mathOperator.stretchTo(style(), m_stretchHeightAboveBaseline, m_stretchDepthBelowBaseline);
+    m_mathOperator.stretchTo(style(), m_stretchHeightAboveBaseline + m_stretchDepthBelowBaseline);
 
     setLogicalHeight(m_mathOperator.ascent() + m_mathOperator.descent());
 }
@@ -361,10 +361,18 @@
     updateOperatorProperties();
 }
 
+LayoutUnit RenderMathMLOperator::verticalStretchedOperatorShift() const
+{
+    if (!m_isVertical || !stretchSize())
+        return 0;
+
+    return (m_stretchDepthBelowBaseline - m_stretchHeightAboveBaseline - m_mathOperator.descent() + m_mathOperator.ascent()) / 2;
+}
+
 Optional<int> RenderMathMLOperator::firstLineBaseline() const
 {
     if (useMathOperator())
-        return Optional<int>(std::lround(static_cast<float>(m_mathOperator.ascent())));
+        return Optional<int>(std::lround(static_cast<float>(m_mathOperator.ascent() - verticalStretchedOperatorShift())));
     return RenderMathMLToken::firstLineBaseline();
 }
 

Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h (203288 => 203289)


--- trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h	2016-07-15 18:39:27 UTC (rev 203288)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h	2016-07-15 18:47:16 UTC (rev 203289)
@@ -83,6 +83,8 @@
     void setOperatorFlagFromAttributeValue(MathMLOperatorDictionary::Flag, const AtomicString& attributeValue);
     void setOperatorPropertiesFromOpDictEntry(const MathMLOperatorDictionary::Entry*);
 
+    LayoutUnit verticalStretchedOperatorShift() const;
+
     LayoutUnit m_stretchHeightAboveBaseline;
     LayoutUnit m_stretchDepthBelowBaseline;
     LayoutUnit m_stretchWidth;

Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp (203288 => 203289)


--- trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp	2016-07-15 18:39:27 UTC (rev 203288)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp	2016-07-15 18:47:16 UTC (rev 203289)
@@ -203,7 +203,7 @@
 
     // Stretch the radical operator to cover the base height.
     // We can then determine the metrics of the radical operator + the base.
-    m_radicalOperator.stretchTo(style(), baseAscent, baseDescent);
+    m_radicalOperator.stretchTo(style(), baseAscent + baseDescent);
     LayoutUnit radicalOperatorHeight = m_radicalOperator.ascent() + m_radicalOperator.descent();
     LayoutUnit indexBottomRaise = m_degreeBottomRaisePercent * radicalOperatorHeight;
     LayoutUnit radicalAscent = baseAscent + m_verticalGap + m_ruleThickness + m_extraAscender;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to