Changeset 152572 in webkit
- Timestamp:
- Jul 11, 2013 9:17:37 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r152569 r152572 1 2013-07-11 Andrei Bucur <abucur@adobe.com> 2 3 [CSS Regions] In a region chain with auto-height regions, lines get their length based only on the first region 4 https://bugs.webkit.org/show_bug.cgi?id=118531 5 6 Reviewed by Alexandru Chiculita. 7 8 Add tests verifying the lines widths are correctly computed in auto-height regions with and without a max-height set. 9 10 * fast/regions/autoheight-correct-region-for-lines-2-expected.html: Added. 11 * fast/regions/autoheight-correct-region-for-lines-2.html: Added. 12 * fast/regions/autoheight-correct-region-for-lines-expected.html: Added. 13 * fast/regions/autoheight-correct-region-for-lines.html: Added. 14 1 15 2013-07-11 Radu Stavila <stavila@adobe.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r152571 r152572 1 2013-07-11 Andrei Bucur <abucur@adobe.com> 2 3 [CSS Regions] In a region chain with auto-height regions, lines get their length based only on the first region 4 https://bugs.webkit.org/show_bug.cgi?id=118531 5 6 Reviewed by Alexandru Chiculita. 7 8 When computing the height a flow thread it's possible to overflow the maximum LayoutUnit and obtain a negative value. 9 This leads to invalid results during layout when computing the region range and the RenderBoxRegion info for the 10 descendant boxes of the flow thread. 11 12 This issue appears especially during the auto-height algorithm because it initializes the auto-height regions 13 height with the LayoutUnit::max() / 2 value. Summing two such regions overflows and results in a negative value. 14 15 The fix clamps the maximum height of the flow thread to LayoutUnit::max() / 2. This doesn't affect the auto-height 16 algorithm because regionAtBlockOffset() will still return the correct values as the auto-height regions content 17 is established and their height updated. 18 19 Tests: fast/regions/autoheight-correct-region-for-lines-2.html 20 fast/regions/autoheight-correct-region-for-lines.html 21 22 * rendering/RenderBlock.cpp: 23 (WebCore::RenderBlock::updateRegionsAndShapesBeforeChildLayout): 24 * rendering/RenderFlowThread.cpp: 25 (WebCore::RenderFlowThread::computeLogicalHeight): 26 (WebCore::RenderFlowThread::setRegionRangeForBox): 27 (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect): 28 * rendering/RenderFlowThread.h: 29 * rendering/RenderRegion.cpp: 30 (WebCore::RenderRegion::maxPageLogicalHeight): 31 1 32 2013-07-11 Timothy Hatcher <timothy@apple.com> 2 33 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r152149 r152572 1497 1497 // Compute the maximum logical height content may cause this block to expand to 1498 1498 // FIXME: These should eventually use the const computeLogicalHeight rather than updateLogicalHeight 1499 setLogicalHeight( LayoutUnit::max() / 2);1499 setLogicalHeight(RenderFlowThread::maxLogicalHeight()); 1500 1500 updateLogicalHeight(); 1501 1501 -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r152281 r152572 252 252 computedValues.m_extent = 0; 253 253 254 const LayoutUnit maxFlowSize = RenderFlowThread::maxLogicalHeight(); 254 255 for (RenderRegionList::const_iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) { 255 256 RenderRegion* region = *iter; 256 257 ASSERT(!region->needsLayout() || region->isRenderRegionSet()); 257 258 258 computedValues.m_extent += region->logicalHeightOfAllFlowThreadContent(); 259 LayoutUnit distanceToMaxSize = maxFlowSize - computedValues.m_extent; 260 computedValues.m_extent += std::min(distanceToMaxSize, region->logicalHeightOfAllFlowThreadContent()); 261 262 // If we reached the maximum size there's no point in going further. 263 if (computedValues.m_extent == maxFlowSize) 264 return; 259 265 } 260 266 } … … 686 692 return; 687 693 694 ASSERT(box->logicalHeight() >= 0); 695 688 696 // FIXME: Not right for differing writing-modes. 689 697 RenderRegion* startRegion = regionAtBlockOffset(offsetFromLogicalTopOfFirstPage, true); … … 876 884 877 885 LayoutUnit regionLogicalWidth = region->pageLogicalWidth(); 878 LayoutUnit regionLogicalHeight = std::min<LayoutUnit>( LayoutUnit::max() / 2- logicalHeight, region->logicalHeightOfAllFlowThreadContent());886 LayoutUnit regionLogicalHeight = std::min<LayoutUnit>(RenderFlowThread::maxLogicalHeight() - logicalHeight, region->logicalHeightOfAllFlowThreadContent()); 879 887 880 888 LayoutRect regionRect(style()->direction() == LTR ? LayoutUnit() : logicalWidth() - regionLogicalWidth, logicalHeight, regionLogicalWidth, regionLogicalHeight); -
trunk/Source/WebCore/rendering/RenderFlowThread.h
r152281 r152572 169 169 LayoutUnit offsetFromLogicalTopOfFirstRegion(const RenderBlock*) const; 170 170 171 // Used to estimate the maximum height of the flow thread. 172 static LayoutUnit maxLogicalHeight() { return LayoutUnit::max() / 2; } 173 171 174 protected: 172 175 virtual const char* renderName() const = 0; -
trunk/Source/WebCore/rendering/RenderRegion.cpp
r152281 r152572 82 82 ASSERT(m_flowThread); 83 83 ASSERT(hasAutoLogicalHeight() && !m_flowThread->inConstrainedLayoutPhase()); 84 return style()->logicalMaxHeight().isUndefined() ? LayoutUnit::max() / 2: computeReplacedLogicalHeightUsing(style()->logicalMaxHeight());84 return style()->logicalMaxHeight().isUndefined() ? RenderFlowThread::maxLogicalHeight() : computeReplacedLogicalHeightUsing(style()->logicalMaxHeight()); 85 85 } 86 86
Note: See TracChangeset
for help on using the changeset viewer.