Title: [216384] releases/WebKitGTK/webkit-2.16
Revision
216384
Author
carlo...@webkit.org
Date
2017-05-08 04:20:31 -0700 (Mon, 08 May 2017)

Log Message

Merge r215861 - Text gets cut off when bailing out of simple line layout with widows.
https://bugs.webkit.org/show_bug.cgi?id=171370
<rdar://problem/31563414>

Reviewed by Antti Koivisto.

Source/WebCore:

Normal line layout requires an extra layout to handle widows. See RenderBlockFlow::relayoutToAvoidWidows.

Test: fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html

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

LayoutTests:

* fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout-expected.html: Added.
* fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog (216383 => 216384)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog	2017-05-08 11:07:40 UTC (rev 216383)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog	2017-05-08 11:20:31 UTC (rev 216384)
@@ -1,3 +1,14 @@
+2017-04-27  Zalan Bujtas  <za...@apple.com>
+
+        Text gets cut off when bailing out of simple line layout with widows.
+        https://bugs.webkit.org/show_bug.cgi?id=171370
+        <rdar://problem/31563414>
+
+        Reviewed by Antti Koivisto.
+
+        * fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout-expected.html: Added.
+        * fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html: Added.
+
 2017-04-26  Zalan Bujtas  <za...@apple.com>
 
         Forced page break on :after triggers infinite loop in column balancing

Added: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout-expected.html (0 => 216384)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout-expected.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout-expected.html	2017-05-08 11:20:31 UTC (rev 216384)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests widow handling when bailing out of simple line layout.</title>
+<style>
+div {
+	font-size: 54px;
+}
+</style>
+</head>
+<body>
+<div>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8</div>
+</body>
+</html>

Added: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html (0 => 216384)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html	2017-05-08 11:20:31 UTC (rev 216384)
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests widow handling when bailing out of simple line layout.</title>
+<style>
+body {
+	width: 494px;
+	overflow: hidden;
+}
+
+::selection {
+	background-color: transparent;
+}
+
+div {
+    widows: 2;
+	font-size: 54px;
+}
+</style>
+</head>
+<body>
+<div id=foobar>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10</div>
+<script>
+if (window.internals)
+    internals.setPagination("LeftToRightPaginated", 0);
+if (window.testRunner)
+	testRunner.waitUntilDone();
+setTimeout(function() {
+	var range = document.createRange();
+	range.selectNode(foobar);
+	window.getSelection().addRange(range);
+	if (window.testRunner)
+	    testRunner.notifyDone();
+}, 10);
+</script>
+</body>
+</html>

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog (216383 => 216384)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog	2017-05-08 11:07:40 UTC (rev 216383)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog	2017-05-08 11:20:31 UTC (rev 216384)
@@ -1,3 +1,18 @@
+2017-04-27  Zalan Bujtas  <za...@apple.com>
+
+        Text gets cut off when bailing out of simple line layout with widows.
+        https://bugs.webkit.org/show_bug.cgi?id=171370
+        <rdar://problem/31563414>
+
+        Reviewed by Antti Koivisto.
+
+        Normal line layout requires an extra layout to handle widows. See RenderBlockFlow::relayoutToAvoidWidows. 
+
+        Test: fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html
+
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::ensureLineBoxes):
+
 2017-04-26  Zalan Bujtas  <za...@apple.com>
 
         Forced page break on :after triggers infinite loop in column balancing

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderBlockFlow.cpp (216383 => 216384)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderBlockFlow.cpp	2017-05-08 11:07:40 UTC (rev 216383)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderBlockFlow.cpp	2017-05-08 11:20:31 UTC (rev 216384)
@@ -3727,6 +3727,9 @@
     if (isPaginated) {
         view().pushLayoutStateForPagination(*this);
         layoutLineBoxes(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
+        // This matches relayoutToAvoidWidows.
+        if (shouldBreakAtLineToAvoidWidow())
+            layoutLineBoxes(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
         view().popLayoutState(*this);
     } else
         layoutLineBoxes(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to