Diff
Modified: trunk/LayoutTests/ChangeLog (171848 => 171849)
--- trunk/LayoutTests/ChangeLog 2014-07-31 13:18:24 UTC (rev 171848)
+++ trunk/LayoutTests/ChangeLog 2014-07-31 13:43:52 UTC (rev 171849)
@@ -1,3 +1,20 @@
+2014-07-31 Andrei Bucur <[email protected]>
+
+ [CSS Multicolumn] Clear the lines when switching to multi-column layout
+ https://bugs.webkit.org/show_bug.cgi?id=135127
+
+ Reviewed by Alexandru Chiculita.
+
+ Tests that verifies lines are correctly cleared when an element is switched to
+ multi-column layout.
+
+ * fast/multicol/inline-container-to-multicol-expected.txt: Added.
+ * fast/multicol/inline-container-to-multicol.html: Added.
+ * fast/multicol/inline-container-to-multicol-float-expected.txt: Added.
+ * fast/multicol/inline-container-to-multicol-float.html: Added.
+ * fast/multicol/inline-container-to-multicol-positioned-expected.txt: Added.
+ * fast/multicol/inline-container-to-multicol-positioned.html: Added.
+
2014-07-30 Benjamin Poulain <[email protected]>
Add a layout test for Geolocation's request queueing for hidden pages
Added: trunk/LayoutTests/fast/multicol/inline-container-to-multicol-expected.txt (0 => 171849)
--- trunk/LayoutTests/fast/multicol/inline-container-to-multicol-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/multicol/inline-container-to-multicol-expected.txt 2014-07-31 13:43:52 UTC (rev 171849)
@@ -0,0 +1 @@
+b135127: The test passes if it doesn't hang or crash
Added: trunk/LayoutTests/fast/multicol/inline-container-to-multicol-float-expected.txt (0 => 171849)
--- trunk/LayoutTests/fast/multicol/inline-container-to-multicol-float-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/multicol/inline-container-to-multicol-float-expected.txt 2014-07-31 13:43:52 UTC (rev 171849)
@@ -0,0 +1 @@
+b135127: The test passes if it doesn't hang or crash
Added: trunk/LayoutTests/fast/multicol/inline-container-to-multicol-float.html (0 => 171849)
--- trunk/LayoutTests/fast/multicol/inline-container-to-multicol-float.html (rev 0)
+++ trunk/LayoutTests/fast/multicol/inline-container-to-multicol-float.html 2014-07-31 13:43:52 UTC (rev 171849)
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style type="text/css">
+ #multicol {
+ border: thin solid green;
+ height: 300px;
+ width: 200px;
+ text-align: justify;
+ }
+
+ #multicol.has-first-letter::first-letter {
+ color: red;
+ font-size: 10px;
+ }
+
+ #float {
+ float: left;
+ width: 20px;
+ height: 10px;
+ background: blue;
+ }
+ </style>
+</head>
+<body>
+ <p><a href="" The test passes if it doesn't hang or crash</p>
+ <div id="multicol" class="has-first-letter">
+ Text text text text text text text text <div id="float">A</div>Text text text text Text text text text Text text text text text text text text
+ </div>
+ <script type="text/_javascript_">
+ if (window.testRunner)
+ window.testRunner.dumpAsText();
+
+ var multicolElement = document.getElementById("multicol");
+ var floatElement = document.getElementById("float");
+
+ document.body.offsetTop;
+
+ multicolElement.style.webkitColumnCount = "2";
+ document.body.offsetTop;
+
+ multicolElement.style.webkitColumnCount = "auto";
+ document.body.offsetLeft;
+
+ multicolElement.className = "";
+ document.body.offsetLeft;
+
+ multicolElement.remove();
+ </script>
+</body>
+</html>
Added: trunk/LayoutTests/fast/multicol/inline-container-to-multicol-positioned-expected.txt (0 => 171849)
--- trunk/LayoutTests/fast/multicol/inline-container-to-multicol-positioned-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/multicol/inline-container-to-multicol-positioned-expected.txt 2014-07-31 13:43:52 UTC (rev 171849)
@@ -0,0 +1 @@
+b135127: The test passes if it doesn't hang or crash
Added: trunk/LayoutTests/fast/multicol/inline-container-to-multicol-positioned.html (0 => 171849)
--- trunk/LayoutTests/fast/multicol/inline-container-to-multicol-positioned.html (rev 0)
+++ trunk/LayoutTests/fast/multicol/inline-container-to-multicol-positioned.html 2014-07-31 13:43:52 UTC (rev 171849)
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style type="text/css">
+ #multicol {
+ border: thin solid green;
+ height: 300px;
+ width: 200px;
+ text-align: justify;
+ position: relative;
+ }
+
+ #positioned {
+ position: absolute;
+ }
+ </style>
+</head>
+<body>
+ <p><a href="" The test passes if it doesn't hang or crash</p>
+ <div id="multicol">
+ Text text text text text text text text <span id="positioned">Text text text text Text text text text</span>Text text text text Text text text text Text text text text text text text text
+ </div>
+ <script type="text/_javascript_">
+ if (window.testRunner)
+ window.testRunner.dumpAsText();
+
+ var multicolElement = document.getElementById("multicol");
+
+ document.body.offsetTop;
+
+ multicolElement.style.webkitColumnCount = "2";
+ document.body.offsetTop;
+
+ multicolElement.style.webkitColumnCount = "auto";
+ document.body.offsetLeft;
+
+ multicolElement.remove();
+ </script>
+</body>
+</html>
Added: trunk/LayoutTests/fast/multicol/inline-container-to-multicol.html (0 => 171849)
--- trunk/LayoutTests/fast/multicol/inline-container-to-multicol.html (rev 0)
+++ trunk/LayoutTests/fast/multicol/inline-container-to-multicol.html 2014-07-31 13:43:52 UTC (rev 171849)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style type="text/css">
+ #multicol {
+ border: thin solid green;
+ height: 300px;
+ width: 200px;
+ text-align: justify;
+ }
+ </style>
+</head>
+<body>
+ <p><a href="" The test passes if it doesn't hang or crash</p>
+ <div id="multicol">
+ <div id="remove">A</div>Text text text text text text text text <div id="remove2">A</div>Text text text text Text text text text Text text text text text text text text
+ </div>
+ <script type="text/_javascript_">
+ if (window.testRunner)
+ window.testRunner.dumpAsText();
+
+ var multicolElement = document.getElementById("multicol");
+ var removeElement = document.getElementById("remove");
+ var removeElement2 = document.getElementById("remove2");
+
+ removeElement.remove();
+ removeElement2.remove();
+ document.body.offsetTop;
+
+ multicolElement.style.webkitColumnCount = "2";
+ document.body.offsetTop;
+
+ multicolElement.appendChild(removeElement);
+ multicolElement.appendChild(removeElement2);
+ document.body.offsetLeft;
+ multicolElement.style.webkitColumnCount = "auto";
+ document.body.offsetLeft;
+
+ multicolElement.remove();
+ </script>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (171848 => 171849)
--- trunk/Source/WebCore/ChangeLog 2014-07-31 13:18:24 UTC (rev 171848)
+++ trunk/Source/WebCore/ChangeLog 2014-07-31 13:43:52 UTC (rev 171849)
@@ -1,3 +1,21 @@
+2014-07-31 Andrei Bucur <[email protected]>
+
+ [CSS Multicolumn] Clear the lines when switching to multi-column layout
+ https://bugs.webkit.org/show_bug.cgi?id=135127
+
+ Reviewed by Alexandru Chiculita.
+
+ When switching an element to multi-column layout it becomes a container of block
+ children. When this happens the existing line boxes must be deleted in addition
+ to clearing the hasInlineChildren flag.
+
+ Tests: fast/multicol/inline-container-to-multicol.html
+ fast/multicol/inline-container-to-multicol-float.html
+ fast/multicol/inline-container-to-multicol-positioned.html
+
+ * rendering/RenderBlockFlow.cpp:
+ (WebCore::RenderBlockFlow::createMultiColumnFlowThread):
+
2014-07-30 Andreas Kling <[email protected]>
PropertyName's internal string is always atomic.
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (171848 => 171849)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2014-07-31 13:18:24 UTC (rev 171848)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2014-07-31 13:43:52 UTC (rev 171849)
@@ -121,6 +121,7 @@
RenderMultiColumnFlowThread* flowThread = new RenderMultiColumnFlowThread(document(), RenderStyle::createAnonymousStyleWithDisplay(&style(), BLOCK));
flowThread->initializeStyle();
setChildrenInline(false); // Do this to avoid wrapping inline children that are just going to move into the flow thread.
+ deleteLines();
RenderBlock::addChild(flowThread);
flowThread->populate(); // Called after the flow thread is inserted so that we are reachable by the flow thread.
setMultiColumnFlowThread(flowThread);