Chromium Code Reviews| Index: Source/core/rendering/RenderBlock.cpp |
| diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp |
| index a23bfbb8af6da719c0329019d101c1b0f6ab86d1..0390961945550a46224dc8d6c338943535bda0ad 100644 |
| --- a/Source/core/rendering/RenderBlock.cpp |
| +++ b/Source/core/rendering/RenderBlock.cpp |
| @@ -86,7 +86,6 @@ struct SameSizeAsRenderBlock : public RenderBox { |
| struct SameSizeAsRenderBlockRareData { |
| int paginationStrut; |
| int pageLogicalOffset; |
| - void* pointers[1]; |
| uint32_t bitfields; |
| }; |
| @@ -327,8 +326,6 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty |
| RenderStyle* newStyle = style(); |
| - updateShapeInsideInfoAfterStyleChange(newStyle->resolvedShapeInside(), oldStyle ? oldStyle->resolvedShapeInside() : RenderStyle::initialShapeInside()); |
| - |
| if (!isAnonymousBlock()) { |
| // Ensure that all of our continuation blocks pick up the new style. |
| for (RenderBlock* currCont = blockElementContinuation(); currCont; currCont = currCont->blockElementContinuation()) { |
| @@ -1326,36 +1323,6 @@ bool RenderBlock::updateImageLoadingPriorities() |
| return true; |
| } |
| -void RenderBlock::relayoutShapeDescendantIfMoved(RenderBlock* child, LayoutSize offset) |
| -{ |
| - LayoutUnit left = isHorizontalWritingMode() ? offset.width() : offset.height(); |
| - if (!left || !child || child->shapeInsideInfo() || !layoutShapeInsideInfo()) |
| - return; |
| - // Propagate layout markers only up to the child, as we are still in the middle |
| - // of a layout pass |
| - child->setNormalChildNeedsLayout(true); |
| - child->markShapeInsideDescendantsForLayout(); |
| - child->layoutIfNeeded(); |
| -} |
| - |
| -ShapeInsideInfo* RenderBlock::layoutShapeInsideInfo() const |
| -{ |
| - if (ShapeInsideInfo* shapeInsideInfo = view()->layoutState()->shapeInsideInfo()) |
| - return shapeInsideInfo; |
| - |
| - RenderFlowThread* flowThread = flowThreadContainingBlock(); |
| - if (allowsShapeInsideInfoSharing(flowThread)) { |
| - LayoutUnit lineHeight = this->lineHeight(false, isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes); |
| - // regionAtBlockOffset returns regions like an array first={0,N-1}, second={N,M-1}, ... |
| - LayoutUnit offset = logicalHeight() + lineHeight - LayoutUnit(1); |
| - RenderRegion* region = regionAtBlockOffset(offset); |
| - if (region && region->logicalHeight()) |
| - return region->shapeInsideInfo(); |
| - } |
| - |
| - return 0; |
| -} |
| - |
| LayoutSize RenderBlock::logicalOffsetFromShapeAncestorContainer(const RenderBlock* container) const |
| { |
| const RenderBlock* currentBlock = this; |
| @@ -1394,44 +1361,12 @@ void RenderBlock::imageChanged(WrappedImagePtr image, const IntRect*) |
| if (!parent() || !everHadLayout()) |
| return; |
| - |
| - ShapeValue* shapeValue = style()->shapeInside(); |
| - if (shapeValue && shapeValue->image() && shapeValue->image()->data() == image) { |
| - ShapeInsideInfo& shapeInsideInfo = ensureShapeInsideInfo(); |
| - shapeInsideInfo.markShapeAsDirty(); |
| - markShapeInsideDescendantsForLayout(); |
| - } |
| -} |
| - |
| -void RenderBlock::updateShapeInsideInfoAfterStyleChange(const ShapeValue* shapeInside, const ShapeValue* oldShapeInside) |
| -{ |
| - // FIXME: A future optimization would do a deep comparison for equality. |
| - if (shapeInside == oldShapeInside) |
| - return; |
| - |
| - if (shapeInside) { |
| - ShapeInsideInfo& shapeInsideInfo = ensureShapeInsideInfo(); |
| - shapeInsideInfo.markShapeAsDirty(); |
| - } else { |
| - setShapeInsideInfo(nullptr); |
| - markShapeInsideDescendantsForLayout(); |
| - } |
| -} |
| - |
| -static inline bool shapeInfoRequiresRelayout(const RenderBlock* block) |
| -{ |
| - ShapeInsideInfo* info = block->shapeInsideInfo(); |
| - if (info) |
| - info->setNeedsLayout(info->isShapeDirty()); |
| - else |
| - info = block->layoutShapeInsideInfo(); |
| - return info && info->needsLayout(); |
| } |
| bool RenderBlock::updateRegionsAndShapesLogicalSize(RenderFlowThread* flowThread) |
|
Zoltan
2014/03/26 21:01:09
We could probably remove this function, since no t
|
| { |
| - if (!flowThread && !shapeInsideInfo()) |
| - return shapeInfoRequiresRelayout(this); |
| + if (!flowThread) |
| + return false; |
| LayoutUnit oldHeight = logicalHeight(); |
| LayoutUnit oldTop = logicalTop(); |
| @@ -1441,8 +1376,6 @@ bool RenderBlock::updateRegionsAndShapesLogicalSize(RenderFlowThread* flowThread |
| setLogicalHeight(RenderFlowThread::maxLogicalHeight()); |
| updateLogicalHeight(); |
| - computeShapeSize(); |
| - |
| // Set our start and end regions. No regions above or below us will be considered by our children. They are |
| // effectively clamped to our region range. |
| computeRegionRangeForBlock(flowThread); |
| @@ -1450,26 +1383,11 @@ bool RenderBlock::updateRegionsAndShapesLogicalSize(RenderFlowThread* flowThread |
| setLogicalHeight(oldHeight); |
| setLogicalTop(oldTop); |
| - return shapeInfoRequiresRelayout(this); |
| -} |
| - |
| -void RenderBlock::computeShapeSize() |
| -{ |
| - ShapeInsideInfo* shapeInsideInfo = this->shapeInsideInfo(); |
| - if (!shapeInsideInfo) |
| - return; |
| - |
| - bool percentageLogicalHeightResolvable = percentageLogicalHeightIsResolvableFromBlock(this, false); |
| - shapeInsideInfo->setReferenceBoxLogicalSize(LayoutSize(logicalWidth(), percentageLogicalHeightResolvable ? logicalHeight() : LayoutUnit())); |
| + return false; |
| } |
| void RenderBlock::updateRegionsAndShapesAfterChildLayout(RenderFlowThread* flowThread, bool heightChanged) |
| { |
| - // A previous sibling has changed dimension, so we need to relayout the shape with the content |
| - ShapeInsideInfo* shapeInsideInfo = layoutShapeInsideInfo(); |
| - if (heightChanged && shapeInsideInfo) |
| - shapeInsideInfo->markShapeAsDirty(); |
| - |
| computeRegionRangeForBlock(flowThread); |
| } |
| @@ -2825,22 +2743,6 @@ bool RenderBlock::avoidsFloats() const |
| return RenderBox::avoidsFloats() || !style()->hasAutoColumnCount() || !style()->hasAutoColumnWidth(); |
| } |
| -void RenderBlock::markShapeInsideDescendantsForLayout() |
| -{ |
| - if (!everHadLayout()) |
| - return; |
| - if (childrenInline()) { |
| - setNeedsLayout(); |
| - return; |
| - } |
| - for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { |
| - if (!child->isRenderBlock()) |
| - continue; |
| - RenderBlock* childBlock = toRenderBlock(child); |
| - childBlock->markShapeInsideDescendantsForLayout(); |
| - } |
| -} |
| - |
| bool RenderBlock::isPointInOverflowControl(HitTestResult& result, const LayoutPoint& locationInContainer, const LayoutPoint& accumulatedOffset) |
| { |
| if (!scrollsOverflow()) |