[New Multicolumn] -webkit-column-break-inside:avoid doesn't work
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Feb 2014 16:10:08 +0000 (16:10 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Feb 2014 16:10:08 +0000 (16:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=129299

Patch by Morten Stenshorne <mstensho@opera.com> on 2014-02-25
Reviewed by Andrei Bucur.

Source/WebCore:

adjustForUnsplittableChild() simply forgot to check whether we
were inside flow thread based multicol.

Test: fast/multicol/newmulticol/avoid-column-break-inside.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustForUnsplittableChild):

LayoutTests:

* fast/multicol/newmulticol/avoid-column-break-inside-expected.html: Added.
* fast/multicol/newmulticol/avoid-column-break-inside.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164649 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/multicol/newmulticol/avoid-column-break-inside-expected.html [new file with mode: 0644]
LayoutTests/fast/multicol/newmulticol/avoid-column-break-inside.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlockFlow.cpp

index a302191..ef598f3 100644 (file)
@@ -1,3 +1,13 @@
+2014-02-25  Morten Stenshorne  <mstensho@opera.com>
+
+        [New Multicolumn] -webkit-column-break-inside:avoid doesn't work
+        https://bugs.webkit.org/show_bug.cgi?id=129299
+
+        Reviewed by Andrei Bucur.
+
+        * fast/multicol/newmulticol/avoid-column-break-inside-expected.html: Added.
+        * fast/multicol/newmulticol/avoid-column-break-inside.html: Added.
+
 2014-02-25  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
 
         Refactoring inline_spelling_markers.html to use asynchronous spellchecking
diff --git a/LayoutTests/fast/multicol/newmulticol/avoid-column-break-inside-expected.html b/LayoutTests/fast/multicol/newmulticol/avoid-column-break-inside-expected.html
new file mode 100644 (file)
index 0000000..f23b433
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>Avoid column break inside block</title>
+    </head>
+    <body>
+        <p>There should be a blue square below.</p>
+        <div style="width:100px; height:100px; background:blue;"></div>
+    </body>
+</html>
diff --git a/LayoutTests/fast/multicol/newmulticol/avoid-column-break-inside.html b/LayoutTests/fast/multicol/newmulticol/avoid-column-break-inside.html
new file mode 100644 (file)
index 0000000..91ef9d2
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>Avoid column break inside block</title>
+        <script>
+            if (window.internals)
+                internals.settings.setRegionBasedColumnsEnabled(true);
+        </script>
+    </head>
+    <body>
+        <p>There should be a blue square below.</p>
+        <div style="-webkit-columns:4; columns:4;">
+            <div style="width:100px; height:100px; -webkit-column-break-inside:avoid; break-inside:avoid; background:blue;"></div>
+        </div>
+    </body>
+</html>
index e497791..f0b37b8 100644 (file)
@@ -1,3 +1,18 @@
+2014-02-25  Morten Stenshorne  <mstensho@opera.com>
+
+        [New Multicolumn] -webkit-column-break-inside:avoid doesn't work
+        https://bugs.webkit.org/show_bug.cgi?id=129299
+
+        Reviewed by Andrei Bucur.
+
+        adjustForUnsplittableChild() simply forgot to check whether we
+        were inside flow thread based multicol.
+
+        Test: fast/multicol/newmulticol/avoid-column-break-inside.html
+
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::adjustForUnsplittableChild):
+
 2014-02-25  Mihnea Ovidenie  <mihnea@adobe.com>
 
         [CSSRegions] Remove unused function RenderFlowThread::regionForCompositedLayer
index a8a565a..0fe4048 100644 (file)
@@ -1692,9 +1692,10 @@ bool RenderBlockFlow::hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule pag
 
 LayoutUnit RenderBlockFlow::adjustForUnsplittableChild(RenderBox& child, LayoutUnit logicalOffset, bool includeMargins)
 {
-    bool checkColumnBreaks = view().layoutState()->isPaginatingColumns();
-    bool checkPageBreaks = !checkColumnBreaks && view().layoutState()->m_pageLogicalHeight;
     RenderFlowThread* flowThread = flowThreadContainingBlock();
+    bool isInsideMulticolFlowThread = flowThread && !flowThread->isRenderNamedFlowThread();
+    bool checkColumnBreaks = isInsideMulticolFlowThread || view().layoutState()->isPaginatingColumns();
+    bool checkPageBreaks = !checkColumnBreaks && view().layoutState()->m_pageLogicalHeight;
     bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread();
     bool isUnsplittable = child.isUnsplittableForPagination() || (checkColumnBreaks && child.style().columnBreakInside() == PBAVOID)
         || (checkPageBreaks && child.style().pageBreakInside() == PBAVOID)