Changeset 144487 in webkit
- Timestamp:
- Mar 1, 2013 1:02:16 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r144485 r144487 1 2013-03-01 Bear Travis <betravis@adobe.com> 2 3 [css exclusions] setting shape-inside on a parent does not relayout child blocks' inline content 4 https://bugs.webkit.org/show_bug.cgi?id=108128 5 6 Reviewed by David Hyatt. 7 8 Test that setting and resetting shape-inside and shape-outside correctly lay out 9 content inside of child blocks. 10 11 * fast/exclusions/shape-inside/shape-inside-dynamic-nested-expected.html: Added. 12 * fast/exclusions/shape-inside/shape-inside-dynamic-nested.html: Added. 13 1 14 2013-03-01 Uday Kiran <udaykiran@motorola.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r144485 r144487 1 2013-03-01 Bear Travis <betravis@adobe.com> 2 3 [css exclusions] setting shape-inside on a parent does not relayout child blocks' inline content 4 https://bugs.webkit.org/show_bug.cgi?id=108128 5 6 Reviewed by David Hyatt. 7 8 Ensure that blocks lay out when their parent's shape-inside changes. 9 ExclusionShapeInsideInfo now stores an additional flag indicating whether 10 the shape has changed and its block's children require layout. Each block 11 can look up the flag via LayoutState to determine whether it needs to lay 12 out its children. 13 14 Test: fast/exclusions/shape-inside/shape-inside-dynamic-nested.html 15 16 * rendering/ExclusionShapeInfo.h: 17 (WebCore::ExclusionShapeInfo::shapeSizeDirty): Add a method to determine 18 if the shape has changed. 19 (ExclusionShapeInfo): 20 * rendering/ExclusionShapeInsideInfo.h: 21 (WebCore::ExclusionShapeInsideInfo::setNeedsLayout): Set the flag indicating 22 layout is necessary. 23 (WebCore::ExclusionShapeInsideInfo::needsLayout): Retrieve the layout flag. 24 (ExclusionShapeInsideInfo): 25 (WebCore::ExclusionShapeInsideInfo::ExclusionShapeInsideInfo): Initialize 26 the layout flag. 27 * rendering/RenderBlock.cpp: 28 (WebCore::exclusionInfoRequiresRelayout): Return true if the shape info should 29 cause a relayout. Also update the needsLayout flag on the ExclusionShapeInsideInfo. 30 (WebCore): 31 (WebCore::RenderBlock::updateRegionsAndExclusionsLogicalSize): Return a boolean 32 indicating whether regions or exclusions updates should cause a relayout. 33 (WebCore::RenderBlock::layoutBlock): Relayout children if the shape inside has 34 changed. 35 * rendering/RenderBlock.h: 36 (RenderBlock): 37 * rendering/RenderBlockLineLayout.cpp: 38 (WebCore::RenderBlock::layoutExclusionShapeInsideInfo): Changing to be a 39 class method. 40 (WebCore::LineWidth::LineWidth): Changing to use class method. 41 (WebCore::RenderBlock::computeInlineDirectionPositionsForLine): Ditto. 42 (WebCore::constructBidiRunsForLine): Ditto. 43 (WebCore::RenderBlock::layoutRunsAndFloatsInRange): Ditto. 44 (WebCore::RenderBlock::LineBreaker::nextLineBreak): Ditto. 45 1 46 2013-03-01 Uday Kiran <udaykiran@motorola.com> 2 47 -
trunk/Source/WebCore/rendering/ExclusionShapeInfo.h
r143766 r144487 93 93 94 94 void dirtyShapeSize() { m_shape.clear(); } 95 bool shapeSizeDirty() { return !m_shape.get(); } 95 96 const RenderType* owner() const { return m_renderer; } 96 97 -
trunk/Source/WebCore/rendering/ExclusionShapeInsideInfo.h
r143420 r144487 87 87 LayoutUnit logicalLineBottom() const { return m_shapeLineTop + m_lineHeight + logicalTopOffset(); } 88 88 89 void setNeedsLayout(bool value) { m_needsLayout = value; } 90 bool needsLayout() { return m_needsLayout; } 91 89 92 private: 90 ExclusionShapeInsideInfo(const RenderBlock* renderer) : ExclusionShapeInfo<RenderBlock, &RenderStyle::resolvedShapeInside>(renderer) { } 93 ExclusionShapeInsideInfo(const RenderBlock* renderer) 94 : ExclusionShapeInfo<RenderBlock, &RenderStyle::resolvedShapeInside> (renderer) 95 , m_needsLayout(false) 96 { } 91 97 92 98 LayoutUnit m_shapeLineTop; … … 95 101 SegmentList m_segments; 96 102 SegmentRangeList m_segmentRanges; 103 bool m_needsLayout; 97 104 }; 98 105 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r144461 r144487 1415 1415 #endif 1416 1416 1417 void RenderBlock::updateRegionsAndExclusionsLogicalSize() 1417 static inline bool exclusionInfoRequiresRelayout(const RenderBlock* block) 1418 { 1419 #if !ENABLE(CSS_EXCLUSIONS) 1420 return false; 1421 #else 1422 ExclusionShapeInsideInfo* info = block->exclusionShapeInsideInfo(); 1423 if (info) 1424 info->setNeedsLayout(info->shapeSizeDirty()); 1425 else 1426 info = block->layoutExclusionShapeInsideInfo(); 1427 return info && info->needsLayout(); 1428 #endif 1429 } 1430 1431 bool RenderBlock::updateRegionsAndExclusionsLogicalSize() 1418 1432 { 1419 1433 #if ENABLE(CSS_EXCLUSIONS) … … 1422 1436 if (!inRenderFlowThread()) 1423 1437 #endif 1424 return ;1438 return exclusionInfoRequiresRelayout(this); 1425 1439 1426 1440 LayoutUnit oldHeight = logicalHeight(); … … 1442 1456 setLogicalHeight(oldHeight); 1443 1457 setLogicalTop(oldTop); 1458 1459 return exclusionInfoRequiresRelayout(this); 1444 1460 } 1445 1461 … … 1540 1556 relayoutChildren = true; 1541 1557 } 1542 updateRegionsAndExclusionsLogicalSize(); 1558 1559 if (updateRegionsAndExclusionsLogicalSize()) 1560 relayoutChildren = true; 1543 1561 1544 1562 // We use four values, maxTopPos, maxTopNeg, maxBottomPos, and maxBottomNeg, to track -
trunk/Source/WebCore/rendering/RenderBlock.h
r144364 r144487 448 448 #if ENABLE(CSS_EXCLUSIONS) 449 449 ExclusionShapeInsideInfo* exclusionShapeInsideInfo() const; 450 ExclusionShapeInsideInfo* layoutExclusionShapeInsideInfo() const; 450 451 bool allowsExclusionShapeInsideInfoSharing() const { return !isInline() && !isFloating(); } 451 452 #endif … … 558 559 #endif 559 560 560 voidupdateRegionsAndExclusionsLogicalSize();561 bool updateRegionsAndExclusionsLogicalSize(); 561 562 void computeRegionRangeForBlock(); 562 563 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r144073 r144487 78 78 79 79 #if ENABLE(CSS_EXCLUSIONS) 80 static inline ExclusionShapeInsideInfo* layoutExclusionShapeInsideInfo(const RenderBlock* block) 81 { 82 ExclusionShapeInsideInfo* shapeInsideInfo = block->view()->layoutState()->exclusionShapeInsideInfo();83 if (!shapeInsideInfo && block->inRenderFlowThread()) {84 LayoutUnit offset = block->logicalHeight() + logicalHeightForLine(block, false);85 RenderRegion* region = block->regionAtBlockOffset(offset);80 ExclusionShapeInsideInfo* RenderBlock::layoutExclusionShapeInsideInfo() const 81 { 82 ExclusionShapeInsideInfo* shapeInsideInfo = view()->layoutState()->exclusionShapeInsideInfo(); 83 if (!shapeInsideInfo && inRenderFlowThread()) { 84 LayoutUnit offset = logicalHeight() + logicalHeightForLine(this, false); 85 RenderRegion* region = regionAtBlockOffset(offset); 86 86 return region ? region->exclusionShapeInsideInfo() : 0; 87 87 } … … 107 107 ASSERT(block); 108 108 #if ENABLE(CSS_EXCLUSIONS) 109 ExclusionShapeInsideInfo* exclusionShapeInsideInfo = layoutExclusionShapeInsideInfo(m_block);109 ExclusionShapeInsideInfo* exclusionShapeInsideInfo = m_block->layoutExclusionShapeInsideInfo(); 110 110 if (exclusionShapeInsideInfo) 111 111 m_segment = exclusionShapeInsideInfo->currentSegment(); … … 952 952 bool needsWordSpacing; 953 953 #if ENABLE(CSS_EXCLUSIONS) 954 ExclusionShapeInsideInfo* exclusionShapeInsideInfo = layoutExclusionShapeInsideInfo( this);954 ExclusionShapeInsideInfo* exclusionShapeInsideInfo = layoutExclusionShapeInsideInfo(); 955 955 if (exclusionShapeInsideInfo && exclusionShapeInsideInfo->hasSegments()) { 956 956 BidiRun* segmentStart = firstRun; … … 1275 1275 constructBidiRunsForSegment(topResolver, bidiRuns, endOfLine, override, previousLineBrokeCleanly); 1276 1276 #else 1277 ExclusionShapeInsideInfo* exclusionShapeInsideInfo = layoutExclusionShapeInsideInfo(block);1277 ExclusionShapeInsideInfo* exclusionShapeInsideInfo = block->layoutExclusionShapeInsideInfo(); 1278 1278 if (!exclusionShapeInsideInfo || !exclusionShapeInsideInfo->hasSegments()) { 1279 1279 constructBidiRunsForSegment(topResolver, bidiRuns, endOfLine, override, previousLineBrokeCleanly); … … 1541 1541 #if ENABLE(CSS_EXCLUSIONS) 1542 1542 LayoutUnit absoluteLogicalTop; 1543 ExclusionShapeInsideInfo* exclusionShapeInsideInfo = layoutExclusionShapeInsideInfo( this);1543 ExclusionShapeInsideInfo* exclusionShapeInsideInfo = layoutExclusionShapeInsideInfo(); 1544 1544 if (exclusionShapeInsideInfo) { 1545 1545 ASSERT(exclusionShapeInsideInfo->owner() == this || allowsExclusionShapeInsideInfoSharing()); … … 1577 1577 // case these segments may be incorrect. 1578 1578 if (inRenderFlowThread()) 1579 exclusionShapeInsideInfo = layoutExclusionShapeInsideInfo( this);1579 exclusionShapeInsideInfo = layoutExclusionShapeInsideInfo(); 1580 1580 if (exclusionShapeInsideInfo) { 1581 1581 LayoutUnit lineTop = logicalHeight() + absoluteLogicalTop; … … 2542 2542 return nextSegmentBreak(resolver, lineInfo, renderTextInfo, lastFloatFromPreviousLine, consecutiveHyphenatedLines, wordMeasurements); 2543 2543 #else 2544 ExclusionShapeInsideInfo* exclusionShapeInsideInfo = layoutExclusionShapeInsideInfo(m_block);2544 ExclusionShapeInsideInfo* exclusionShapeInsideInfo = m_block->layoutExclusionShapeInsideInfo(); 2545 2545 if (!exclusionShapeInsideInfo || !exclusionShapeInsideInfo->hasSegments()) 2546 2546 return nextSegmentBreak(resolver, lineInfo, renderTextInfo, lastFloatFromPreviousLine, consecutiveHyphenatedLines, wordMeasurements);
Note: See TracChangeset
for help on using the changeset viewer.