Title: [122025] releases/WebKitGTK/webkit-1.8
Revision
122025
Author
mrobin...@webkit.org
Date
2012-07-06 13:20:08 -0700 (Fri, 06 Jul 2012)

Log Message

Merge 108543 - Cloning and linebox issues in multi-column layout.
https://bugs.webkit.org/show_bug.cgi?id=78273

Patch by Abhishek Arya <infe...@chromium.org> on 2012-02-22
Reviewed by Eric Seidel.

Source/WebCore:

Tests: fast/multicol/span/clone-flexbox.html
       fast/multicol/span/clone-summary.html
       fast/multicol/span/textbox-not-removed-crash.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::clone): Fix cloning algorithm to take
care of cloning descendant classes of RenderBlock.
(WebCore::RenderBlock::splitBlocks): When we move our inline children
to cloneBlock, we need to clear our entire line box tree. Any descendant
child in the hierarchy could be a part of our line box tree and will
never get cleared since the child has moved to new parent cloneBlock.

LayoutTests:

* fast/multicol/span/clone-flexbox-expected.png:
* fast/multicol/span/clone-flexbox-expected.txt: Added.
* fast/multicol/span/clone-flexbox.html: Added. Test passes if we
see two RenderFlexibox in the rendertree.
* fast/multicol/span/clone-summary-expected.png: Added.
* fast/multicol/span/clone-summary-expected.txt: Added.
* fast/multicol/span/clone-summary.html: Added. Test passes if we
see two RenderSummary in the rendertree.
* fast/multicol/span/textbox-not-removed-crash-expected.txt: Added.
* fast/multicol/span/textbox-not-removed-crash.html: Added. Test
passes it we do not crash on m_hasBadParent assert in InlineBox.

Modified Paths

Added Paths

Diff

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


--- releases/WebKitGTK/webkit-1.8/LayoutTests/ChangeLog	2012-07-06 20:19:59 UTC (rev 122024)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/ChangeLog	2012-07-06 20:20:08 UTC (rev 122025)
@@ -1,3 +1,22 @@
+2012-02-22  Abhishek Arya  <infe...@chromium.org>
+
+        Cloning and linebox issues in multi-column layout.
+        https://bugs.webkit.org/show_bug.cgi?id=78273
+
+        Reviewed by Eric Seidel.
+
+        * fast/multicol/span/clone-flexbox-expected.png:
+        * fast/multicol/span/clone-flexbox-expected.txt: Added.
+        * fast/multicol/span/clone-flexbox.html: Added. Test passes if we
+        see two RenderFlexibox in the rendertree.
+        * fast/multicol/span/clone-summary-expected.png: Added.
+        * fast/multicol/span/clone-summary-expected.txt: Added.
+        * fast/multicol/span/clone-summary.html: Added. Test passes if we
+        see two RenderSummary in the rendertree.
+        * fast/multicol/span/textbox-not-removed-crash-expected.txt: Added.
+        * fast/multicol/span/textbox-not-removed-crash.html: Added. Test
+        passes it we do not crash on m_hasBadParent assert in InlineBox.
+
 2012-02-28  Abhishek Arya  <infe...@chromium.org>
 
         Incorrect before child parent calculation when adding new children

Added: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-flexbox-expected.txt (0 => 122025)


--- releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-flexbox-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-flexbox-expected.txt	2012-07-06 20:20:08 UTC (rev 122025)
@@ -0,0 +1,21 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x48
+  RenderBlock {HTML} at (0,0) size 800x48
+    RenderBody {BODY} at (8,8) size 784x32
+layer at (8,8) size 784x32
+  RenderBlock {DIV} at (0,0) size 784x32
+    RenderBlock (anonymous multi-column span) at (0,16) size 784x0 [color=#FFFFFF]
+      RenderBlock {DIV} at (0,0) size 784x0
+layer at (8,8) size 784x16
+  RenderBlock (anonymous multi-column) at (0,0) size 784x16
+    RenderFlexibleBox {DIV} at (0,0) size 117x16 [color=#FFFFFF]
+      RenderBlock (anonymous) at (0,0) size 16x16
+        RenderText {#text} at (0,0) size 16x16
+          text run at (0,0) width 16: "a"
+layer at (8,24) size 784x16
+  RenderBlock (anonymous multi-column) at (0,16) size 784x16
+    RenderFlexibleBox {DIV} at (0,0) size 117x16 [color=#FFFFFF]
+      RenderBlock (anonymous) at (0,0) size 16x16
+        RenderText {#text} at (0,0) size 16x16
+          text run at (0,0) width 16: "b"
Property changes on: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-flexbox-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-flexbox.html (0 => 122025)


--- releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-flexbox.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-flexbox.html	2012-07-06 20:20:08 UTC (rev 122025)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<body style="font-family: ahem; -webkit-font-smoothing: none;">
+<style>
+#container { -webkit-column-width: 100px; }
+#div1 { -webkit-column-span: all; }
+#flexbox1 { color: white; }
+</style>
+<script>
+document.body.offsetTop;
+var container = document.createElement('div');
+container.setAttribute('id', 'container');
+document.body.appendChild(container); 
+flexbox1 = document.createElement('div');
+flexbox1.setAttribute('id', 'flexbox1');
+container.appendChild(flexbox1);
+var div1 = document.createElement('div');
+div1.setAttribute('id', 'div1');
+flexbox1.style.display = '-webkit-flexbox';
+flexbox1.appendChild(document.createTextNode('a'));
+flexbox1.appendChild(div1);
+flexbox1.appendChild(document.createTextNode('b'));
+</script>
+</body>
+</html>
Property changes on: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-flexbox.html
___________________________________________________________________

Added: svn:executable

Added: svn:eol-style

Added: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-summary-expected.png


(Binary files differ)
Property changes on: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-summary-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-summary-expected.txt (0 => 122025)


--- releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-summary-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-summary-expected.txt	2012-07-06 20:20:08 UTC (rev 122025)
@@ -0,0 +1,19 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x48
+  RenderBlock {HTML} at (0,0) size 800x48
+    RenderBody {BODY} at (8,8) size 784x32
+layer at (8,8) size 784x32
+  RenderBlock {DIV} at (0,0) size 784x32
+    RenderBlock (anonymous multi-column span) at (0,16) size 784x0 [color=#FFFFFF]
+      RenderBlock {DIV} at (0,0) size 784x0
+layer at (8,8) size 784x16
+  RenderBlock (anonymous multi-column) at (0,0) size 784x16
+    RenderSummary {SUMMARY} at (0,0) size 117x16 [color=#FFFFFF]
+      RenderText {#text} at (0,0) size 16x16
+        text run at (0,0) width 16: "a"
+layer at (8,24) size 784x16
+  RenderBlock (anonymous multi-column) at (0,16) size 784x16
+    RenderSummary {SUMMARY} at (0,0) size 117x16 [color=#FFFFFF]
+      RenderText {#text} at (0,0) size 16x16
+        text run at (0,0) width 16: "b"
Property changes on: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-summary-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-summary.html (0 => 122025)


--- releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-summary.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-summary.html	2012-07-06 20:20:08 UTC (rev 122025)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<body style="font-family: ahem; -webkit-font-smoothing: none;">
+<style>
+#container { -webkit-column-width: 100px; }
+#div1 { -webkit-column-span: all; }
+#summary1 { color: white; } 
+</style>
+<script>
+document.body.offsetTop;
+var container = document.createElement('div');
+container.setAttribute('id', 'container');
+document.body.appendChild(container); 
+summary1 = document.createElement('summary');
+summary1.setAttribute('id', 'summary1');
+container.appendChild(summary1);
+var div1 = document.createElement('div');
+div1.setAttribute('id', 'div1');
+summary1.style.display = 'table-row';
+summary1.appendChild(document.createTextNode('a'));
+summary1.appendChild(div1);
+summary1.appendChild(document.createTextNode('b'));
+</script>
+</body>
+</html>
Property changes on: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/clone-summary.html
___________________________________________________________________

Added: svn:executable

Added: svn:eol-style

Added: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/textbox-not-removed-crash-expected.txt (0 => 122025)


--- releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/textbox-not-removed-crash-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/textbox-not-removed-crash-expected.txt	2012-07-06 20:20:08 UTC (rev 122025)
@@ -0,0 +1,2 @@
+Test passes if it does not crash.
+A
Property changes on: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/textbox-not-removed-crash-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/textbox-not-removed-crash.html (0 => 122025)


--- releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/textbox-not-removed-crash.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/textbox-not-removed-crash.html	2012-07-06 20:20:08 UTC (rev 122025)
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+#test1 {
+    text-indent: -1em;
+    content: counter(c);
+    -webkit-column-count: 1;
+}
+#test3 {
+    -webkit-column-span: all;
+}
+</style>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+function crash() {
+    test1 = document.createElement('div'); 
+    test1.setAttribute('id', 'test1'); 
+    document.body.appendChild(test1);
+    test2 = document.createElement('div'); 
+    test1.appendChild(test2);
+    test3 = document.createElement('div'); 
+    test3.setAttribute('id', 'test3');
+    test2.appendChild(test3);
+    test2.appendChild(document.createTextNode('A')); 
+    test2.style.display = '-webkit-box';
+    document.body.offsetTop;
+    test3.style.display = 'list-item';
+    document.body.offsetTop;
+    document.body.style.zoom = 2;
+}
+window._onload_ = crash;
+</script>
+</head>
+<body>
+Test passes if it does not crash.
+</body>
+</html>
Property changes on: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/multicol/span/textbox-not-removed-crash.html
___________________________________________________________________

Added: svn:executable

Added: svn:eol-style

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


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog	2012-07-06 20:19:59 UTC (rev 122024)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog	2012-07-06 20:20:08 UTC (rev 122025)
@@ -1,3 +1,22 @@
+2012-02-22  Abhishek Arya  <infe...@chromium.org>
+
+        Cloning and linebox issues in multi-column layout.
+        https://bugs.webkit.org/show_bug.cgi?id=78273
+
+        Reviewed by Eric Seidel.
+
+        Tests: fast/multicol/span/clone-flexbox.html
+               fast/multicol/span/clone-summary.html
+               fast/multicol/span/textbox-not-removed-crash.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::clone): Fix cloning algorithm to take
+        care of cloning descendant classes of RenderBlock.
+        (WebCore::RenderBlock::splitBlocks): When we move our inline children
+        to cloneBlock, we need to clear our entire line box tree. Any descendant
+        child in the hierarchy could be a part of our line box tree and will
+        never get cleared since the child has moved to new parent cloneBlock.
+
 2012-02-28  Abhishek Arya  <infe...@chromium.org>
 
         Incorrect before child parent calculation when adding new children

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


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBlock.cpp	2012-07-06 20:19:59 UTC (rev 122024)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBlock.cpp	2012-07-06 20:20:08 UTC (rev 122025)
@@ -471,7 +471,8 @@
         cloneBlock->setChildrenInline(childrenInline());
     }
     else {
-        cloneBlock = new (renderArena()) RenderBlock(node());
+        RenderObject* cloneRenderer = node()->createRenderer(renderArena(), style());
+        cloneBlock = toRenderBlock(cloneRenderer);
         cloneBlock->setStyle(style());
 
         // This takes care of setting the right value of childrenInline in case
@@ -491,10 +492,16 @@
     if (!isAnonymousBlock())
         cloneBlock->setContinuation(oldCont);
 
+    if (!beforeChild && isAfterContent(lastChild()))
+        beforeChild = lastChild();
+
+    // If we are moving inline children from |this| to cloneBlock, then we need
+    // to clear our line box tree.
+    if (beforeChild && childrenInline())
+        deleteLineBoxTree();
+
     // Now take all of the children from beforeChild to the end and remove
     // them from |this| and place them in the clone.
-    if (!beforeChild && isAfterContent(lastChild()))
-        beforeChild = lastChild();
     moveChildrenTo(cloneBlock, beforeChild, 0, true);
     
     // Hook |clone| up as the continuation of the middle block.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to