Diff
Modified: trunk/LayoutTests/ChangeLog (213722 => 213723)
--- trunk/LayoutTests/ChangeLog 2017-03-10 19:24:47 UTC (rev 213722)
+++ trunk/LayoutTests/ChangeLog 2017-03-10 19:36:37 UTC (rev 213723)
@@ -1,3 +1,12 @@
+2017-03-10 Zalan Bujtas <za...@apple.com>
+
+ Simple line layout: Oprhan lines with visual overflow does not work properly.
+ https://bugs.webkit.org/show_bug.cgi?id=169409
+
+ Reviewed by Antti Koivisto.
+
+ * TestExpectations:
+
2017-03-09 Simon Fraser <simon.fra...@apple.com>
[iOS WK2] Layer content blurry with nested perspective and transforms
Modified: trunk/LayoutTests/TestExpectations (213722 => 213723)
--- trunk/LayoutTests/TestExpectations 2017-03-10 19:24:47 UTC (rev 213722)
+++ trunk/LayoutTests/TestExpectations 2017-03-10 19:36:37 UTC (rev 213723)
@@ -1211,9 +1211,6 @@
# Test disabled until we can fix layout of orthogonal writing mode roots
fast/table/colspanMinWidth-vertical.html [ Skip ]
-# Orphan lines with visual overflow vs. simple line layout.
-webkit.org/b/169409 fast/multicol/orphans-negative-line-spacing.html [ ImageOnlyFailure ]
-
### END OF -disabled tests
########################################
Modified: trunk/Source/WebCore/ChangeLog (213722 => 213723)
--- trunk/Source/WebCore/ChangeLog 2017-03-10 19:24:47 UTC (rev 213722)
+++ trunk/Source/WebCore/ChangeLog 2017-03-10 19:36:37 UTC (rev 213723)
@@ -1,3 +1,20 @@
+2017-03-10 Zalan Bujtas <za...@apple.com>
+
+ Simple line layout: Oprhan lines with visual overflow does not work properly.
+ https://bugs.webkit.org/show_bug.cgi?id=169409
+
+ Reviewed by Antti Koivisto.
+
+ Add visual overflow checking for block strut. This logic is copied from RenderBlockFlow::adjustLinePositionForPagination.
+
+ Covered by existing test.
+
+ * rendering/SimpleLineLayoutFunctions.cpp:
+ (WebCore::SimpleLineLayout::computeOverflow):
+ * rendering/SimpleLineLayoutFunctions.h:
+ * rendering/SimpleLineLayoutPagination.cpp:
+ (WebCore::SimpleLineLayout::setPageBreakForLine):
+
2017-03-09 Simon Fraser <simon.fra...@apple.com>
[iOS WK2] Layer content blurry with nested perspective and transforms
Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp (213722 => 213723)
--- trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp 2017-03-10 19:24:47 UTC (rev 213722)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp 2017-03-10 19:36:37 UTC (rev 213723)
@@ -65,7 +65,7 @@
context.drawRect(snappedRect);
}
-static FloatRect computeOverflow(const RenderBlockFlow& flow, const FloatRect& layoutRect)
+FloatRect computeOverflow(const RenderBlockFlow& flow, const FloatRect& layoutRect)
{
auto overflowRect = layoutRect;
auto viewportSize = flow.frame().view() ? flow.frame().view()->size() : IntSize();
Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.h (213722 => 213723)
--- trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.h 2017-03-10 19:24:47 UTC (rev 213722)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.h 2017-03-10 19:36:37 UTC (rev 213723)
@@ -43,6 +43,7 @@
LayoutUnit computeFlowHeight(const RenderBlockFlow&, const Layout&);
LayoutUnit computeFlowFirstLineBaseline(const RenderBlockFlow&, const Layout&);
LayoutUnit computeFlowLastLineBaseline(const RenderBlockFlow&, const Layout&);
+FloatRect computeOverflow(const RenderBlockFlow&, const FloatRect&);
void paintFlow(const RenderBlockFlow&, const Layout&, PaintInfo&, const LayoutPoint& paintOffset);
bool hitTestFlow(const RenderBlockFlow&, const Layout&, const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutPagination.cpp (213722 => 213723)
--- trunk/Source/WebCore/rendering/SimpleLineLayoutPagination.cpp 2017-03-10 19:24:47 UTC (rev 213722)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutPagination.cpp 2017-03-10 19:36:37 UTC (rev 213723)
@@ -100,8 +100,10 @@
auto firstLineWithDoesNotFit = !lineBreakIndex && line.height < flow.pageLogicalHeightForOffset(line.top);
auto orphanDoesNotFit = !style.hasAutoOrphans() && style.orphans() > (short)lineBreakIndex;
if (firstLineWithDoesNotFit || orphanDoesNotFit) {
- flow.setPageBreak(line.top, line.height - remainingLogicalHeight);
- flow.setPaginationStrut(line.top + remainingLogicalHeight);
+ auto firstLine = lines.first();
+ auto firstLineOverflowRect = computeOverflow(flow, LayoutRect(0, firstLine.top, 0, firstLine.height));
+ auto firstLineUpperOverhang = std::max<LayoutUnit>(-firstLineOverflowRect.y(), 0);
+ flow.setPaginationStrut(line.top + remainingLogicalHeight + firstLineUpperOverhang);
return;
}
if (atTheTopOfColumnOrPage)