Changeset 153990 in webkit
- Timestamp:
- Aug 13, 2013, 12:44:32 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 16 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r153989 r153990 1 2013-08-13 Andrei Bucur <abucur@adobe.com> 2 3 [CSS Regions] Compute correct region ranges for boxes 4 https://bugs.webkit.org/show_bug.cgi?id=116296 5 6 Reviewed by David Hyatt. 7 8 Tests for the changes in how region ranges are computed and applied. 9 10 * fast/regions/bottom-overflow-out-of-first-region-absolute-expected.html: Added. 11 * fast/regions/bottom-overflow-out-of-first-region-absolute.html: Added. 12 * fast/regions/float-pushed-width-change-2-expected.html: Copied from LayoutTests/fast/regions/float-pushed-width-change-expected.html. 13 * fast/regions/float-pushed-width-change-2.html: Copied from LayoutTests/fast/regions/float-pushed-width-change.html. 14 * fast/regions/float-pushed-width-change-expected.html: 15 * fast/regions/float-pushed-width-change.html: 16 * fast/regions/scrollable-paragraph-unsplittable-expected.html: Added. 17 * fast/regions/scrollable-paragraph-unsplittable.html: Added. 18 1 19 2013-08-13 Zan Dobersek <zdobersek@igalia.com> 2 20 -
trunk/LayoutTests/fast/regions/float-pushed-width-change-2-expected.html
r153989 r153990 2 2 3 3 <style> 4 5 @font-face {6 font-family: webkit-ahem;7 font-style: normal;8 src: url(../../resources/Ahem.ttf);9 }10 4 11 5 #float1 { … … 50 44 padding-bottom:10px; 51 45 } 52 53 54 55 56 46 47 p.flow1 { 48 clear:both; 49 margin-bottom: 0px; 50 } 57 51 58 59 60 61 52 p.flow2 { 53 margin-top: 0px; 54 } 55 62 56 </style> 63 57 … … 76 70 <p>This line of text should not get out of the region.</p> 77 71 </div> 78 -
trunk/LayoutTests/fast/regions/float-pushed-width-change-2.html
r153989 r153990 2 2 3 3 <style> 4 5 @font-face {6 font-family: webkit-ahem;7 font-style: normal;8 src: url(../../resources/Ahem.ttf);9 }10 4 11 5 #content { … … 47 41 height: 90px; 48 42 } 43 44 #floatcontainer { 45 height: 84px; 46 } 49 47 </style> 50 48 … … 55 53 <div id="first-box"> 56 54 <div id="second-box"> 57 <p ><img id="float1"><img id="float2">55 <p id="floatcontainer"><img id="float1"><img id="float2"> 58 56 <p>This line of text should not get out of the region. This line of text should not get out of the region.</p> 59 57 <p>This line of text should not get out of the region. This line of text should not get out of the region.</p> 60 58 <p>This line of text should not get out of the region.</p> 61 59 -
trunk/LayoutTests/fast/regions/float-pushed-width-change-expected.html
r133648 r153990 2 2 3 3 <style> 4 5 @font-face {6 font-family: webkit-ahem;7 font-style: normal;8 src: url(../../resources/Ahem.ttf);9 }10 4 11 5 #float1 { … … 19 13 20 14 #float2 { 21 float:right; 15 margin-top: 30px; 16 margin-left: -30px; 17 float:left; 22 18 width:200px; 23 19 height:30px; … … 63 59 64 60 <p>In the example below, the green float should be at the top of the first region and on the left. It should spill into region two. 65 The orange float should be on the right at the top of region two.</p>61 The orange float should be right aligned under the green float because their containing block is flown only in the first region</p> 66 62 67 63 <div id="region1"> … … 70 66 <div id="region2"> 71 67 <img id="float2"> 72 <p class="flow1">This line of text should not get out of the region. This line of text should not get out of the region.</p>68 <p class="flow1">This line of text should not get out of the region.</p> 73 69 </div> 74 70 <div id="region3"> -
trunk/LayoutTests/fast/regions/float-pushed-width-change.html
r108766 r153990 2 2 3 3 <style> 4 5 @font-face {6 font-family: webkit-ahem;7 font-style: normal;8 src: url(../../resources/Ahem.ttf);9 }10 4 11 5 #content { … … 50 44 51 45 <p>In the example below, the green float should be at the top of the first region and on the left. It should spill into region two. 52 The orange float should be on the right at the top of region two.</p>46 The orange float should be right aligned under the green float because their containing block is flown only in the first region</p> 53 47 54 48 <div id="content"> 55 49 <div id="first-box"> 56 50 <div id="second-box"> 57 <p><img id="float1"><img id="float2"> 58 <p>This line of text should not get out of the region. This line of text should not get out of the region.</p>51 <p><img id="float1"><img id="float2"><p/> 52 <p>This line of text should not get out of the region.</p> 59 53 <p>This line of text should not get out of the region. This line of text should not get out of the region.</p> 60 54 <p>This line of text should not get out of the region.</p> -
trunk/Source/WebCore/ChangeLog
r153988 r153990 1 2013-08-13 Andrei Bucur <abucur@adobe.com> 2 3 [CSS Regions] Compute correct region ranges for boxes 4 https://bugs.webkit.org/show_bug.cgi?id=116296 5 6 Reviewed by David Hyatt. 7 8 The patch extends the region ranges implementation with the following behavior: 9 - the range of a box is always included in the range of its containing block (even for floats); this will simplify how overflow 10 is propagated to the regions and it should later change on a case by case basis. 11 - if the range of a box is not correctly estimated before the layout it will be marked for relayout; this is necessary to correctly 12 position boxes that overflow naturally, like floats. 13 - all the boxes have a range now, not only the blocks. 14 - regionAtBlockOffset can clamp to a box. 15 - an unsplittable box has a region range of a single region, the one where the box top falls into. 16 17 When the layout of a child box starts it tries to give an estimate based on the maximal height of the box. After the layout, 18 if the estimation was wrong, the box is relaid out. For example, if a block with a float is laid out in a region but the float 19 overflows in the next region a relayout is needed for the float so it can be positioned relative to the containing block 20 region (this step can be optimized by making a layout pass only for the children that don't have the region range enclosed in the 21 containing block range). 22 23 Tests: fast/regions/bottom-overflow-out-of-first-region-absolute.html 24 fast/regions/float-pushed-width-change-2.html 25 fast/regions/scrollable-paragraph-unsplittable.html 26 27 * rendering/RenderBlock.cpp: 28 (WebCore::RenderBlock::updateShapesBeforeBlockLayout): Doesn't do anything for regions now. 29 (WebCore::RenderBlock::updateShapesAfterBlockLayout): Doesn't do anything for regions now. 30 (WebCore::RenderBlock::relayoutToAvoidWidows): The layout to avoid widows. Widows use the line index to determine the break point, 31 not the RootLineBox pointer as before. This is necessary to prevent stale pointers in further layouts. 32 (WebCore::RenderBlock::layoutBlock): 33 (WebCore::RenderBlock::layoutBlockChild): 34 (WebCore::RenderBlock::layoutPositionedObjects): 35 (WebCore::RenderBlock::markForPaginationRelayoutIfNeeded): Relayout for widows during layoutBlock(). Don't wait to exit the block layout. 36 (WebCore::RenderBlock::positionNewFloats): 37 (WebCore::RenderBlock::hasNextPage): 38 (WebCore::RenderBlock::applyBeforeBreak): 39 (WebCore::RenderBlock::applyAfterBreak): 40 (WebCore::RenderBlock::setPageBreak): 41 (WebCore::RenderBlock::updateMinimumPageHeight): 42 (WebCore::RenderBlock::regionAtBlockOffset): This function can now clamp at a box. 43 (WebCore::RenderBlock::computeRegionRangeForBoxChild): Calculate the box region range using the box height. 44 (WebCore::RenderBlock::estimateRegionRangeForBoxChild): Estimate the box region range using a huge height for the box. 45 (WebCore::RenderBlock::updateRegionRangeForBoxChild): Determine the final region range of a box. 46 * rendering/RenderBlock.h: 47 (WebCore::RenderBlock::logicalWidthForChild): 48 (WebCore::RenderBlock::logicalHeightForChild): 49 (WebCore::RenderBlock::logicalTopForChild): 50 * rendering/RenderBlockLineLayout.cpp: 51 (WebCore::RenderBlock::layoutInlineChildren): 52 * rendering/RenderBox.cpp: 53 (WebCore::RenderBox::clampToStartAndEndRegions): 54 (WebCore::RenderBox::borderBoxRectInRegion): 55 * rendering/RenderBox.h: 56 * rendering/RenderDeprecatedFlexibleBox.cpp: 57 (WebCore::RenderDeprecatedFlexibleBox::layoutBlock): 58 * rendering/RenderFlexibleBox.cpp: 59 (WebCore::RenderFlexibleBox::layoutBlock): 60 * rendering/RenderFlowThread.cpp: 61 (WebCore::RenderFlowThread::validateRegions): 62 (WebCore::RenderFlowThread::regionAtBlockOffset): 63 (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent): 64 (WebCore::RenderFlowThread::pageLogicalTopForOffset): 65 (WebCore::RenderFlowThread::pageLogicalWidthForOffset): 66 (WebCore::RenderFlowThread::pageLogicalHeightForOffset): 67 (WebCore::RenderFlowThread::pageRemainingLogicalHeightForOffset): 68 (WebCore::RenderFlowThread::mapFromFlowToRegion): 69 (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock): 70 (WebCore::RenderFlowThread::clearRenderObjectCustomStyle): 71 (WebCore::RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle): 72 (WebCore::RenderFlowThread::setRegionRangeForBox): 73 (WebCore::RenderFlowThread::applyBreakAfterContent): 74 (WebCore::RenderFlowThread::addForcedRegionBreak): 75 * rendering/RenderFlowThread.h: 76 * rendering/RenderGrid.cpp: 77 (WebCore::RenderGrid::layoutBlock): 78 * rendering/RenderMultiColumnFlowThread.cpp: 79 (WebCore::RenderMultiColumnFlowThread::setPageBreak): 80 (WebCore::RenderMultiColumnFlowThread::updateMinimumPageHeight): 81 * rendering/RenderMultiColumnFlowThread.h: 82 1 83 2013-08-13 Ryosuke Niwa <rniwa@webkit.org> 2 84 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r153814 r153990 1481 1481 #endif 1482 1482 1483 bool RenderBlock::update RegionsAndShapesBeforeChildLayout(RenderFlowThread* flowThread)1483 bool RenderBlock::updateShapesBeforeBlockLayout() 1484 1484 { 1485 1485 #if ENABLE(CSS_SHAPES) 1486 if (!flowThread && !shapeInsideInfo())1486 if (!flowThreadContainingBlock() && !shapeInsideInfo()) 1487 1487 return shapeInfoRequiresRelayout(this); 1488 #else1489 if (!flowThread)1490 return false;1491 #endif1492 1488 1493 1489 LayoutUnit oldHeight = logicalHeight(); … … 1499 1495 updateLogicalHeight(); 1500 1496 1501 #if ENABLE(CSS_SHAPES)1502 1497 computeShapeSize(); 1503 #endif1504 1505 // Set our start and end regions. No regions above or below us will be considered by our children. They are1506 // effectively clamped to our region range.1507 computeRegionRangeForBlock(flowThread);1508 1498 1509 1499 setLogicalHeight(oldHeight); 1510 1500 setLogicalTop(oldTop); 1511 1501 1512 #if ENABLE(CSS_SHAPES)1513 1502 return shapeInfoRequiresRelayout(this); 1514 #else1515 return false;1516 1503 #endif 1517 1504 } … … 1528 1515 #endif 1529 1516 1530 void RenderBlock::update RegionsAndShapesAfterChildLayout(RenderFlowThread* flowThread,bool heightChanged)1517 void RenderBlock::updateShapesAfterBlockLayout(bool heightChanged) 1531 1518 { 1532 1519 #if ENABLE(CSS_SHAPES) … … 1535 1522 if (heightChanged && shapeInsideInfo) 1536 1523 shapeInsideInfo->dirtyShapeSize(); 1537 #else1538 UNUSED_PARAM(heightChanged);1539 1524 #endif 1540 computeRegionRangeForBlock(flowThread);1541 }1542 1543 void RenderBlock::computeRegionRangeForBlock(RenderFlowThread* flowThread)1544 {1545 if (flowThread)1546 flowThread->setRegionRangeForBox(this, offsetFromLogicalTopOfFirstPage());1547 1525 } 1548 1526 … … 1592 1570 } 1593 1571 1572 bool RenderBlock::relayoutToAvoidWidows(LayoutStateMaintainer& statePusher) 1573 { 1574 if (!shouldBreakAtLineToAvoidWidow()) 1575 return false; 1576 1577 statePusher.pop(); 1578 setEverHadLayout(true); 1579 layoutBlock(false); 1580 return true; 1581 } 1582 1594 1583 void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight) 1595 1584 { … … 1626 1615 if (logicalWidthChangedInRegions(flowThread)) 1627 1616 relayoutChildren = true; 1628 if (update RegionsAndShapesBeforeChildLayout(flowThread))1617 if (updateShapesBeforeBlockLayout()) 1629 1618 relayoutChildren = true; 1630 1619 … … 1663 1652 setLogicalHeight(lowestFloatLogicalBottom() + toAdd); 1664 1653 1665 if (relayoutForPagination(hasSpecifiedPageLogicalHeight, pageLogicalHeight, statePusher)) 1666 return; 1654 if (relayoutForPagination(hasSpecifiedPageLogicalHeight, pageLogicalHeight, statePusher) || relayoutToAvoidWidows(statePusher)) { 1655 ASSERT(!shouldBreakAtLineToAvoidWidow()); 1656 return; 1657 } 1667 1658 1668 1659 // Calculate our new height. … … 1696 1687 layoutPositionedObjects(relayoutChildren || isRoot()); 1697 1688 1698 update RegionsAndShapesAfterChildLayout(flowThread,heightChanged);1689 updateShapesAfterBlockLayout(heightChanged); 1699 1690 1700 1691 // Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway). … … 2633 2624 // Go ahead and position the child as though it didn't collapse with the top. 2634 2625 setLogicalTopForChild(child, logicalTopEstimate, ApplyLayoutDelta); 2626 estimateRegionRangeForBoxChild(child); 2635 2627 2636 2628 RenderBlock* childRenderBlock = child->isRenderBlock() ? toRenderBlock(child) : 0; … … 2709 2701 } 2710 2702 2703 if (updateRegionRangeForBoxChild(child)) { 2704 child->setNeedsLayout(true, MarkOnlyThis); 2705 child->layoutIfNeeded(); 2706 } 2707 2711 2708 // We are no longer at the top of the block if we encounter a non-empty child. 2712 2709 // This has to be done after checking for clear, so that margins can be reset if a clear occurred. … … 2877 2874 for (TrackedRendererListHashSet::iterator it = positionedDescendants->begin(); it != end; ++it) { 2878 2875 r = *it; 2876 2877 estimateRegionRangeForBoxChild(r); 2879 2878 2880 2879 // A fixed position element with an absolute positioned ancestor has no way of knowing if the latter has changed position. So … … 2917 2916 oldLogicalTop = logicalTopForChild(r); 2918 2917 } 2919 2918 2920 2919 r->layoutIfNeeded(); 2921 2920 … … 2923 2922 if (needsBlockDirectionLocationSetBeforeLayout && logicalTopForChild(r) != oldLogicalTop) { 2924 2923 r->setChildNeedsLayout(true, MarkOnlyThis); 2924 r->layoutIfNeeded(); 2925 } 2926 2927 if (updateRegionRangeForBoxChild(r)) { 2928 r->setNeedsLayout(true, MarkOnlyThis); 2925 2929 r->layoutIfNeeded(); 2926 2930 } … … 2950 2954 return; 2951 2955 2952 if (view()->layoutState()->pageLogicalHeightChanged() || (view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(this, logicalTop()) != pageLogicalOffset()) || shouldBreakAtLineToAvoidWidow())2956 if (view()->layoutState()->pageLogicalHeightChanged() || (view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(this, logicalTop()) != pageLogicalOffset())) 2953 2957 setChildNeedsLayout(true, MarkOnlyThis); 2954 2958 } … … 4246 4250 4247 4251 RenderBox* childBox = floatingObject->renderer(); 4252 4248 4253 LayoutUnit childLogicalLeftMargin = style()->isLeftToRightDirection() ? marginStartForChild(childBox) : marginEndForChild(childBox); 4249 4254 … … 4261 4266 setLogicalLeftForChild(childBox, floatLogicalLocation.x() + childLogicalLeftMargin); 4262 4267 setLogicalTopForChild(childBox, floatLogicalLocation.y() + marginBeforeForChild(childBox)); 4268 4269 estimateRegionRangeForBoxChild(childBox); 4263 4270 4264 4271 LayoutState* layoutState = view()->layoutState(); … … 4294 4301 if (childBlock) 4295 4302 childBlock->setChildNeedsLayout(true, MarkOnlyThis); 4303 childBox->layoutIfNeeded(); 4304 } 4305 4306 if (updateRegionRangeForBoxChild(childBox)) { 4307 childBox->setNeedsLayout(true, MarkOnlyThis); 4296 4308 childBox->layoutIfNeeded(); 4297 4309 } … … 7232 7244 } 7233 7245 7234 void RenderBlock::setBreakAtLineToAvoidWidow( RootInlineBox*lineToBreak)7246 void RenderBlock::setBreakAtLineToAvoidWidow(int lineToBreak) 7235 7247 { 7236 7248 ASSERT(lineToBreak); … … 7246 7258 return; 7247 7259 m_rareData->m_shouldBreakAtLineToAvoidWidow = false; 7248 m_rareData->m_lineBreakToAvoidWidow = 0;7260 m_rareData->m_lineBreakToAvoidWidow = -1; 7249 7261 } 7250 7262 … … 7408 7420 // See if we're in the last region. 7409 7421 LayoutUnit pageOffset = offsetFromLogicalTopOfFirstPage() + logicalOffset; 7410 RenderRegion* region = flowThread->regionAtBlockOffset( pageOffset, this);7422 RenderRegion* region = flowThread->regionAtBlockOffset(this, pageOffset, this); 7411 7423 if (!region) 7412 7424 return false; … … 7463 7475 if (checkRegionBreaks) { 7464 7476 LayoutUnit offsetBreakAdjustment = 0; 7465 if (flowThread->addForcedRegionBreak( offsetFromLogicalTopOfFirstPage() + logicalOffset, child, true, &offsetBreakAdjustment))7477 if (flowThread->addForcedRegionBreak(this, offsetFromLogicalTopOfFirstPage() + logicalOffset, child, true, &offsetBreakAdjustment)) 7466 7478 return logicalOffset + offsetBreakAdjustment; 7467 7479 } … … 7490 7502 if (checkRegionBreaks) { 7491 7503 LayoutUnit offsetBreakAdjustment = 0; 7492 if (flowThread->addForcedRegionBreak( offsetFromLogicalTopOfFirstPage() + logicalOffset + marginOffset, child, false, &offsetBreakAdjustment))7504 if (flowThread->addForcedRegionBreak(this, offsetFromLogicalTopOfFirstPage() + logicalOffset + marginOffset, child, false, &offsetBreakAdjustment)) 7493 7505 return logicalOffset + marginOffset + offsetBreakAdjustment; 7494 7506 } … … 7589 7601 { 7590 7602 if (RenderFlowThread* flowThread = flowThreadContainingBlock()) 7591 flowThread->setPageBreak( offsetFromLogicalTopOfFirstPage() + offset, spaceShortage);7603 flowThread->setPageBreak(this, offsetFromLogicalTopOfFirstPage() + offset, spaceShortage); 7592 7604 } 7593 7605 … … 7595 7607 { 7596 7608 if (RenderFlowThread* flowThread = flowThreadContainingBlock()) 7597 flowThread->updateMinimumPageHeight( offsetFromLogicalTopOfFirstPage() + offset, minHeight);7609 flowThread->updateMinimumPageHeight(this, offsetFromLogicalTopOfFirstPage() + offset, minHeight); 7598 7610 else if (ColumnInfo* colInfo = view()->layoutState()->m_columnInfo) 7599 7611 colInfo->updateMinimumColumnHeight(minHeight); … … 7656 7668 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, ExcludePageBoundary); 7657 7669 7658 if (remainingLogicalHeight < lineHeight || (shouldBreakAtLineToAvoidWidow() && lineBreakToAvoidWidow() == lineBox)) { 7659 if (shouldBreakAtLineToAvoidWidow() && lineBreakToAvoidWidow() == lineBox) 7670 int lineIndex = lineCount(lineBox); 7671 if (remainingLogicalHeight < lineHeight || (shouldBreakAtLineToAvoidWidow() && lineBreakToAvoidWidow() == lineIndex)) { 7672 if (shouldBreakAtLineToAvoidWidow() && lineBreakToAvoidWidow() == lineIndex) 7660 7673 clearShouldBreakAtLineToAvoidWidow(); 7661 7674 // If we have a non-uniform page height, then we have to shift further possibly. … … 7669 7682 LayoutUnit pageLogicalHeightAtNewOffset = hasUniformPageLogicalHeight ? pageLogicalHeight : pageLogicalHeightForOffset(logicalOffset + remainingLogicalHeight); 7670 7683 setPageBreak(logicalOffset, lineHeight - remainingLogicalHeight); 7671 if (((lineBox == firstRootBox() && totalLogicalHeight < pageLogicalHeightAtNewOffset) || (!style()->hasAutoOrphans() && style()->orphans() >= line Count(lineBox)))7684 if (((lineBox == firstRootBox() && totalLogicalHeight < pageLogicalHeightAtNewOffset) || (!style()->hasAutoOrphans() && style()->orphans() >= lineIndex)) 7672 7685 && !isOutOfFlowPositioned() && !isTableCell()) 7673 7686 setPaginationStrut(remainingLogicalHeight + max<LayoutUnit>(0, logicalOffset)); … … 7801 7814 return 0; 7802 7815 7803 return flowThread->regionAtBlockOffset( offsetFromLogicalTopOfFirstPage() + blockOffset, true);7816 return flowThread->regionAtBlockOffset(this, offsetFromLogicalTopOfFirstPage() + blockOffset, true); 7804 7817 } 7805 7818 … … 7829 7842 } 7830 7843 7831 RenderRegion* RenderBlock::clampToStartAndEndRegions(RenderRegion* region) const7844 void RenderBlock::computeRegionRangeForBoxChild(const RenderBox* box) const 7832 7845 { 7833 7846 RenderFlowThread* flowThread = flowThreadContainingBlock(); 7834 7835 ASSERT(isRenderView() || (region && flowThread)); 7836 if (isRenderView()) 7837 return region; 7838 7839 // We need to clamp to the block, since we want any lines or blocks that overflow out of the 7840 // logical top or logical bottom of the block to size as though the border box in the first and 7841 // last regions extended infinitely. Otherwise the lines are going to size according to the regions 7842 // they overflow into, which makes no sense when this block doesn't exist in |region| at all. 7847 if (!flowThread || !flowThread->hasRegions()) 7848 return; 7849 7843 7850 RenderRegion* startRegion; 7844 7851 RenderRegion* endRegion; 7845 flowThread->getRegionRangeForBox(this, startRegion, endRegion); 7846 7847 if (startRegion && region->logicalTopForFlowThreadContent() < startRegion->logicalTopForFlowThreadContent()) 7848 return startRegion; 7849 if (endRegion && region->logicalTopForFlowThreadContent() > endRegion->logicalTopForFlowThreadContent()) 7850 return endRegion; 7851 7852 return region; 7852 LayoutUnit offsetFromLogicalTopOfFirstRegion = box->offsetFromLogicalTopOfFirstPage(); 7853 if (box->isUnsplittableForPagination()) 7854 startRegion = endRegion = flowThread->regionAtBlockOffset(this, offsetFromLogicalTopOfFirstRegion, true); 7855 else { 7856 startRegion = flowThread->regionAtBlockOffset(this, offsetFromLogicalTopOfFirstRegion, true); 7857 endRegion = flowThread->regionAtBlockOffset(this, offsetFromLogicalTopOfFirstRegion + logicalHeightForChild(box), true); 7858 } 7859 7860 flowThread->setRegionRangeForBox(box, startRegion, endRegion); 7861 } 7862 7863 void RenderBlock::estimateRegionRangeForBoxChild(const RenderBox* box) const 7864 { 7865 RenderFlowThread* flowThread = flowThreadContainingBlock(); 7866 if (!flowThread || !flowThread->hasRegions()) 7867 return; 7868 7869 if (box->isUnsplittableForPagination()) { 7870 computeRegionRangeForBoxChild(box); 7871 return; 7872 } 7873 7874 LogicalExtentComputedValues estimatedValues; 7875 box->computeLogicalHeight(RenderFlowThread::maxLogicalHeight(), logicalTopForChild(box), estimatedValues); 7876 7877 LayoutUnit offsetFromLogicalTopOfFirstRegion = box->offsetFromLogicalTopOfFirstPage(); 7878 RenderRegion* startRegion = flowThread->regionAtBlockOffset(this, offsetFromLogicalTopOfFirstRegion, true); 7879 RenderRegion* endRegion = flowThread->regionAtBlockOffset(this, offsetFromLogicalTopOfFirstRegion + estimatedValues.m_extent, true); 7880 7881 flowThread->setRegionRangeForBox(box, startRegion, endRegion); 7882 } 7883 7884 bool RenderBlock::updateRegionRangeForBoxChild(const RenderBox* box) const 7885 { 7886 RenderFlowThread* flowThread = flowThreadContainingBlock(); 7887 if (!flowThread || !flowThread->hasRegions()) 7888 return false; 7889 7890 RenderRegion* startRegion = 0; 7891 RenderRegion* endRegion = 0; 7892 flowThread->getRegionRangeForBox(box, startRegion, endRegion); 7893 7894 computeRegionRangeForBoxChild(box); 7895 7896 RenderRegion* newStartRegion = 0; 7897 RenderRegion* newEndRegion = 0; 7898 flowThread->getRegionRangeForBox(box, newStartRegion, newEndRegion); 7899 7900 // The region range of the box has changed. Some boxes (e.g floats) may have been positioned assuming 7901 // a different range. 7902 // FIXME: Be smarter about this. We don't need to relayout all the time. 7903 if (newStartRegion != startRegion || newEndRegion != endRegion) 7904 return true; 7905 7906 return false; 7853 7907 } 7854 7908 -
trunk/Source/WebCore/rendering/RenderBlock.h
r153380 r153990 327 327 bool shouldBreakAtLineToAvoidWidow() const { return m_rareData && m_rareData->m_shouldBreakAtLineToAvoidWidow; } 328 328 void clearShouldBreakAtLineToAvoidWidow() const; 329 RootInlineBox* lineBreakToAvoidWidow() const { return m_rareData ? m_rareData->m_lineBreakToAvoidWidow : 0; }330 void setBreakAtLineToAvoidWidow( RootInlineBox*);329 int lineBreakToAvoidWidow() const { return m_rareData ? m_rareData->m_lineBreakToAvoidWidow : -1; } 330 void setBreakAtLineToAvoidWidow(int); 331 331 332 332 // The page logical offset is the object's offset from the top of the page in the page progression … … 348 348 // Accessors for logical width/height and margins in the containing block's block-flow direction. 349 349 enum ApplyLayoutDeltaMode { ApplyLayoutDelta, DoNotApplyLayoutDelta }; 350 LayoutUnit logicalWidthForChild(const RenderBox* child) { return isHorizontalWritingMode() ? child->width() : child->height(); }351 LayoutUnit logicalHeightForChild(const RenderBox* child) { return isHorizontalWritingMode() ? child->height() : child->width(); }352 LayoutUnit logicalTopForChild(const RenderBox* child) { return isHorizontalWritingMode() ? child->y() : child->x(); }350 LayoutUnit logicalWidthForChild(const RenderBox* child) const { return isHorizontalWritingMode() ? child->width() : child->height(); } 351 LayoutUnit logicalHeightForChild(const RenderBox* child) const { return isHorizontalWritingMode() ? child->height() : child->width(); } 352 LayoutUnit logicalTopForChild(const RenderBox* child) const { return isHorizontalWritingMode() ? child->y() : child->x(); } 353 353 void setLogicalLeftForChild(RenderBox* child, LayoutUnit logicalLeft, ApplyLayoutDeltaMode = DoNotApplyLayoutDelta); 354 354 void setLogicalTopForChild(RenderBox* child, LayoutUnit logicalTop, ApplyLayoutDeltaMode = DoNotApplyLayoutDelta); … … 593 593 #endif 594 594 595 bool updateRegionsAndShapesBeforeChildLayout(RenderFlowThread*); 596 void updateRegionsAndShapesAfterChildLayout(RenderFlowThread*, bool heightChanged = false); 597 void computeRegionRangeForBlock(RenderFlowThread*); 595 bool updateShapesBeforeBlockLayout(); 596 void updateShapesAfterBlockLayout(bool heightChanged = false); 597 void computeRegionRangeForBoxChild(const RenderBox*) const; 598 599 void estimateRegionRangeForBoxChild(const RenderBox*) const; 600 bool updateRegionRangeForBoxChild(const RenderBox*) const; 598 601 599 602 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, RenderBox*); … … 653 656 // Called to lay out the legend for a fieldset or the ruby text of a ruby run. 654 657 virtual RenderObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/) { return 0; } 658 659 bool relayoutToAvoidWidows(LayoutStateMaintainer&); 655 660 656 661 void createFirstLetterRenderer(RenderObject* firstLetterBlock, RenderObject* currentChild); … … 1166 1171 virtual LayoutUnit offsetFromLogicalTopOfFirstPage() const; 1167 1172 RenderRegion* regionAtBlockOffset(LayoutUnit) const; 1168 RenderRegion* clampToStartAndEndRegions(RenderRegion*) const;1169 1173 1170 1174 protected: … … 1284 1288 , m_pageLogicalOffset(0) 1285 1289 , m_lineGridBox(0) 1286 , m_lineBreakToAvoidWidow( 0)1290 , m_lineBreakToAvoidWidow(-1) 1287 1291 , m_shouldBreakAtLineToAvoidWidow(false) 1288 1292 , m_discardMarginBefore(false) … … 1314 1318 RootInlineBox* m_lineGridBox; 1315 1319 1316 RootInlineBox*m_lineBreakToAvoidWidow;1320 int m_lineBreakToAvoidWidow; 1317 1321 #if ENABLE(CSS_SHAPES) 1318 1322 OwnPtr<ShapeInsideInfo> m_shapeInsideInfo; -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r153061 r153990 2012 2012 2013 2013 // We now want to break at this line. Remember for next layout and trigger relayout. 2014 setBreakAtLineToAvoidWidow(line Box);2014 setBreakAtLineToAvoidWidow(lineCount(lineBox)); 2015 2015 markLinesDirtyInBlockRange(lastRootBox()->lineBottomWithLeading(), lineBox->lineBottomWithLeading(), lineBox); 2016 2016 } … … 2150 2150 for (InlineWalker walker(this); !walker.atEnd(); walker.advance()) { 2151 2151 RenderObject* o = walker.current(); 2152 2152 2153 if (!hasInlineChild && o->isInline()) 2153 2154 hasInlineChild = true; -
trunk/Source/WebCore/rendering/RenderBox.cpp
r153701 r153990 109 109 } 110 110 111 RenderRegion* RenderBox::clampToStartAndEndRegions(RenderRegion* region) const 112 { 113 RenderFlowThread* flowThread = flowThreadContainingBlock(); 114 115 ASSERT(isRenderView() || (region && flowThread)); 116 if (isRenderView()) 117 return region; 118 119 // We need to clamp to the block, since we want any lines or blocks that overflow out of the 120 // logical top or logical bottom of the block to size as though the border box in the first and 121 // last regions extended infinitely. Otherwise the lines are going to size according to the regions 122 // they overflow into, which makes no sense when this block doesn't exist in |region| at all. 123 RenderRegion* startRegion = 0; 124 RenderRegion* endRegion = 0; 125 flowThread->getRegionRangeForBox(this, startRegion, endRegion); 126 127 if (startRegion && region->logicalTopForFlowThreadContent() < startRegion->logicalTopForFlowThreadContent()) 128 return startRegion; 129 if (endRegion && region->logicalTopForFlowThreadContent() > endRegion->logicalTopForFlowThreadContent()) 130 return endRegion; 131 132 return region; 133 } 134 111 135 LayoutRect RenderBox::borderBoxRectInRegion(RenderRegion* region, RenderBoxRegionInfoFlags cacheFlag) const 112 136 { 113 137 if (!region) 114 138 return borderBoxRect(); 115 139 140 RenderFlowThread* flowThread = flowThreadContainingBlock(); 141 if (!flowThread) 142 return borderBoxRect(); 143 144 RenderRegion* startRegion = 0; 145 RenderRegion* endRegion = 0; 146 flowThread->getRegionRangeForBox(this, startRegion, endRegion); 147 148 // FIXME: In a perfect world this condition should never happen. 149 if (!startRegion || !endRegion) 150 return borderBoxRect(); 151 152 // FIXME: Once overflow is implemented this assertion needs to be enabled. Right now the overflow content is painted 153 // in regions outside the box range so the assert is disabled. 154 // ASSERT(clampToStartAndEndRegions(region) == region); 155 156 // FIXME: Remove once boxes are painted inside their region range. 157 region = clampToStartAndEndRegions(region); 158 116 159 // Compute the logical width and placement in this region. 117 160 RenderBoxRegionInfo* boxInfo = renderBoxRegionInfo(region, cacheFlag); … … 2940 2983 LayoutUnit cbPageOffset = cb->offsetFromLogicalTopOfFirstPage(); 2941 2984 RenderRegion* cbRegion = cb->regionAtBlockOffset(cbPageOffset); 2942 if (cbRegion) { 2943 cbRegion = cb->clampToStartAndEndRegions(cbRegion); 2985 if (cbRegion) 2944 2986 boxInfo = cb->renderBoxRegionInfo(cbRegion); 2945 }2946 2987 } 2947 2988 } else if (region && flowThread->isHorizontalWritingMode() == containingBlock->isHorizontalWritingMode()) { … … 3187 3228 RenderRegion* cbRegion = cb->regionAtBlockOffset(cbPageOffset); 3188 3229 if (cbRegion) { 3189 cbRegion = cb->clampToStartAndEndRegions(cbRegion);3190 3230 RenderBoxRegionInfo* boxInfo = cb->renderBoxRegionInfo(cbRegion); 3191 3231 if (boxInfo) { … … 3506 3546 RenderRegion* cbRegion = cb->regionAtBlockOffset(cbPageOffset); 3507 3547 if (cbRegion) { 3508 cbRegion = cb->clampToStartAndEndRegions(cbRegion);3509 3548 RenderBoxRegionInfo* boxInfo = cb->renderBoxRegionInfo(cbRegion); 3510 3549 if (boxInfo) { -
trunk/Source/WebCore/rendering/RenderBox.h
r153380 r153990 369 369 enum RenderBoxRegionInfoFlags { CacheRenderBoxRegionInfo, DoNotCacheRenderBoxRegionInfo }; 370 370 LayoutRect borderBoxRectInRegion(RenderRegion*, RenderBoxRegionInfoFlags = CacheRenderBoxRegionInfo) const; 371 RenderRegion* clampToStartAndEndRegions(RenderRegion*) const; 371 372 void clearRenderBoxRegionInfo(); 372 373 virtual LayoutUnit offsetFromLogicalTopOfFirstPage() const; -
trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
r151997 r153990 306 306 if (logicalWidthChangedInRegions(flowThread)) 307 307 relayoutChildren = true; 308 if (update RegionsAndShapesBeforeChildLayout(flowThread))308 if (updateShapesBeforeBlockLayout()) 309 309 relayoutChildren = true; 310 310 … … 350 350 layoutPositionedObjects(relayoutChildren || isRoot()); 351 351 352 update RegionsAndShapesAfterChildLayout(flowThread);352 updateShapesAfterBlockLayout(); 353 353 354 354 if (!isFloatingOrOutOfFlowPositioned() && height() == 0) { -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r151997 r153990 343 343 if (logicalWidthChangedInRegions(flowThread)) 344 344 relayoutChildren = true; 345 if (update RegionsAndShapesBeforeChildLayout(flowThread))345 if (updateShapesBeforeBlockLayout()) 346 346 relayoutChildren = true; 347 347 … … 371 371 layoutPositionedObjects(relayoutChildren || isRoot()); 372 372 373 update RegionsAndShapesAfterChildLayout(flowThread);373 updateShapesAfterBlockLayout(); 374 374 375 375 repaintChildrenDuringLayoutIfMoved(oldChildRects); -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r153814 r153990 189 189 previousRegionLogicalWidth = regionLogicalWidth; 190 190 } 191 192 setRegionRangeForBox(this, m_regionList.first(), m_regionList.last()); 191 193 } 192 194 } … … 391 393 } 392 394 393 RenderRegion* RenderFlowThread::regionAtBlockOffset( LayoutUnit offset, bool extendLastRegion, RegionAutoGenerationPolicy autoGenerationPolicy)395 RenderRegion* RenderFlowThread::regionAtBlockOffset(const RenderBox* clampBox, LayoutUnit offset, bool extendLastRegion, RegionAutoGenerationPolicy autoGenerationPolicy) 394 396 { 395 397 ASSERT(!m_regionsInvalidated); … … 398 400 autoGenerateRegionsToBlockOffset(offset); 399 401 402 if (m_regionList.isEmpty()) 403 return 0; 404 400 405 if (offset <= 0) 401 return m_regionList.isEmpty() ? 0: m_regionList.first();406 return clampBox ? clampBox->clampToStartAndEndRegions(m_regionList.first()) : m_regionList.first(); 402 407 403 408 RegionSearchAdapter adapter(offset); … … 406 411 // If no region was found, the offset is in the flow thread overflow. 407 412 // The last region will contain the offset if extendLastRegion is set or if the last region is a set. 408 if (!adapter.result() && !m_regionList.isEmpty() && (extendLastRegion || m_regionList.last()->isRenderRegionSet())) 409 return m_regionList.last(); 410 411 return adapter.result(); 413 if (!adapter.result() && (extendLastRegion || m_regionList.last()->isRenderRegionSet())) 414 return clampBox ? clampBox->clampToStartAndEndRegions(m_regionList.last()) : m_regionList.last(); 415 416 RenderRegion* region = adapter.result(); 417 if (!clampBox) 418 return region; 419 return region ? clampBox->clampToStartAndEndRegions(region) : 0; 412 420 } 413 421 … … 416 424 LayoutPoint referencePoint = startPoint; 417 425 426 const RenderBlock* objContainingBlock = boxModelObject.containingBlock(); 418 427 // FIXME: This needs to be adapted for different writing modes inside the flow thread. 419 RenderRegion* startRegion = regionAtBlockOffset( referencePoint.y());428 RenderRegion* startRegion = regionAtBlockOffset(objContainingBlock, referencePoint.y()); 420 429 if (startRegion) { 421 430 // Take into account the offset coordinates of the region. … … 437 446 // and is no longer valid) and recompute it using the region in which it flows as reference. 438 447 bool wasComputedRelativeToOtherRegion = false; 439 const RenderBlock* objContainingBlock = boxModelObject.containingBlock();440 448 while (objContainingBlock && !objContainingBlock->isRenderNamedFlowThread()) { 441 449 // Check if this object is in a different region. … … 495 503 LayoutUnit RenderFlowThread::pageLogicalTopForOffset(LayoutUnit offset) 496 504 { 497 RenderRegion* region = regionAtBlockOffset( offset);505 RenderRegion* region = regionAtBlockOffset(0, offset, false, AllowRegionAutoGeneration); 498 506 return region ? region->pageLogicalTopForOffset(offset) : LayoutUnit(); 499 507 } … … 501 509 LayoutUnit RenderFlowThread::pageLogicalWidthForOffset(LayoutUnit offset) 502 510 { 503 RenderRegion* region = regionAtBlockOffset( offset, true);511 RenderRegion* region = regionAtBlockOffset(0, offset, true, AllowRegionAutoGeneration); 504 512 return region ? region->pageLogicalWidth() : contentLogicalWidth(); 505 513 } … … 507 515 LayoutUnit RenderFlowThread::pageLogicalHeightForOffset(LayoutUnit offset) 508 516 { 509 RenderRegion* region = regionAtBlockOffset( offset);517 RenderRegion* region = regionAtBlockOffset(0, offset, false, AllowRegionAutoGeneration); 510 518 if (!region) 511 519 return 0; … … 516 524 LayoutUnit RenderFlowThread::pageRemainingLogicalHeightForOffset(LayoutUnit offset, PageBoundaryRule pageBoundaryRule) 517 525 { 518 RenderRegion* region = regionAtBlockOffset( offset);526 RenderRegion* region = regionAtBlockOffset(0, offset, false, AllowRegionAutoGeneration); 519 527 if (!region) 520 528 return 0; … … 545 553 546 554 LayoutPoint center = boxRect.center(); 547 RenderRegion* renderRegion = const_cast<RenderFlowThread*>(this)->regionAtBlockOffset( isHorizontalWritingMode() ? center.y() : center.x(), true, DisallowRegionAutoGeneration);555 RenderRegion* renderRegion = const_cast<RenderFlowThread*>(this)->regionAtBlockOffset(this, isHorizontalWritingMode() ? center.y() : center.x(), true, DisallowRegionAutoGeneration); 548 556 if (!renderRegion) 549 557 return 0; … … 595 603 return false; 596 604 605 RenderRegionRangeMap::iterator it = m_regionRangeMap.find(block); 606 if (it == m_regionRangeMap.end()) 607 return false; 608 609 RenderRegionRange& range = it->value; 610 bool rangeInvalidated = range.rangeInvalidated(); 611 range.clearRangeInvalidated(); 612 597 613 RenderRegion* startRegion; 598 614 RenderRegion* endRegion; 599 615 getRegionRangeForBox(block, startRegion, endRegion); 600 616 601 // When the region chain is invalidated the box information is discarded so we must assume the width has changed.602 if (m_pageLogicalSizeChanged && !startRegion)603 return true;604 605 617 // Not necessary for the flow thread, since we already computed the correct info for it. 618 // If the regions have changed invalidate the children. 606 619 if (block == this) 607 return false;620 return m_pageLogicalSizeChanged; 608 621 609 622 for (RenderRegionList::iterator iter = m_regionList.find(startRegion); iter != m_regionList.end(); ++iter) { … … 611 624 ASSERT(!region->needsLayout() || region->isRenderRegionSet()); 612 625 626 // We have no information computed for this region so we need to do it. 613 627 OwnPtr<RenderBoxRegionInfo> oldInfo = region->takeRenderBoxRegionInfo(block); 614 628 if (!oldInfo) 615 continue;629 return rangeInvalidated; 616 630 617 631 LayoutUnit oldLogicalWidth = oldInfo->logicalWidth(); … … 665 679 } 666 680 667 void RenderFlowThread::clearRenderObjectCustomStyle(const RenderObject* object, 668 const RenderRegion* oldStartRegion, const RenderRegion* oldEndRegion, 669 const RenderRegion* newStartRegion, const RenderRegion* newEndRegion) 681 void RenderFlowThread::clearRenderObjectCustomStyle(const RenderObject* object) 670 682 { 671 683 // Clear the styles for the object in the regions. 672 // The styles are not cleared for the regions that are contained in both ranges. 684 // FIXME: Region styling is not computed only for the region range of the object so this is why we need to walk the whole chain. 685 for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) { 686 RenderRegion* region = *iter; 687 region->clearObjectStyleInRegion(object); 688 } 689 } 690 691 void RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle(const RenderBox* box, 692 const RenderRegion* newStartRegion, const RenderRegion* newEndRegion, 693 const RenderRegion* oldStartRegion, const RenderRegion* oldEndRegion) 694 { 695 ASSERT(newStartRegion && newEndRegion && oldStartRegion && oldEndRegion); 696 673 697 bool insideOldRegionRange = false; 674 698 bool insideNewRegionRange = false; … … 681 705 insideNewRegionRange = true; 682 706 683 if (!(insideOldRegionRange && insideNewRegionRange)) 684 region->clearObjectStyleInRegion(object); 707 if (!(insideOldRegionRange && insideNewRegionRange)) { 708 region->clearObjectStyleInRegion(box); 709 if (region->renderBoxRegionInfo(box)) 710 region->removeRenderBoxRegionInfo(box); 711 } 685 712 686 713 if (oldEndRegion == region) … … 691 718 } 692 719 693 void RenderFlowThread::setRegionRangeForBox(const RenderBox* box, LayoutUnit offsetFromLogicalTopOfFirstPage) 694 { 695 if (!hasRegions()) 696 return; 697 698 ASSERT(box->logicalHeight() >= 0); 699 700 // FIXME: Not right for differing writing-modes. 701 RenderRegion* startRegion = regionAtBlockOffset(offsetFromLogicalTopOfFirstPage, true); 702 RenderRegion* endRegion = regionAtBlockOffset(offsetFromLogicalTopOfFirstPage + box->logicalHeight(), true); 720 void RenderFlowThread::setRegionRangeForBox(const RenderBox* box, RenderRegion* startRegion, RenderRegion* endRegion) 721 { 722 ASSERT(hasRegions()); 723 ASSERT(startRegion && endRegion); 724 703 725 RenderRegionRangeMap::iterator it = m_regionRangeMap.find(box); 704 726 if (it == m_regionRangeMap.end()) { 705 727 m_regionRangeMap.set(box, RenderRegionRange(startRegion, endRegion)); 706 clearRenderObjectCustomStyle(box);707 728 return; 708 729 } … … 713 734 return; 714 735 715 // Delete any info that we find before our new startRegion and after our new endRegion. 716 for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) { 717 RenderRegion* region = *iter; 718 if (region == startRegion) { 719 iter = m_regionList.find(endRegion); 720 continue; 721 } 722 723 region->removeRenderBoxRegionInfo(box); 724 725 if (region == range.endRegion()) 726 break; 727 } 728 729 clearRenderObjectCustomStyle(box, range.startRegion(), range.endRegion(), startRegion, endRegion); 736 clearRenderBoxRegionInfoAndCustomStyle(box, startRegion, endRegion, range.startRegion(), range.endRegion()); 730 737 range.setRange(startRegion, endRegion); 731 738 } … … 749 756 // Simulate a region break at height. If it points inside an auto logical height region, 750 757 // then it may determine the region computed autoheight. 751 addForcedRegionBreak( clientHeight, this, false);758 addForcedRegionBreak(this, clientHeight, this, false); 752 759 } 753 760 … … 920 927 // it is possible that the break will occur at a different offset than the original one required. 921 928 // offsetBreakAdjustment measures the different between the requested break offset and the current break offset. 922 bool RenderFlowThread::addForcedRegionBreak( LayoutUnit offsetBreakInFlowThread, RenderObject* breakChild, bool isBefore, LayoutUnit* offsetBreakAdjustment)929 bool RenderFlowThread::addForcedRegionBreak(const RenderBlock* block, LayoutUnit offsetBreakInFlowThread, RenderObject* breakChild, bool isBefore, LayoutUnit* offsetBreakAdjustment) 923 930 { 924 931 // We take breaks into account for height computation for auto logical height regions … … 947 954 // Simulate a region break at offsetBreakInFlowThread. If it points inside an auto logical height region, 948 955 // then it determines the region computed auto height. 949 RenderRegion* region = regionAtBlockOffset( offsetBreakInFlowThread);956 RenderRegion* region = regionAtBlockOffset(block, offsetBreakInFlowThread); 950 957 if (!region) 951 958 return false; -
trunk/Source/WebCore/rendering/RenderFlowThread.h
r153814 r153990 104 104 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit, PageBoundaryRule = IncludePageBoundary); 105 105 106 virtual void setPageBreak( LayoutUnit /*offset*/, LayoutUnit /*spaceShortage*/) { }107 virtual void updateMinimumPageHeight( LayoutUnit /*offset*/, LayoutUnit /*minHeight*/) { }106 virtual void setPageBreak(const RenderBlock*, LayoutUnit /*offset*/, LayoutUnit /*spaceShortage*/) { } 107 virtual void updateMinimumPageHeight(const RenderBlock*, LayoutUnit /*offset*/, LayoutUnit /*minHeight*/) { } 108 108 109 109 enum RegionAutoGenerationPolicy { … … 111 111 DisallowRegionAutoGeneration, 112 112 }; 113 RenderRegion* regionAtBlockOffset(LayoutUnit, bool extendLastRegion = false, RegionAutoGenerationPolicy = AllowRegionAutoGeneration); 113 114 RenderRegion* regionAtBlockOffset(const RenderBox*, LayoutUnit, bool extendLastRegion = false, RegionAutoGenerationPolicy = AllowRegionAutoGeneration); 114 115 115 116 bool regionsHaveUniformLogicalWidth() const { return m_regionsHaveUniformLogicalWidth; } … … 131 132 void updatePreviousRegionCount() { m_previousRegionCount = m_regionList.size(); }; 132 133 133 void setRegionRangeForBox(const RenderBox*, LayoutUnit offsetFromLogicalTopOfFirstPage);134 void setRegionRangeForBox(const RenderBox*, RenderRegion*, RenderRegion*); 134 135 void getRegionRangeForBox(const RenderBox*, RenderRegion*& startRegion, RenderRegion*& endRegion) const; 135 136 136 void clearRenderObjectCustomStyle(const RenderObject*, 137 const RenderRegion* oldStartRegion = 0, const RenderRegion* oldEndRegion = 0, 138 const RenderRegion* newStartRegion = 0, const RenderRegion* newEndRegion = 0); 137 void clearRenderObjectCustomStyle(const RenderObject*); 139 138 140 139 // Check if the object is in region and the region is part of this flow thread. … … 144 143 void markRegionsForOverflowLayoutIfNeeded(); 145 144 146 bool addForcedRegionBreak( LayoutUnit, RenderObject* breakChild, bool isBefore, LayoutUnit* offsetBreakAdjustment = 0);145 bool addForcedRegionBreak(const RenderBlock*, LayoutUnit, RenderObject* breakChild, bool isBefore, LayoutUnit* offsetBreakAdjustment = 0); 147 146 void applyBreakAfterContent(LayoutUnit); 148 147 … … 179 178 void popFlowThreadLayoutState(); 180 179 LayoutUnit offsetFromLogicalTopOfFirstRegion(const RenderBlock*) const; 180 void clearRenderBoxRegionInfoAndCustomStyle(const RenderBox*, const RenderRegion*, const RenderRegion*, const RenderRegion*, const RenderRegion*); 181 181 182 182 // Used to estimate the maximum height of the flow thread. … … 238 238 m_startRegion = start; 239 239 m_endRegion = end; 240 m_rangeInvalidated = true; 240 241 } 241 242 242 243 RenderRegion* startRegion() const { return m_startRegion; } 243 244 RenderRegion* endRegion() const { return m_endRegion; } 245 bool rangeInvalidated() const { return m_rangeInvalidated; } 246 void clearRangeInvalidated() { m_rangeInvalidated = false; } 244 247 245 248 private: 246 249 RenderRegion* m_startRegion; 247 250 RenderRegion* m_endRegion; 251 bool m_rangeInvalidated; 248 252 }; 249 253 -
trunk/Source/WebCore/rendering/RenderGrid.cpp
r153748 r153990 154 154 if (logicalWidthChangedInRegions(flowThread)) 155 155 relayoutChildren = true; 156 if (update RegionsAndShapesBeforeChildLayout(flowThread))156 if (updateShapesBeforeBlockLayout()) 157 157 relayoutChildren = true; 158 158 … … 172 172 layoutPositionedObjects(relayoutChildren || isRoot()); 173 173 174 update RegionsAndShapesAfterChildLayout(flowThread);174 updateShapesAfterBlockLayout(); 175 175 176 176 computeOverflow(oldClientAfterEdge); -
trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp
r151545 r153990 105 105 } 106 106 107 void RenderMultiColumnFlowThread::setPageBreak( LayoutUnit offset, LayoutUnit spaceShortage)107 void RenderMultiColumnFlowThread::setPageBreak(const RenderBlock* block, LayoutUnit offset, LayoutUnit spaceShortage) 108 108 { 109 if (RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(regionAtBlockOffset( offset)))109 if (RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(regionAtBlockOffset(block, offset))) 110 110 multicolSet->recordSpaceShortage(spaceShortage); 111 111 } 112 112 113 void RenderMultiColumnFlowThread::updateMinimumPageHeight( LayoutUnit offset, LayoutUnit minHeight)113 void RenderMultiColumnFlowThread::updateMinimumPageHeight(const RenderBlock* block, LayoutUnit offset, LayoutUnit minHeight) 114 114 { 115 if (RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(regionAtBlockOffset( offset)))115 if (RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(regionAtBlockOffset(block, offset))) 116 116 multicolSet->updateMinimumColumnHeight(minHeight); 117 117 } -
trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.h
r153380 r153990 45 45 virtual void autoGenerateRegionsToBlockOffset(LayoutUnit) OVERRIDE; 46 46 virtual LayoutUnit initialLogicalWidth() const OVERRIDE; 47 virtual void setPageBreak( LayoutUnit offset, LayoutUnit spaceShortage) OVERRIDE;48 virtual void updateMinimumPageHeight( LayoutUnit offset, LayoutUnit minHeight) OVERRIDE;47 virtual void setPageBreak(const RenderBlock*, LayoutUnit offset, LayoutUnit spaceShortage) OVERRIDE; 48 virtual void updateMinimumPageHeight(const RenderBlock*, LayoutUnit offset, LayoutUnit minHeight) OVERRIDE; 49 49 }; 50 50
Note:
See TracChangeset
for help on using the changeset viewer.