Title: [122024] releases/WebKitGTK/webkit-1.8
Revision
122024
Author
[email protected]
Date
2012-07-06 13:19:59 -0700 (Fri, 06 Jul 2012)

Log Message

Merge 109140 - Incorrect before child parent calculation when adding new children
to anonymous column blocks.
https://bugs.webkit.org/show_bug.cgi?id=79755

Patch by Abhishek Arya <[email protected]> on 2012-02-28
Reviewed by David Hyatt.

Source/WebCore:

before child can be wrapped in anonymous containers, so need to
take care of that in before child parent calculation.

Test: fast/multicol/span/before-child-anonymous-column-block.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addChildToAnonymousColumnBlocks):

LayoutTests:

Test passes if you don't see the div block inside table and you see
two blocks in different columns in the pixel test.

* fast/multicol/span/before-child-anonymous-column-block-expected.png: Added.
* fast/multicol/span/before-child-anonymous-column-block-expected.txt: Added.
* fast/multicol/span/before-child-anonymous-column-block.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-1.8/LayoutTests/ChangeLog (122023 => 122024)


--- releases/WebKitGTK/webkit-1.8/LayoutTests/ChangeLog	2012-07-06 20:19:51 UTC (rev 122023)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/ChangeLog	2012-07-06 20:19:59 UTC (rev 122024)
@@ -1,3 +1,18 @@
+2012-02-28  Abhishek Arya  <[email protected]>
+
+        Incorrect before child parent calculation when adding new children
+        to anonymous column blocks.
+        https://bugs.webkit.org/show_bug.cgi?id=79755
+
+        Reviewed by David Hyatt.
+
+        Test passes if you don't see the div block inside table and you see
+        two blocks in different columns in the pixel test.
+ 
+        * fast/multicol/span/before-child-anonymous-column-block-expected.png: Added.
+        * fast/multicol/span/before-child-anonymous-column-block-expected.txt: Added.
+        * fast/multicol/span/before-child-anonymous-column-block.html: Added.
+
 2012-02-21  Adam Klein  <[email protected]>
 
         ContainerNode::childrenChanged must be called immediately after removing children

Added: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/before-child-anonymous-column-block-expected.png


(Binary files differ)
Property changes on: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/before-child-anonymous-column-block-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/before-child-anonymous-column-block-expected.txt (0 => 122024)


--- releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/before-child-anonymous-column-block-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/before-child-anonymous-column-block-expected.txt	2012-07-06 20:19:59 UTC (rev 122024)
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x52
+  RenderBlock {HTML} at (0,0) size 800x52
+    RenderBody {BODY} at (16,16) size 768x20
+layer at (16,16) size 768x20
+  RenderBlock {DIV} at (0,0) size 768x20
+    RenderBlock (anonymous multi-column span) at (0,0) size 768x0
+      RenderBlock {DIV} at (0,0) size 768x0
+layer at (16,16) size 768x20
+  RenderBlock (anonymous multi-column) at (0,0) size 768x20
+    RenderBlock {DIV} at (0,0) size 374x20
+      RenderText {#text} at (0,0) size 20x20
+        text run at (0,0) width 20: "3"
+    RenderTable at (0,20) size 20x20
+      RenderTableSection {DIV} at (0,0) size 20x20
+        RenderTableRow (anonymous) at (0,0) size 20x20
+          RenderTableCell (anonymous) at (0,0) size 20x20 [r=0 c=0 rs=1 cs=1]
+            RenderText {#text} at (0,0) size 20x20
+              text run at (0,0) width 20: "4"
Property changes on: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/before-child-anonymous-column-block-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/before-child-anonymous-column-block.html (0 => 122024)


--- releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/before-child-anonymous-column-block.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/before-child-anonymous-column-block.html	2012-07-06 20:19:59 UTC (rev 122024)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html style="font-family: ahem; font-size: 10px; -webkit-font-smoothing: none;">
+<body>
+<style>
+#test1 { -webkit-column-count: 2; }
+#test2 { -webkit-column-span: all; }
+#test3 { content: counter(c); }
+</style>
+<script>
+_onload_ = function() {
+test1 = document.createElement('div');
+test1.setAttribute('id', 'test1');
+document.body.appendChild(test1);
+test2 = document.createElement('div');
+test2.setAttribute('id', 'test2');
+test1.appendChild(test2);
+test3 = document.createElement('div');
+test3.setAttribute('id', 'test3');
+test1.appendChild(test3);
+test4 = document.createElement('div');
+test1.appendChild(test4);
+test4.style.display = 'table-row-group';
+test3.appendChild(document.createTextNode('3'));
+test4.appendChild(document.createTextNode('4'));
+document.body.offsetTop;
+document.body.style.zoom = 2;
+}
+</script>
+</body>
+</html>
Property changes on: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/before-child-anonymous-column-block.html
___________________________________________________________________

Added: svn:executable

Added: svn:eol-style

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog (122023 => 122024)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog	2012-07-06 20:19:51 UTC (rev 122023)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog	2012-07-06 20:19:59 UTC (rev 122024)
@@ -1,3 +1,19 @@
+2012-02-28  Abhishek Arya  <[email protected]>
+
+        Incorrect before child parent calculation when adding new children
+        to anonymous column blocks.
+        https://bugs.webkit.org/show_bug.cgi?id=79755
+
+        Reviewed by David Hyatt.
+
+        before child can be wrapped in anonymous containers, so need to
+        take care of that in before child parent calculation.
+
+        Test: fast/multicol/span/before-child-anonymous-column-block.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::addChildToAnonymousColumnBlocks):
+
 2012-02-21  Adam Klein  <[email protected]>
 
         ContainerNode::childrenChanged must be called immediately after removing children

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBlock.cpp (122023 => 122024)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBlock.cpp	2012-07-06 20:19:51 UTC (rev 122023)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBlock.cpp	2012-07-06 20:19:59 UTC (rev 122024)
@@ -379,8 +379,17 @@
     ASSERT(!continuation()); // We don't yet support column spans that aren't immediate children of the multi-column block.
         
     // The goal is to locate a suitable box in which to place our child.
-    RenderBlock* beforeChildParent = toRenderBlock(beforeChild && beforeChild->parent()->isRenderBlock() ? beforeChild->parent() : lastChild());
-    
+    RenderBlock* beforeChildParent = 0;
+    if (beforeChild) {
+        RenderObject* curr = beforeChild;
+        while (curr && curr->parent() != this)
+            curr = curr->parent();
+        beforeChildParent = toRenderBlock(curr);
+        ASSERT(beforeChildParent);
+        ASSERT(beforeChildParent->isAnonymousColumnsBlock() || beforeChildParent->isAnonymousColumnSpanBlock());
+    } else
+        beforeChildParent = toRenderBlock(lastChild());
+
     // If the new child is floating or positioned it can just go in that block.
     if (newChild->isFloatingOrPositioned()) {
         beforeChildParent->addChildIgnoringAnonymousColumnBlocks(newChild, beforeChild);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to