Title: [193829] trunk
Revision
193829
Author
fred.w...@free.fr
Date
2015-12-09 06:46:11 -0800 (Wed, 09 Dec 2015)

Log Message

Bad position of large operators inside an munderover element
https://bugs.webkit.org/show_bug.cgi?id=151916

Reviewed by Alejandro G. Castro.

Source/WebCore:

Test: mathml/opentype/large-operators-munderover.html

* rendering/mathml/RenderMathMLOperator.h:
(WebCore::RenderMathMLOperator::isVertical): Expose the direction of the operator.
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::layout): Remove call to horizontal stretching for vertical operators.

LayoutTests:

* mathml/opentype/large-operators-munderover-expected.txt: Added.
* mathml/opentype/large-operators-munderover.html: Added.

Add a test to verify the position and size of a large operator used as an munderover base.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (193828 => 193829)


--- trunk/LayoutTests/ChangeLog	2015-12-09 14:03:34 UTC (rev 193828)
+++ trunk/LayoutTests/ChangeLog	2015-12-09 14:46:11 UTC (rev 193829)
@@ -1,3 +1,15 @@
+2015-12-09  Frederic Wang  <fred.w...@free.fr>
+
+        Bad position of large operators inside an munderover element
+        https://bugs.webkit.org/show_bug.cgi?id=151916
+
+        Reviewed by Alejandro G. Castro.
+
+        * mathml/opentype/large-operators-munderover-expected.txt: Added.
+        * mathml/opentype/large-operators-munderover.html: Added.
+
+        Add a test to verify the position and size of a large operator used as an munderover base.
+
 2015-12-09  Joanmarie Diggs  <jdi...@igalia.com>
 
         [AX][GTK] Accessibility gardening

Added: trunk/LayoutTests/mathml/opentype/large-operators-munderover-expected.txt (0 => 193829)


--- trunk/LayoutTests/mathml/opentype/large-operators-munderover-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/mathml/opentype/large-operators-munderover-expected.txt	2015-12-09 14:46:11 UTC (rev 193829)
@@ -0,0 +1,7 @@
+This test passes if you see a large black square with a green bar overscript and a red bar underscript.
+
+largeop width: PASS
+largeop height: PASS
+green bar is above: PASS
+red bar is below: PASS
+
Property changes on: trunk/LayoutTests/mathml/opentype/large-operators-munderover-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/mathml/opentype/large-operators-munderover.html (0 => 193829)


--- trunk/LayoutTests/mathml/opentype/large-operators-munderover.html	                        (rev 0)
+++ trunk/LayoutTests/mathml/opentype/large-operators-munderover.html	2015-12-09 14:46:11 UTC (rev 193829)
@@ -0,0 +1,54 @@
+<!doctype html>
+<html>
+  <head>
+    <title>Large Operator Munderover</title>
+    <meta charset="utf-8"/>
+    <style type="text/css">
+      /* This font is taken from Mozilla's test suite. */
+      @font-face {
+      font-family: stretchy;
+        src: url("stretchy.woff");
+      }
+      math {
+        font-family: stretchy;
+      }
+    </style>
+    <script>
+      var result;
+      var epsilon = 1;
+      function almostEqual(x, y) {
+        return Math.abs(x - y) < epsilon;
+      }
+      function assert(text, condition) {
+        result += text + ": " + (condition ? "PASS" : "FAIL") + "\n";
+      }
+      function test() {
+        result = "";
+        // font em is 1024, size of glyph L8 is 8389 and font-size is 16px
+        var largeop = document.getElementById("largeop").getBoundingClientRect();
+        var green = document.getElementById("green").getBoundingClientRect();
+        var red = document.getElementById("red").getBoundingClientRect();
+        var size = (8389/1024)*16;
+
+        assert("largeop width", almostEqual(largeop.width, size));
+        assert("largeop height", almostEqual(largeop.height, size));
+        assert("green bar is above", green.bottom <= largeop.top);
+        assert("red bar is below", red.top >= largeop.bottom);
+        document.getElementById("result").innerText = result;
+        if (window.testRunner)
+          testRunner.dumpAsText();
+      }
+    </script>
+  </head>
+  <body _onload_="test()">
+    <p>This test passes if you see a large black square with a green bar overscript and a red bar underscript.</p>
+    <math display="block">
+      <munderover>
+        <mo id="largeop" lspace="0px" rspace="0px" style="font-size: 16px;" >&#x2A1C;</mo>
+        <mspace id="red" width="200px" height="10px" depth="10px" mathbackground="red"/>
+        <mspace id="green" width="250px" height="10px" depth="10px" mathbackground="green"/>
+      </munderover>
+    </math>
+    <div id="result"></div>
+  </body>
+</html>
Property changes on: trunk/LayoutTests/mathml/opentype/large-operators-munderover.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (193828 => 193829)


--- trunk/Source/WebCore/ChangeLog	2015-12-09 14:03:34 UTC (rev 193828)
+++ trunk/Source/WebCore/ChangeLog	2015-12-09 14:46:11 UTC (rev 193829)
@@ -1,3 +1,17 @@
+2015-12-09  Frederic Wang  <fred.w...@free.fr>
+
+        Bad position of large operators inside an munderover element
+        https://bugs.webkit.org/show_bug.cgi?id=151916
+
+        Reviewed by Alejandro G. Castro.
+
+        Test: mathml/opentype/large-operators-munderover.html
+
+        * rendering/mathml/RenderMathMLOperator.h:
+        (WebCore::RenderMathMLOperator::isVertical): Expose the direction of the operator.
+        * rendering/mathml/RenderMathMLUnderOver.cpp:
+        (WebCore::RenderMathMLUnderOver::layout): Remove call to horizontal stretching for vertical operators.
+
 2015-12-09  Zan Dobersek  <zdober...@igalia.com>
 
         [TexMap] TextureMapperTiledBackingStore should notify the ImageObserver of the data access

Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h (193828 => 193829)


--- trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h	2015-12-09 14:03:34 UTC (rev 193828)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h	2015-12-09 14:46:11 UTC (rev 193829)
@@ -71,6 +71,7 @@
     bool hasOperatorFlag(MathMLOperatorDictionary::Flag flag) const { return m_operatorFlags & flag; }
     // FIXME: The displaystyle property is not implemented (https://bugs.webkit.org/show_bug.cgi?id=118737).
     bool isLargeOperatorInDisplayStyle() const { return !hasOperatorFlag(MathMLOperatorDictionary::Stretchy) && hasOperatorFlag(MathMLOperatorDictionary::LargeOp); }
+    bool isVertical() const { return m_isVertical; }
 
     virtual void updateStyle() override final;
 

Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp (193828 => 193829)


--- trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp	2015-12-09 14:03:34 UTC (rev 193828)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp	2015-12-09 14:46:11 UTC (rev 193829)
@@ -80,8 +80,10 @@
         if (child->needsLayout()) {
             if (is<RenderMathMLBlock>(child)) {
                 if (auto renderOperator = downcast<RenderMathMLBlock>(*child).unembellishedOperator()) {
-                    renderOperator->resetStretchSize();
-                    renderOperators.append(renderOperator);
+                    if (!renderOperator->isVertical()) {
+                        renderOperator->resetStretchSize();
+                        renderOperators.append(renderOperator);
+                    }
                 }
             }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to