Changeset 169110 in webkit
- Timestamp:
- May 20, 2014 7:34:56 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r169107 r169110 1 2014-05-20 Radu Stavila <stavila@adobe.com> 2 3 [CSS Regions] Block incorrectly sized when containing an unsplittable box 4 https://bugs.webkit.org/show_bug.cgi?id=132601 5 6 Reviewed by Antti Koivisto. 7 8 Added tests for the layout of elements following inline-block elements 9 that overflow their region, with and without anonymous blocks. 10 11 * fast/regions/inline-block-inside-anonymous-overflow-expected.html: Added. 12 * fast/regions/inline-block-inside-anonymous-overflow.html: Added. 13 * fast/regions/inline-block-overflow-expected.html: Added. 14 * fast/regions/inline-block-overflow.html: Added. 15 1 16 2014-05-20 Zoltan Horvath <zoltan@webkit.org> 2 17 -
trunk/Source/WebCore/ChangeLog
r169105 r169110 1 2014-05-20 Radu Stavila <stavila@adobe.com> 2 3 [CSS Regions] Block incorrectly sized when containing an unsplittable box 4 https://bugs.webkit.org/show_bug.cgi?id=132601 5 6 Reviewed by Antti Koivisto. 7 8 When laying out elements in a region, when an inline element is encountered 9 the size of its parent must not be increased beyond the bottom of the current region, 10 unless if its the last region. This will ensure that the next sibling of the 11 inline element is correctly laid out at the top of the next region, instead 12 of leaving an empty space equal to the height of the overflow, as it did until now. 13 14 Tests: fast/regions/inline-block-inside-anonymous-overflow.html 15 fast/regions/inline-block-overflow.html 16 17 * rendering/RenderBlockFlow.cpp: 18 (WebCore::RenderBlockFlow::adjustLinePositionForPagination): 19 (WebCore::RenderBlockFlow::hasNextPage): 20 * rendering/RenderBlockFlow.h: 21 * rendering/RenderBlockLineLayout.cpp: 22 (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): 23 (WebCore::RenderBlockFlow::linkToEndLineIfNeeded): 24 (WebCore::RenderBlockFlow::determineStartPosition): 25 (WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine): 26 1 27 2014-05-20 Mihnea Ovidenie <mihnea@adobe.com> 2 28 -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r168836 r169110 1621 1621 } 1622 1622 1623 void RenderBlockFlow::adjustLinePositionForPagination(RootInlineBox* lineBox, LayoutUnit& delta, RenderFlowThread* flowThread)1623 void RenderBlockFlow::adjustLinePositionForPagination(RootInlineBox* lineBox, LayoutUnit& delta, bool& overflowsRegion, RenderFlowThread* flowThread) 1624 1624 { 1625 1625 // FIXME: For now we paginate using line overflow. This ensures that lines don't overlap at all when we … … 1642 1642 // Technically if the location we move the line to has a different line width than our old position, then we need to dirty the 1643 1643 // line and all following lines. 1644 overflowsRegion = false; 1644 1645 LayoutRect logicalVisualOverflow = lineBox->logicalVisualOverflowRect(lineBox->lineTop(), lineBox->lineBottom()); 1645 1646 LayoutUnit logicalOffset = std::min(lineBox->lineTopWithLeading(), logicalVisualOverflow.y()); … … 1660 1661 return; 1661 1662 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, ExcludePageBoundary); 1663 overflowsRegion = (lineHeight > remainingLogicalHeight); 1662 1664 1663 1665 int lineIndex = lineCount(lineBox); … … 1674 1676 remainingLogicalHeight -= std::min(lineHeight - pageLogicalHeight, std::max<LayoutUnit>(0, logicalVisualOverflow.y() - lineBox->lineTopWithLeading())); 1675 1677 } 1678 LayoutUnit remainingLogicalHeightAtNewOffset = pageRemainingLogicalHeightForOffset(logicalOffset + remainingLogicalHeight, ExcludePageBoundary); 1679 overflowsRegion = (lineHeight > remainingLogicalHeightAtNewOffset); 1676 1680 LayoutUnit totalLogicalHeight = lineHeight + std::max<LayoutUnit>(0, logicalOffset); 1677 1681 LayoutUnit pageLogicalHeightAtNewOffset = hasUniformPageLogicalHeight ? pageLogicalHeight : pageLogicalHeightForOffset(logicalOffset + remainingLogicalHeight); … … 1759 1763 RenderRegion* endRegion = nullptr; 1760 1764 flowThread->getRegionRangeForBox(this, startRegion, endRegion); 1761 return region != endRegion;1765 return (endRegion && region != endRegion); 1762 1766 } 1763 1767 -
trunk/Source/WebCore/rendering/RenderBlockFlow.h
r168836 r169110 591 591 public: 592 592 // FIXME-BLOCKFLOW: These can be made protected again once all callers have been moved here. 593 void adjustLinePositionForPagination(RootInlineBox*, LayoutUnit& deltaOffset, RenderFlowThread*); // Computes a deltaOffset value that put a line at the top of the next page if it doesn't fit on the current page.593 void adjustLinePositionForPagination(RootInlineBox*, LayoutUnit& deltaOffset, bool& overflowsRegion, RenderFlowThread*); // Computes a deltaOffset value that put a line at the top of the next page if it doesn't fit on the current page. 594 594 void updateRegionForLine(RootInlineBox*) const; 595 595 void createRenderNamedFlowFragmentIfNeeded(); -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r169089 r169110 1135 1135 if (paginated) { 1136 1136 LayoutUnit adjustment = 0; 1137 adjustLinePositionForPagination(lineBox, adjustment, layoutState.flowThread()); 1137 bool overflowsRegion; 1138 adjustLinePositionForPagination(lineBox, adjustment, overflowsRegion, layoutState.flowThread()); 1138 1139 if (adjustment) { 1139 1140 LayoutUnit oldLineWidth = availableLogicalWidthForLine(oldLogicalHeight, layoutState.lineInfo().isFirstLine()); … … 1150 1151 1151 1152 setLogicalHeight(lineBox->lineBottomWithLeading()); 1153 } 1154 1155 if (RenderFlowThread* flowThread = flowThreadContainingBlock()) { 1156 if (flowThread->isRenderNamedFlowThread() && overflowsRegion && hasNextPage(lineBox->lineTop())) { 1157 // Limit the height of this block to the end of the current region because 1158 // it is also fragmented into the next region. 1159 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalTop(), ExcludePageBoundary); 1160 if (logicalHeight() > remainingLogicalHeight) 1161 setLogicalHeight(remainingLogicalHeight); 1162 } 1152 1163 } 1153 1164 … … 1266 1277 if (paginated) { 1267 1278 delta -= line->paginationStrut(); 1268 adjustLinePositionForPagination(line, delta, layoutState.flowThread()); 1279 bool overflowsRegion; 1280 adjustLinePositionForPagination(line, delta, overflowsRegion, layoutState.flowThread()); 1269 1281 } 1270 1282 if (delta) { … … 1506 1518 } 1507 1519 paginationDelta -= curr->paginationStrut(); 1508 adjustLinePositionForPagination(curr, paginationDelta, layoutState.flowThread()); 1520 bool overflowsRegion; 1521 adjustLinePositionForPagination(curr, paginationDelta, overflowsRegion, layoutState.flowThread()); 1509 1522 if (paginationDelta) { 1510 1523 if (containsFloats() || !layoutState.floats().isEmpty()) { … … 1654 1667 // strut yet. 1655 1668 LayoutUnit oldPaginationStrut = lineBox->paginationStrut(); 1669 bool overflowsRegion; 1656 1670 lineDelta -= oldPaginationStrut; 1657 adjustLinePositionForPagination(lineBox, lineDelta, layoutState.flowThread());1671 adjustLinePositionForPagination(lineBox, lineDelta, overflowsRegion, layoutState.flowThread()); 1658 1672 lineBox->setPaginationStrut(oldPaginationStrut); 1659 1673 }
Note: See TracChangeset
for help on using the changeset viewer.