Changeset 167018 in webkit
- Timestamp:
- Apr 9, 2014 10:07:50 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r167015 r167018 1 2014-04-09 Radu Stavila <stavila@adobe.com> 2 3 [CSS Regions] Monolithic elements should not affect the layout of the content outside its region 4 https://bugs.webkit.org/show_bug.cgi?id=130499 5 6 Reviewed by David Hyatt. 7 8 Added tests for different types of fragmentation following monolithic content 9 overflowing its region. 10 Rebased the webkit-flow-float-unable-to-push test as its expected result was not the correct one. 11 12 * fast/regions/webkit-flow-float-unable-to-push-expected.html: 13 * fast/regions/fragmentation-after-float-overflow-single-region-expected.html: Added. 14 * fast/regions/fragmentation-after-float-overflow-single-region.html: Added. 15 * fast/regions/fragmentation-after-monolithic-overflow-expected.html: Added. 16 * fast/regions/fragmentation-after-monolithic-overflow-self-collapsed-expected.html: Added. 17 * fast/regions/fragmentation-after-monolithic-overflow-self-collapsed.html: Added. 18 * fast/regions/fragmentation-after-monolithic-overflow-single-region-expected.html: Added. 19 * fast/regions/fragmentation-after-monolithic-overflow-single-region.html: Added. 20 * fast/regions/fragmentation-after-monolithic-overflow.html: Added. 21 1 22 2014-04-09 Alexey Proskuryakov <ap@apple.com> 2 23 -
trunk/LayoutTests/fast/regions/webkit-flow-float-unable-to-push-expected.html
r159609 r167018 132 132 height: 100px; 133 133 } 134 135 #float2 {136 float: right;137 width: 34px;138 height: 70px;139 visibility: hidden;140 }141 134 </style> 142 135 … … 156 149 <div class="first-box" id="first-box2"> 157 150 <div class="second-box" id="second-box2"> 158 <div class="test_paragraph" id="first-paragraph2">region. <img id="float2" src="resources/transparent.png">This line of text should not get out of the region. This line of text should not get out of the region.</div>159 <div class="test_paragraph" id="second-paragraph2">This line of text should not get out of the </div>151 <div class="test_paragraph" id="first-paragraph2">region. This line of text should not get out of the region. This line of text should not get out of the region.</div> 152 <div class="test_paragraph" id="second-paragraph2">This line of text should not get out of the region. This line of</div> 160 153 </div> 161 154 </div> … … 167 160 <div class="first-box" id="first-box3"> 168 161 <div class="second-box" id="second-box3"> 169 <div class="test_paragraph" id="first-paragraph3"> region. This line oftext should not get out of the region. This line of text should not get out of the region. This line of text should not get out of the region.</div>162 <div class="test_paragraph" id="first-paragraph3">text should not get out of the region. This line of text should not get out of the region. This line of text should not get out of the region.</div> 170 163 <div class="test_paragraph" id="second-paragraph3">This line of text should not get out of the region.</div> 171 164 </div> -
trunk/Source/WebCore/ChangeLog
r167017 r167018 1 2014-04-09 Radu Stavila <stavila@adobe.com> 2 3 [CSS Regions] Monolithic elements should not affect the layout of the content outside its region 4 https://bugs.webkit.org/show_bug.cgi?id=130499 5 6 Reviewed by David Hyatt. 7 8 When performing layout on an element flowed into regions, its logical height must not be incremented 9 past the region's logical bottom for monolithic elements in regions different than the last region their containing 10 block is fragmented into. This ensures that the following elements are correctly laid out 11 from the top of the next region. 12 This change must also be applied to floats in order to prevent text from avoiding part 13 of a float that did not actually made it into the current region, but instead overflowed 14 the previous one. 15 16 Tests: fast/regions/fragmentation-after-float-overflow-single-region.html 17 fast/regions/fragmentation-after-monolithic-overflow-self-collapsed.html 18 fast/regions/fragmentation-after-monolithic-overflow-single-region.html 19 fast/regions/fragmentation-after-monolithic-overflow.html 20 21 * rendering/FloatingObjects.cpp: 22 (WebCore::FloatingObjects::computePlacedFloatsTree): 23 * rendering/RenderBlockFlow.cpp: 24 (WebCore::RenderBlockFlow::layoutBlockChild): 25 (WebCore::RenderBlockFlow::adjustBlockChildForPagination): 26 (WebCore::RenderBlockFlow::lowestFloatLogicalBottom): 27 (WebCore::RenderBlockFlow::getClearDelta): 28 (WebCore::RenderBlockFlow::applyAfterBreak): Deleted. 29 (WebCore::RenderBlockFlow::nextFloatLogicalBottomBelow): Deleted. 30 (WebCore::RenderBlockFlow::nextFloatLogicalBottomBelowForBlock): Deleted. 31 (WebCore::RenderBlockFlow::flipFloatForWritingModeForChild): Deleted. 32 * rendering/RenderBlockFlow.h: 33 * rendering/RenderFlowThread.cpp: 34 (WebCore::RenderFlowThread::isBoxInDifferentRegionsAsFloat): 35 * rendering/RenderFlowThread.h: 36 1 37 2014-04-09 Anders Carlsson <andersca@apple.com> 2 38 -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r166938 r167018 677 677 678 678 // Update our height now that the child has been placed in the correct position. 679 setLogicalHeight(logicalHeight() + logicalHeightForChild (child));679 setLogicalHeight(logicalHeight() + logicalHeightForChildForFragmentation(child)); 680 680 if (mustSeparateMarginAfterForChild(child)) { 681 681 setLogicalHeight(logicalHeight() + marginAfterForChild(child)); … … 1784 1784 } 1785 1785 1786 LayoutUnit RenderBlockFlow::logicalHeightForChildForFragmentation(const RenderBox& child) const 1787 { 1788 // This method is required because regions do not fragment monolithic elements but instead 1789 // they let them overflow the region they flow in. This behaviour is different from the 1790 // multicol/printing implementations, which have not yet been updated to correctly handle 1791 // monolithic elements. 1792 // As a result, for the moment, this method will only be used for regions, the multicol and 1793 // printing implementations will stick to the existing behaviour until their fragmentation 1794 // implementation is updated to match the regions implementation. 1795 if (!flowThreadContainingBlock() || !flowThreadContainingBlock()->isRenderNamedFlowThread()) 1796 return logicalHeightForChild(child); 1797 1798 // For unsplittable elements, this method will just return the height of the element that 1799 // fits into the current region, without the height of the part that overflows the region. 1800 // This is done for all regions, except the last one because in that case, the logical 1801 // height of the flow thread needs to also 1802 if (!childBoxIsUnsplittableForFragmentation(child) || !pageLogicalHeightForOffset(logicalTopForChild(child))) 1803 return logicalHeightForChild(child); 1804 1805 // If we're on the last page this block fragments to, the logical height of the flow thread must include 1806 // the entire unsplittable child because any following children will not be moved to the next page 1807 // so they will need to be laid out below the current unsplittable child. 1808 LayoutUnit childLogicalTop = logicalTopForChild(child); 1809 if (!hasNextPage(childLogicalTop)) 1810 return logicalHeightForChild(child); 1811 1812 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(childLogicalTop, ExcludePageBoundary); 1813 return std::min(child.logicalHeight(), remainingLogicalHeight); 1814 } 1786 1815 1787 1816 void RenderBlockFlow::layoutLineGridBox() … … 2298 2327 setLogicalTopForFloat(floatingObject, floatLogicalLocation.y()); 2299 2328 2300 setLogicalHeightForFloat(floatingObject, logicalHeightForChild (childBox) + marginBeforeForChild(childBox) + marginAfterForChild(childBox));2329 setLogicalHeightForFloat(floatingObject, logicalHeightForChildForFragmentation(childBox) + marginBeforeForChild(childBox) + marginAfterForChild(childBox)); 2301 2330 2302 2331 m_floatingObjects->addPlacedObject(floatingObject); -
trunk/Source/WebCore/rendering/RenderBlockFlow.h
r166489 r167018 374 374 LayoutUnit pageLogicalHeightForOffset(LayoutUnit offset) const; 375 375 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit offset, PageBoundaryRule = IncludePageBoundary) const; 376 LayoutUnit logicalHeightForChildForFragmentation(const RenderBox& child) const; 376 377 bool hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule = ExcludePageBoundary) const; 377 378
Note: See TracChangeset
for help on using the changeset viewer.