Changeset 262363 in webkit
- Timestamp:
- May 31, 2020 11:02:42 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r262360 r262363 1 2020-05-31 Zalan Bujtas <zalan@apple.com> 2 3 [iBooks] Empty pages appear in book 4 https://bugs.webkit.org/show_bug.cgi?id=212573 5 <rdar://problem/62912623> 6 7 Reviewed by Antti Koivisto. 8 9 * fast/multicol/orphans-ignored-expected.html: Added. 10 * fast/multicol/orphans-ignored.html: Added. 11 1 12 2020-05-31 Rob Buis <rbuis@igalia.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r262360 r262363 1 2020-05-31 Zalan Bujtas <zalan@apple.com> 2 3 [iBooks] Empty pages appear in book 4 https://bugs.webkit.org/show_bug.cgi?id=212573 5 <rdar://problem/62912623> 6 7 Reviewed by Antti Koivisto. 8 9 Do not add a page break for orphan content unless the line does not fit anymore. 10 11 Test: fast/multicol/orphans-ignored.html 12 13 * rendering/SimpleLineLayoutPagination.cpp: 14 (WebCore::SimpleLineLayout::setPageBreakForLine): 15 (WebCore::SimpleLineLayout::adjustLinePositionsForPagination): 16 1 17 2020-05-31 Rob Buis <rbuis@igalia.com> 2 18 -
trunk/Source/WebCore/rendering/SimpleLineLayoutPagination.cpp
r245543 r262363 96 96 97 97 static void setPageBreakForLine(unsigned lineBreakIndex, PaginatedLines& lines, RenderBlockFlow& flow, Layout::SimpleLineStruts& struts, 98 bool atTheTopOfColumnOrPage )98 bool atTheTopOfColumnOrPage, bool lineDoesNotFit) 99 99 { 100 100 auto line = lines.at(lineBreakIndex); … … 102 102 auto& style = flow.style(); 103 103 auto firstLineDoesNotFit = !lineBreakIndex && line.height < flow.pageLogicalHeightForOffset(line.top); 104 auto orphanDoesNotFit =!style.hasAutoOrphans() && style.orphans() > (short)lineBreakIndex;105 if (firstLineDoesNotFit || orphanDoesNotFit) {104 auto moveOrphanToNextColumn = lineDoesNotFit && !style.hasAutoOrphans() && style.orphans() > (short)lineBreakIndex; 105 if (firstLineDoesNotFit || moveOrphanToNextColumn) { 106 106 auto firstLine = lines.first(); 107 107 auto firstLineOverflowRect = computeOverflow(flow, LayoutRect(0_lu, firstLine.top, 0_lu, firstLine.height)); … … 147 147 auto remainingHeight = flow.pageRemainingLogicalHeightForOffset(line.top, RenderBlockFlow::ExcludePageBoundary); 148 148 auto atTheTopOfColumnOrPage = flow.pageLogicalHeightForOffset(line.top) == remainingHeight; 149 if (line.height > remainingHeight || (atTheTopOfColumnOrPage && lineIndex)) { 149 auto lineDoesNotFit = line.height > remainingHeight; 150 if (lineDoesNotFit || (atTheTopOfColumnOrPage && lineIndex)) { 150 151 auto lineBreakIndex = computeLineBreakIndex(lineIndex, lineCount, orphans, widows, struts); 151 152 // Are we still at the top of the column/page? 152 153 atTheTopOfColumnOrPage = atTheTopOfColumnOrPage ? lineIndex == lineBreakIndex : false; 153 setPageBreakForLine(lineBreakIndex, lines, flow, struts, atTheTopOfColumnOrPage );154 setPageBreakForLine(lineBreakIndex, lines, flow, struts, atTheTopOfColumnOrPage, lineDoesNotFit); 154 155 // Recompute line positions that we already visited but widow break pushed them to a new page. 155 156 for (auto i = lineBreakIndex; i < lines.size(); ++i)
Note: See TracChangeset
for help on using the changeset viewer.