Changeset 151237 in webkit
- Timestamp:
- Jun 5, 2013 2:25:27 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r151236 r151237 1 2013-06-05 Bear Travis <betravis@adobe.com> 2 3 [css exclusions] Clean up ExclusionShapeInsideInfo dynamic removal code 4 https://bugs.webkit.org/show_bug.cgi?id=116236 5 6 Reviewed by David Hyatt. 7 8 Instead of keeping the ExclusionShapeInsideInfo around after it has 9 become stale, we can immediately remove it and just mark descendants 10 for relayout. This patch removes most of the code added by 11 https://bugs.webkit.org/show_bug.cgi?id=111029 12 in favor of this simpler approach. 13 14 This patch does not introduce new functionality. 15 16 * rendering/ExclusionShapeInsideInfo.h: 17 (WebCore::ExclusionShapeInsideInfo::ExclusionShapeInsideInfo): 18 (ExclusionShapeInsideInfo): Remove needsRemoval code. 19 * rendering/LayoutState.cpp: 20 (WebCore::LayoutState::LayoutState): Ditto. 21 * rendering/RenderBlock.cpp: 22 (WebCore::RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange): Remove 23 needsRemoval code and mark descendants for layout. 24 (WebCore): 25 (WebCore::RenderBlock::markShapeInsideDescendantsForLayout): Method to mark 26 descendants of a shape inside with inline content for layout. 27 (WebCore::exclusionInfoRequiresRelayout): Remove needsRemoval code. 28 (WebCore::RenderBlock::updateRegionsAndExclusionsAfterChildLayout): Ditto. 29 * rendering/RenderBlock.h: 30 (WebCore::RenderBlock::exclusionShapeInsideInfo): Ditto. 31 (RenderBlock): 32 * rendering/RenderBlockLineLayout.cpp: 33 (WebCore::RenderBlock::layoutExclusionShapeInsideInfo): Ditto. 34 1 35 2013-06-05 Arunprasad Rajkumar <arurajku@cisco.com> 2 36 -
trunk/Source/WebCore/rendering/ExclusionShapeInsideInfo.h
r149226 r151237 71 71 virtual bool computeSegmentsForLine(LayoutUnit lineTop, LayoutUnit lineHeight) OVERRIDE 72 72 { 73 ASSERT(!needsRemoval());74 73 m_segmentRanges.clear(); 75 74 return ExclusionShapeInfo<RenderBlock, &RenderStyle::resolvedShapeInside, &ExclusionShape::getIncludedIntervals>::computeSegmentsForLine(lineTop, lineHeight); … … 99 98 bool needsLayout() { return m_needsLayout; } 100 99 101 void setNeedsRemoval(bool value) { m_needsRemoval = value; }102 bool needsRemoval() { return m_needsRemoval; }103 104 100 protected: 105 101 virtual LayoutRect computedShapeLogicalBoundingBox() const OVERRIDE { return computedShape()->shapePaddingLogicalBoundingBox(); } … … 109 105 : ExclusionShapeInfo<RenderBlock, &RenderStyle::resolvedShapeInside, &ExclusionShape::getIncludedIntervals> (renderer) 110 106 , m_needsLayout(false) 111 , m_needsRemoval(false)112 107 { } 113 108 114 109 SegmentRangeList m_segmentRanges; 115 110 bool m_needsLayout:1; 116 bool m_needsRemoval:1;117 111 }; 118 112 -
trunk/Source/WebCore/rendering/LayoutState.cpp
r147758 r151237 114 114 if (renderer->isRenderBlock()) { 115 115 const RenderBlock* renderBlock = toRenderBlock(renderer); 116 m_exclusionShapeInsideInfo = renderBlock->exclusionShapeInsideInfo(RenderBlock::ShapePresentOrRemoved); 117 if (m_next->m_exclusionShapeInsideInfo && renderBlock->allowsExclusionShapeInsideInfoSharing()) { 118 if (!m_exclusionShapeInsideInfo) 119 m_exclusionShapeInsideInfo = m_next->m_exclusionShapeInsideInfo; 120 else if (m_exclusionShapeInsideInfo->needsRemoval()) { 121 m_exclusionShapeInsideInfo = m_next->m_exclusionShapeInsideInfo; 122 m_exclusionShapeInsideInfo->setNeedsLayout(true); 123 } 124 } 116 m_exclusionShapeInsideInfo = renderBlock->exclusionShapeInsideInfo(); 117 if (!m_exclusionShapeInsideInfo && m_next->m_exclusionShapeInsideInfo && renderBlock->allowsExclusionShapeInsideInfoSharing()) 118 m_exclusionShapeInsideInfo = m_next->m_exclusionShapeInsideInfo; 125 119 } 126 120 #endif -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r151178 r151237 1447 1447 return; 1448 1448 1449 ExclusionShapeInsideInfo* exclusionShapeInsideInfo;1450 1449 if (shapeInside) { 1451 exclusionShapeInsideInfo = ensureExclusionShapeInsideInfo();1450 ExclusionShapeInsideInfo* exclusionShapeInsideInfo = ensureExclusionShapeInsideInfo(); 1452 1451 exclusionShapeInsideInfo->dirtyShapeSize(); 1453 exclusionShapeInsideInfo->setNeedsRemoval(false); 1454 } else if ((exclusionShapeInsideInfo = this->exclusionShapeInsideInfo(ShapePresentOrRemoved))) 1455 exclusionShapeInsideInfo->setNeedsRemoval(true); 1452 } else { 1453 setExclusionShapeInsideInfo(nullptr); 1454 markShapeInsideDescendantsForLayout(); 1455 } 1456 } 1457 1458 void RenderBlock::markShapeInsideDescendantsForLayout() 1459 { 1460 if (!everHadLayout()) 1461 return; 1462 if (childrenInline()) { 1463 setNeedsLayout(true); 1464 return; 1465 } 1466 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 1467 if (!child->isRenderBlock()) 1468 continue; 1469 RenderBlock* childBlock = toRenderBlock(child); 1470 childBlock->markShapeInsideDescendantsForLayout(); 1471 } 1456 1472 } 1457 1473 #endif … … 1462 1478 return false; 1463 1479 #else 1464 ExclusionShapeInsideInfo* info = block->exclusionShapeInsideInfo( RenderBlock::ShapePresentOrRemoved);1480 ExclusionShapeInsideInfo* info = block->exclusionShapeInsideInfo(); 1465 1481 if (info) 1466 info->setNeedsLayout(info->shapeSizeDirty() || info->needsRemoval());1482 info->setNeedsLayout(info->shapeSizeDirty()); 1467 1483 else 1468 info = block->layoutExclusionShapeInsideInfo( RenderBlock::ShapePresentOrRemoved);1484 info = block->layoutExclusionShapeInsideInfo(); 1469 1485 return info && info->needsLayout(); 1470 1486 #endif … … 1516 1532 { 1517 1533 #if ENABLE(CSS_EXCLUSIONS) 1518 ExclusionShapeInsideInfo* exclusionShapeInsideInfo = this->exclusionShapeInsideInfo(ShapePresentOrRemoved);1519 if (exclusionShapeInsideInfo && exclusionShapeInsideInfo->needsRemoval())1520 setExclusionShapeInsideInfo(nullptr);1521 1522 1534 // A previous sibling has changed dimension, so we need to relayout the shape with the content 1523 1535 ExclusionShapeInsideInfo* shapeInsideInfo = layoutExclusionShapeInsideInfo(); -
trunk/Source/WebCore/rendering/RenderBlock.h
r151178 r151237 454 454 } 455 455 456 enum ExclusionShapeStatus { ShapePresent, ShapePresentOrRemoved }; 457 ExclusionShapeInsideInfo* exclusionShapeInsideInfo(ExclusionShapeStatus exclusionShapeStatus = ShapePresent) const 456 ExclusionShapeInsideInfo* exclusionShapeInsideInfo() const 458 457 { 459 458 if (!m_rareData || !m_rareData->m_shapeInsideInfo) 460 459 return 0; 461 return ExclusionShapeInsideInfo::isEnabledFor(this) || (exclusionShapeStatus == ShapePresentOrRemoved)? m_rareData->m_shapeInsideInfo.get() : 0;460 return ExclusionShapeInsideInfo::isEnabledFor(this) ? m_rareData->m_shapeInsideInfo.get() : 0; 462 461 } 463 462 void setExclusionShapeInsideInfo(PassOwnPtr<ExclusionShapeInsideInfo> value) … … 467 466 m_rareData->m_shapeInsideInfo = value; 468 467 } 469 ExclusionShapeInsideInfo* layoutExclusionShapeInsideInfo(ExclusionShapeStatus = ShapePresent) const; 468 void markShapeInsideDescendantsForLayout(); 469 ExclusionShapeInsideInfo* layoutExclusionShapeInsideInfo() const; 470 470 bool allowsExclusionShapeInsideInfoSharing() const { return !isInline() && !isFloating(); } 471 471 #endif -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r150642 r151237 78 78 79 79 #if ENABLE(CSS_EXCLUSIONS) 80 ExclusionShapeInsideInfo* RenderBlock::layoutExclusionShapeInsideInfo( ExclusionShapeStatus exclusionShapeStatus) const80 ExclusionShapeInsideInfo* RenderBlock::layoutExclusionShapeInsideInfo() const 81 81 { 82 82 ExclusionShapeInsideInfo* shapeInsideInfo = view()->layoutState()->exclusionShapeInsideInfo(); 83 if (shapeInsideInfo && shapeInsideInfo->needsRemoval() && exclusionShapeStatus == ShapePresent)84 shapeInsideInfo = 0;85 83 86 84 if (!shapeInsideInfo && flowThreadContainingBlock() && allowsExclusionShapeInsideInfoSharing()) { … … 90 88 if (region) 91 89 shapeInsideInfo = region->exclusionShapeInsideInfo(); 92 return shapeInsideInfo && shapeInsideInfo->needsRemoval() && exclusionShapeStatus == ShapePresent ? 0 : shapeInsideInfo;93 90 } 94 91
Note: See TracChangeset
for help on using the changeset viewer.