Title: [163626] trunk
Revision
163626
Author
[email protected]
Date
2014-02-07 10:20:01 -0800 (Fri, 07 Feb 2014)

Log Message

childShouldCreateRenderer should return false for the mspace element
https://bugs.webkit.org/show_bug.cgi?id=128325

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

Source/WebCore:

The mspace element can not have children so this makes its
childShouldCreateRenderer always return false.

Test: mathml/presentation/mspace-children.html

* mathml/MathMLTextElement.cpp:
(WebCore::MathMLTextElement::childShouldCreateRenderer):

LayoutTests:

Add tests to ensure that the mspace element does not have renderer
children.

* mathml/presentation/mspace-children-expected.png: Added.
* mathml/presentation/mspace-children-expected.txt: Added.
* mathml/presentation/mspace-children.html: Added.
* platform/mathml/presentation/mspace-children-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (163625 => 163626)


--- trunk/LayoutTests/ChangeLog	2014-02-07 17:45:49 UTC (rev 163625)
+++ trunk/LayoutTests/ChangeLog	2014-02-07 18:20:01 UTC (rev 163626)
@@ -1,3 +1,18 @@
+2014-02-07  Frédéric Wang  <[email protected]>
+
+        childShouldCreateRenderer should return false for the mspace element
+        https://bugs.webkit.org/show_bug.cgi?id=128325
+
+        Reviewed by Chris Fleizach.
+
+        Add tests to ensure that the mspace element does not have renderer
+        children.
+
+        * mathml/presentation/mspace-children-expected.png: Added.
+        * mathml/presentation/mspace-children-expected.txt: Added.
+        * mathml/presentation/mspace-children.html: Added.
+        * platform/mathml/presentation/mspace-children-expected.txt: Added.
+
 2014-02-07  Javier Fernandez  <[email protected]>
 
         [CSS Grid Layout] Rename grid-definition-{columns|rows} to match the new syntax

Added: trunk/LayoutTests/mathml/presentation/mspace-children-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/mathml/presentation/mspace-children-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/mathml/presentation/mspace-children-expected.txt (0 => 163626)


--- trunk/LayoutTests/mathml/presentation/mspace-children-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mspace-children-expected.txt	2014-02-07 18:20:01 UTC (rev 163626)
@@ -0,0 +1,12 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x371
+  RenderBlock {HTML} at (0,0) size 800x371
+    RenderBody {BODY} at (8,16) size 784x347
+      RenderBlock {P} at (0,0) size 784x17
+        RenderText {#text} at (0,0) size 378x17
+          text run at (0,0) width 378: "This test passes if <mspace> does not create child renderers."
+      RenderBlock (anonymous) at (0,33) size 784x314
+        RenderMathMLMath {math} at (0,14) size 102x300 [padding: 0 1 0 1]
+          RenderMathMLSpace {mspace} at (1,0) size 100x300
+        RenderText {#text} at (0,0) size 0x0

Added: trunk/LayoutTests/mathml/presentation/mspace-children.html (0 => 163626)


--- trunk/LayoutTests/mathml/presentation/mspace-children.html	                        (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mspace-children.html	2014-02-07 18:20:01 UTC (rev 163626)
@@ -0,0 +1,14 @@
+<!doctype html>
+<html>
+  <head>
+    <title>mspace children</title>
+    <meta charset="utf-8"/>
+  </head>
+  <body>
+
+    <p>This test passes if &lt;mspace&gt; does not create child renderers.</p> 
+
+    <math><mspace width="100px" height="200" depth="300px">Text Node <mtext>x</mtext></mspace></math>
+
+  </body>
+</html>

Added: trunk/LayoutTests/platform/mac/mathml/presentation/mspace-children-expected.txt (0 => 163626)


--- trunk/LayoutTests/platform/mac/mathml/presentation/mspace-children-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/mathml/presentation/mspace-children-expected.txt	2014-02-07 18:20:01 UTC (rev 163626)
@@ -0,0 +1,12 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x372
+  RenderBlock {HTML} at (0,0) size 800x372
+    RenderBody {BODY} at (8,16) size 784x348
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 378x18
+          text run at (0,0) width 378: "This test passes if <mspace> does not create child renderers."
+      RenderBlock (anonymous) at (0,34) size 784x314
+        RenderMathMLMath {math} at (0,14) size 102x300 [padding: 0 1 0 1]
+          RenderMathMLSpace {mspace} at (1,0) size 100x300
+        RenderText {#text} at (0,0) size 0x0

Modified: trunk/Source/WebCore/ChangeLog (163625 => 163626)


--- trunk/Source/WebCore/ChangeLog	2014-02-07 17:45:49 UTC (rev 163625)
+++ trunk/Source/WebCore/ChangeLog	2014-02-07 18:20:01 UTC (rev 163626)
@@ -1,3 +1,18 @@
+2014-02-07  Frédéric Wang  <[email protected]>
+
+        childShouldCreateRenderer should return false for the mspace element
+        https://bugs.webkit.org/show_bug.cgi?id=128325
+
+        Reviewed by Chris Fleizach.
+
+        The mspace element can not have children so this makes its
+        childShouldCreateRenderer always return false.
+
+        Test: mathml/presentation/mspace-children.html
+
+        * mathml/MathMLTextElement.cpp:
+        (WebCore::MathMLTextElement::childShouldCreateRenderer):
+
 2014-02-07  Javier Fernandez  <[email protected]>
 
         [CSS Grid Layout] Rename grid-definition-{columns|rows} to match the new syntax

Modified: trunk/Source/WebCore/mathml/MathMLTextElement.cpp (163625 => 163626)


--- trunk/Source/WebCore/mathml/MathMLTextElement.cpp	2014-02-07 17:45:49 UTC (rev 163625)
+++ trunk/Source/WebCore/mathml/MathMLTextElement.cpp	2014-02-07 18:20:01 UTC (rev 163626)
@@ -86,7 +86,7 @@
 
 bool MathMLTextElement::childShouldCreateRenderer(const Node& child) const
 {
-    return child.isTextNode();
+    return !hasLocalName(mspaceTag) && child.isTextNode();
 }
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to