Title: [153088] trunk
Revision
153088
Author
[email protected]
Date
2013-07-24 10:12:15 -0700 (Wed, 24 Jul 2013)

Log Message

Graphical elements inside mphantom should not be visible.
https://bugs.webkit.org/show_bug.cgi?id=116600.

Patch by Frédéric Wang <[email protected]> on 2013-07-24
Reviewed by Chris Fleizach.

Source/WebCore:

Test: mathml/presentation/phantom.html

* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::paint): don't paint the fraction bar when the visibility is not "visible"
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::paint): don't paint the radical symbol when the visibility is not "visible"

LayoutTests:

* mathml/presentation/phantom-expected.html: Added.
* mathml/presentation/phantom.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (153087 => 153088)


--- trunk/LayoutTests/ChangeLog	2013-07-24 16:07:42 UTC (rev 153087)
+++ trunk/LayoutTests/ChangeLog	2013-07-24 17:12:15 UTC (rev 153088)
@@ -1,3 +1,13 @@
+2013-07-24  Frédéric Wang  <[email protected]>
+
+        Graphical elements inside mphantom should not be visible.
+        https://bugs.webkit.org/show_bug.cgi?id=116600.
+
+        Reviewed by Chris Fleizach.
+
+        * mathml/presentation/phantom-expected.html: Added.
+        * mathml/presentation/phantom.html: Added.
+
 2013-07-24  Simon Pena  <[email protected]>
 
         [GTK] Unreviewed gardening. Add expectations for flaky test.

Added: trunk/LayoutTests/mathml/presentation/phantom-expected.html (0 => 153088)


--- trunk/LayoutTests/mathml/presentation/phantom-expected.html	                        (rev 0)
+++ trunk/LayoutTests/mathml/presentation/phantom-expected.html	2013-07-24 17:12:15 UTC (rev 153088)
@@ -0,0 +1,31 @@
+<!doctype html>
+<html>
+  <head>
+    <title>phantom</title>
+    <meta charset="utf-8"/>
+  </head>
+  <body style="background: white;">
+
+    <math>
+      <mfrac>
+        <mtext>mphantom</mtext>
+        <mrow>
+          <mo>[</mo>
+          <mphantom style="color: white;">
+            <mo>(</mo>
+            <mn>2</mn>
+            <mo>+</mo>
+            <msqrt>
+              <mfrac>
+                <mi>x</mi>
+                <mi>y</mi>
+              </mfrac>
+            </msqrt>
+          </mphantom>
+          <mo>]</mo>
+        </mrow>
+      </mfrac>
+    </math>
+
+</body>
+</html>

Added: trunk/LayoutTests/mathml/presentation/phantom.html (0 => 153088)


--- trunk/LayoutTests/mathml/presentation/phantom.html	                        (rev 0)
+++ trunk/LayoutTests/mathml/presentation/phantom.html	2013-07-24 17:12:15 UTC (rev 153088)
@@ -0,0 +1,33 @@
+<!doctype html>
+<html>
+  <head>
+    <title>phantom</title>
+    <meta charset="utf-8"/>
+  </head>
+  <body style="background: white;">
+
+    <!-- The <mphantom> element should be invisible but should have the size
+         of its content. -->
+    <math>
+      <mfrac>
+        <mtext>mphantom</mtext>
+        <mrow>
+          <mo>[</mo>
+          <mphantom>
+            <mo>(</mo>
+            <mn>2</mn>
+            <mo>+</mo>
+            <msqrt>
+              <mfrac>
+                <mi>x</mi>
+                <mi>y</mi>
+              </mfrac>
+            </msqrt>
+          </mphantom>
+          <mo>]</mo>
+        </mrow>
+      </mfrac>
+    </math>
+
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (153087 => 153088)


--- trunk/Source/WebCore/ChangeLog	2013-07-24 16:07:42 UTC (rev 153087)
+++ trunk/Source/WebCore/ChangeLog	2013-07-24 17:12:15 UTC (rev 153088)
@@ -1,3 +1,17 @@
+2013-07-24  Frédéric Wang  <[email protected]>
+
+        Graphical elements inside mphantom should not be visible.
+        https://bugs.webkit.org/show_bug.cgi?id=116600.
+
+        Reviewed by Chris Fleizach.
+
+        Test: mathml/presentation/phantom.html
+
+        * rendering/mathml/RenderMathMLFraction.cpp:
+        (WebCore::RenderMathMLFraction::paint): don't paint the fraction bar when the visibility is not "visible"
+        * rendering/mathml/RenderMathMLRoot.cpp:
+        (WebCore::RenderMathMLRoot::paint): don't paint the radical symbol when the visibility is not "visible"
+
 2013-07-24  Brendan Long  <[email protected]>
 
         WebVTTParser's identifier buffering can ignore subsequent lines

Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp (153087 => 153088)


--- trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp	2013-07-24 16:07:42 UTC (rev 153087)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp	2013-07-24 17:12:15 UTC (rev 153088)
@@ -143,7 +143,7 @@
 void RenderMathMLFraction::paint(PaintInfo& info, const LayoutPoint& paintOffset)
 {
     RenderMathMLBlock::paint(info, paintOffset);
-    if (info.context->paintingDisabled() || info.phase != PaintPhaseForeground)
+    if (info.context->paintingDisabled() || info.phase != PaintPhaseForeground || style()->visibility() != VISIBLE)
         return;
     
     RenderBox* denominatorWrapper = lastChildBox();

Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp (153087 => 153088)


--- trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp	2013-07-24 16:07:42 UTC (rev 153087)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp	2013-07-24 17:12:15 UTC (rev 153088)
@@ -251,7 +251,7 @@
 {
     RenderMathMLBlock::paint(info, paintOffset);
     
-    if (info.context->paintingDisabled())
+    if (info.context->paintingDisabled() || style()->visibility() != VISIBLE)
         return;
     
     IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location() + contentBoxRect().location());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to