Title: [204980] trunk
- Revision
- 204980
- Author
- [email protected]
- Date
- 2016-08-25 11:41:22 -0700 (Thu, 25 Aug 2016)
Log Message
Infinite recursion crash in WebCore::RenderBlockFlow::layoutBlock
https://bugs.webkit.org/show_bug.cgi?id=139474
<rdar://problem/27705190>
Reviewed by David Hyatt.
Source/WebCore:
We should just give up trying to avoid widow when the page is too small to break line.
Test: fast/multicol/assert-on-small-page-height-with-widow.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::clearShouldBreakAtLineToAvoidWidowIfNeeded):
(WebCore::RenderBlockFlow::adjustLinePositionForPagination):
* rendering/RenderBlockFlow.h:
LayoutTests:
* fast/multicol/assert-on-small-page-height-with-widow-expected.txt: Added.
* fast/multicol/assert-on-small-page-height-with-widow.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (204979 => 204980)
--- trunk/LayoutTests/ChangeLog 2016-08-25 18:39:22 UTC (rev 204979)
+++ trunk/LayoutTests/ChangeLog 2016-08-25 18:41:22 UTC (rev 204980)
@@ -1,3 +1,14 @@
+2016-08-25 Zalan Bujtas <[email protected]>
+
+ Infinite recursion crash in WebCore::RenderBlockFlow::layoutBlock
+ https://bugs.webkit.org/show_bug.cgi?id=139474
+ <rdar://problem/27705190>
+
+ Reviewed by David Hyatt.
+
+ * fast/multicol/assert-on-small-page-height-with-widow-expected.txt: Added.
+ * fast/multicol/assert-on-small-page-height-with-widow.html: Added.
+
2016-08-25 Johan K. Jensen <[email protected]>
Update the Resource Timing implementation
Added: trunk/LayoutTests/fast/multicol/assert-on-small-page-height-with-widow-expected.txt (0 => 204980)
--- trunk/LayoutTests/fast/multicol/assert-on-small-page-height-with-widow-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/multicol/assert-on-small-page-height-with-widow-expected.txt 2016-08-25 18:41:22 UTC (rev 204980)
@@ -0,0 +1,3 @@
+PASS if no assert in debug.
+
+
Added: trunk/LayoutTests/fast/multicol/assert-on-small-page-height-with-widow.html (0 => 204980)
--- trunk/LayoutTests/fast/multicol/assert-on-small-page-height-with-widow.html (rev 0)
+++ trunk/LayoutTests/fast/multicol/assert-on-small-page-height-with-widow.html 2016-08-25 18:41:22 UTC (rev 204980)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that.</title>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+</script>
+<style>
+html {
+ -webkit-column-count: 3;
+}
+
+body {
+ max-height: 0px;
+ -webkit-column-count: 3;
+ widows: 2;
+}
+span {
+ margin-right: -1px;
+}
+</style>
+</head>
+<body>
+PASS if no assert in debug.<input><br><br>
+<span></span>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (204979 => 204980)
--- trunk/Source/WebCore/ChangeLog 2016-08-25 18:39:22 UTC (rev 204979)
+++ trunk/Source/WebCore/ChangeLog 2016-08-25 18:41:22 UTC (rev 204980)
@@ -1,3 +1,20 @@
+2016-08-25 Zalan Bujtas <[email protected]>
+
+ Infinite recursion crash in WebCore::RenderBlockFlow::layoutBlock
+ https://bugs.webkit.org/show_bug.cgi?id=139474
+ <rdar://problem/27705190>
+
+ Reviewed by David Hyatt.
+
+ We should just give up trying to avoid widow when the page is too small to break line.
+
+ Test: fast/multicol/assert-on-small-page-height-with-widow.html
+
+ * rendering/RenderBlockFlow.cpp:
+ (WebCore::RenderBlockFlow::clearShouldBreakAtLineToAvoidWidowIfNeeded):
+ (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
+ * rendering/RenderBlockFlow.h:
+
2016-08-24 Sam Weinig <[email protected]>
Add the ability to override the implementation name of IDL enums and dictionaries
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (204979 => 204980)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2016-08-25 18:39:22 UTC (rev 204979)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2016-08-25 18:41:22 UTC (rev 204980)
@@ -1650,7 +1650,15 @@
return false;
}
-
+
+static void clearShouldBreakAtLineToAvoidWidowIfNeeded(RenderBlockFlow& blockFlow)
+{
+ if (!blockFlow.shouldBreakAtLineToAvoidWidow())
+ return;
+ blockFlow.clearShouldBreakAtLineToAvoidWidow();
+ blockFlow.setDidBreakAtLineToAvoidWidow();
+}
+
void RenderBlockFlow::adjustLinePositionForPagination(RootInlineBox* lineBox, LayoutUnit& delta, bool& overflowsRegion, RenderFlowThread* flowThread)
{
// FIXME: Ignore anonymous inline blocks. Handle the delta already having been set because of
@@ -1704,8 +1712,11 @@
logicalBottom = intMinForLayoutUnit;
lineBox->computeReplacedAndTextLineTopAndBottom(logicalOffset, logicalBottom);
lineHeight = logicalBottom - logicalOffset;
- if (logicalOffset == intMaxForLayoutUnit || lineHeight > pageLogicalHeight)
- return; // Give up. We're genuinely too big even after excluding blank space and overflow.
+ if (logicalOffset == intMaxForLayoutUnit || lineHeight > pageLogicalHeight) {
+ // Give up. We're genuinely too big even after excluding blank space and overflow.
+ clearShouldBreakAtLineToAvoidWidowIfNeeded(*this);
+ return;
+ }
pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
}
@@ -1714,10 +1725,8 @@
int lineIndex = lineCount(lineBox);
if (remainingLogicalHeight < lineHeight || (shouldBreakAtLineToAvoidWidow() && lineBreakToAvoidWidow() == lineIndex)) {
- if (shouldBreakAtLineToAvoidWidow() && lineBreakToAvoidWidow() == lineIndex) {
- clearShouldBreakAtLineToAvoidWidow();
- setDidBreakAtLineToAvoidWidow();
- }
+ if (lineBreakToAvoidWidow() == lineIndex)
+ clearShouldBreakAtLineToAvoidWidowIfNeeded(*this);
// If we have a non-uniform page height, then we have to shift further possibly.
if (!hasUniformPageLogicalHeight && !pushToNextPageWithMinimumLogicalHeight(remainingLogicalHeight, logicalOffset, lineHeight))
return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes