Title: [215861] trunk
Revision
215861
Author
za...@apple.com
Date
2017-04-27 04:02:09 -0700 (Thu, 27 Apr 2017)

Log Message

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: trunk/LayoutTests/ChangeLog (215860 => 215861)


--- trunk/LayoutTests/ChangeLog	2017-04-27 08:59:09 UTC (rev 215860)
+++ trunk/LayoutTests/ChangeLog	2017-04-27 11:02:09 UTC (rev 215861)
@@ -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  Chris Dumez  <cdu...@apple.com>
 
         Unreviewed, remove unnecessary expected result in platform/ios-wk2

Added: trunk/LayoutTests/fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout-expected.html (0 => 215861)


--- trunk/LayoutTests/fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout-expected.html	2017-04-27 11:02:09 UTC (rev 215861)
@@ -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: trunk/LayoutTests/fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html (0 => 215861)


--- trunk/LayoutTests/fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html	                        (rev 0)
+++ trunk/LayoutTests/fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html	2017-04-27 11:02:09 UTC (rev 215861)
@@ -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: trunk/Source/WebCore/ChangeLog (215860 => 215861)


--- trunk/Source/WebCore/ChangeLog	2017-04-27 08:59:09 UTC (rev 215860)
+++ trunk/Source/WebCore/ChangeLog	2017-04-27 11:02:09 UTC (rev 215861)
@@ -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-27  Dean Jackson  <d...@apple.com>
 
         Use the correct modern-media-controls

Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (215860 => 215861)


--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2017-04-27 08:59:09 UTC (rev 215860)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2017-04-27 11:02:09 UTC (rev 215861)
@@ -3733,6 +3733,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