Title: [111714] trunk
Revision
111714
Author
[email protected]
Date
2012-03-22 09:52:55 -0700 (Thu, 22 Mar 2012)

Log Message

Incorrect beforeChild parent calculation in RenderRubyBase::moveChildren.
https://bugs.webkit.org/show_bug.cgi?id=80297

Reviewed by Julien Chaffraix.

Source/WebCore:

beforeChild might share the same anonymous block parent with other previous
siblings. Before moving the children across ruby bases, we need to make sure
to split the tree across the beforeChild correctly.

Test: fast/ruby/ruby-text-before-child-split.html

* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::moveChildren):

LayoutTests:

Test passes if you see the inline continuation in the first ruby base and only the
simple text in the second ruby base.

* fast/ruby/ruby-text-before-child-split-expected.png: Added.
* fast/ruby/ruby-text-before-child-split-expected.txt: Added.
* fast/ruby/ruby-text-before-child-split.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (111713 => 111714)


--- trunk/LayoutTests/ChangeLog	2012-03-22 16:38:27 UTC (rev 111713)
+++ trunk/LayoutTests/ChangeLog	2012-03-22 16:52:55 UTC (rev 111714)
@@ -1,3 +1,17 @@
+2012-03-22  Abhishek Arya  <[email protected]>
+
+        Incorrect beforeChild parent calculation in RenderRubyBase::moveChildren.
+        https://bugs.webkit.org/show_bug.cgi?id=80297
+
+        Reviewed by Julien Chaffraix.
+
+        Test passes if you see the inline continuation in the first ruby base and only the
+        simple text in the second ruby base.
+
+        * fast/ruby/ruby-text-before-child-split-expected.png: Added.
+        * fast/ruby/ruby-text-before-child-split-expected.txt: Added.
+        * fast/ruby/ruby-text-before-child-split.html: Added.
+
 2012-03-22  Raphael Kubo da Costa  <[email protected]>
 
         [EFL] Gardening, update a few more fast/forms baselines.

Added: trunk/LayoutTests/fast/ruby/ruby-text-before-child-split-expected.png (0 => 111714)


--- trunk/LayoutTests/fast/ruby/ruby-text-before-child-split-expected.png	                        (rev 0)
+++ trunk/LayoutTests/fast/ruby/ruby-text-before-child-split-expected.png	2012-03-22 16:52:55 UTC (rev 111714)
@@ -0,0 +1,5 @@
+\x89PNG
+
+
+IHDR X\x9Av\x82p)tEXtchecksum853de00567d121bea0b7bece66a5d61c`7\xFF\xFBkIDATx\x9C\xED\xD71 \xC00\xC0\xBF\xE7\xE1\xA2$
+\xFAv\xCF\xCC,\x80\xC0y\xFCÀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd\x901 @ƀd.\xE9W\xACfF\xB15IEND\xAEB`\x82
\ No newline at end of file

Added: trunk/LayoutTests/fast/ruby/ruby-text-before-child-split-expected.txt (0 => 111714)


--- trunk/LayoutTests/fast/ruby/ruby-text-before-child-split-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/ruby/ruby-text-before-child-split-expected.txt	2012-03-22 16:52:55 UTC (rev 111714)
@@ -0,0 +1,24 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x26
+  RenderBlock {HTML} at (0,0) size 800x26 [color=#FFFFFF]
+    RenderBody {BODY} at (8,8) size 784x10
+      RenderRuby (inline) {RUBY} at (0,0) size 20x10
+        RenderRubyRun (anonymous) at (0,0) size 10x10
+          RenderRubyText {RT} at (0,0) size 10x0
+          RenderRubyBase (anonymous) at (0,0) size 10x10
+            RenderBlock (anonymous) at (0,0) size 10x10
+              RenderText {#text} at (0,0) size 10x10
+                text run at (0,0) width 10: "A"
+              RenderInline {I} at (0,0) size 0x10
+            RenderBlock (anonymous) at (0,10) size 10x0
+              RenderBlock {DIV} at (0,0) size 10x0
+            RenderBlock (anonymous) at (0,10) size 10x0
+              RenderInline {I} at (0,0) size 0x0
+        RenderRubyRun (anonymous) at (10,0) size 10x10
+          RenderRubyBase (anonymous) at (0,0) size 10x10
+            RenderBlock (anonymous) at (0,0) size 10x10
+              RenderText {#text} at (0,0) size 10x10
+                text run at (0,0) width 10: "B"
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0

Added: trunk/LayoutTests/fast/ruby/ruby-text-before-child-split.html (0 => 111714)


--- trunk/LayoutTests/fast/ruby/ruby-text-before-child-split.html	                        (rev 0)
+++ trunk/LayoutTests/fast/ruby/ruby-text-before-child-split.html	2012-03-22 16:52:55 UTC (rev 111714)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html style="font-family: ahem; font-size: 10px; -webkit-font-smoothing: none; color: white;">
+<body>
+<ruby id="ruby1">
+A<i><div></div></i>B
+</ruby>
+<script>
+    document.body.offsetTop;
+    ruby1 = document.getElementById('ruby1');
+    ruby1.insertBefore(document.createElement('rt'), ruby1.lastChild);
+</script>
+</body>
+</html>
+
Property changes on: trunk/LayoutTests/fast/ruby/ruby-text-before-child-split.html
___________________________________________________________________

Added: svn:executable

Modified: trunk/Source/WebCore/ChangeLog (111713 => 111714)


--- trunk/Source/WebCore/ChangeLog	2012-03-22 16:38:27 UTC (rev 111713)
+++ trunk/Source/WebCore/ChangeLog	2012-03-22 16:52:55 UTC (rev 111714)
@@ -1,3 +1,19 @@
+2012-03-22  Abhishek Arya  <[email protected]>
+
+        Incorrect beforeChild parent calculation in RenderRubyBase::moveChildren.
+        https://bugs.webkit.org/show_bug.cgi?id=80297
+
+        Reviewed by Julien Chaffraix.
+
+        beforeChild might share the same anonymous block parent with other previous
+        siblings. Before moving the children across ruby bases, we need to make sure
+        to split the tree across the beforeChild correctly.
+
+        Test: fast/ruby/ruby-text-before-child-split.html
+
+        * rendering/RenderRubyBase.cpp:
+        (WebCore::RenderRubyBase::moveChildren):
+
 2012-03-22  Kristóf Kosztyó  <[email protected]>
 
         [Qt] Fix Qt minimal build after r111692

Modified: trunk/Source/WebCore/rendering/RenderRubyBase.cpp (111713 => 111714)


--- trunk/Source/WebCore/rendering/RenderRubyBase.cpp	2012-03-22 16:38:27 UTC (rev 111713)
+++ trunk/Source/WebCore/rendering/RenderRubyBase.cpp	2012-03-22 16:52:55 UTC (rev 111714)
@@ -58,14 +58,10 @@
     // This function removes all children that are before (!) beforeChild
     // and appends them to toBase.
     ASSERT_ARG(toBase, toBase);
-    
-    // First make sure that beforeChild (if set) is indeed a direct child of this.
-    // Inline children might be wrapped in an anonymous block if there's a continuation.
-    // Theoretically, in ruby bases, this can happen with only the first such a child,
-    // so it should be OK to just climb the tree.
-    while (beforeChild && beforeChild->parent() != this)
-        beforeChild = beforeChild->parent();
 
+    if (beforeChild && beforeChild->parent() != this)
+        beforeChild = splitAnonymousBlocksAroundChild(beforeChild);
+
     if (childrenInline())
         moveInlineChildren(toBase, beforeChild);
     else
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to