Chromium Code Reviews| Index: Source/core/rendering/RenderBlock.cpp |
| diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp |
| index 70c60e9846b4032b9f27448991f88ffa7204c76d..03ccbfdbb40f541bb1e86512d9b3d2d30c480643 100644 |
| --- a/Source/core/rendering/RenderBlock.cpp |
| +++ b/Source/core/rendering/RenderBlock.cpp |
| @@ -360,19 +360,21 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty |
| ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRenderObject(this); |
| } |
| -void RenderBlock::invalidateTreeAfterLayout(const RenderLayerModelObject& invalidationContainer) |
| +void RenderBlock::invalidateTreeAfterLayout(const InvalidationTreeWalkState& invalidationTreeWalkState) |
| { |
| // Note, we don't want to early out here using shouldCheckForInvalidationAfterLayout as |
| // we have to make sure we go through any positioned objects as they won't be seen in |
| // the normal tree walk. |
| if (shouldCheckForPaintInvalidationAfterLayout()) |
| - RenderBox::invalidateTreeAfterLayout(invalidationContainer); |
| + RenderBox::invalidateTreeAfterLayout(invalidationTreeWalkState); |
| - // Take care of positioned objects. This is required as LayoutState keeps a single clip rect. |
| + // Take care of positioned objects. This is required as InvalidationTreeWalkState keeps a single clip rect. |
| if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects()) { |
| TrackedRendererListHashSet::iterator end = positionedObjects->end(); |
| - LayoutState state(*this, isTableRow() ? LayoutSize() : locationOffset()); |
| + bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer(); |
| + const RenderLayerModelObject& newPaintInvalidationContainer = *adjustCompositedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &invalidationTreeWalkState.paintInvalidationContainer()); |
| + InvalidationTreeWalkState childInvalidationTreeWalkState(invalidationTreeWalkState, *this, newPaintInvalidationContainer); |
| for (TrackedRendererListHashSet::iterator it = positionedObjects->begin(); it != end; ++it) { |
| RenderBox* box = *it; |
| @@ -380,22 +382,33 @@ void RenderBlock::invalidateTreeAfterLayout(const RenderLayerModelObject& invali |
| // so we can't pass our own repaint container along. |
| const RenderLayerModelObject& repaintContainerForChild = *box->containerForPaintInvalidation(); |
| + // If it's a new repaint container, we won't have properly accumulated the offset into the |
| + // InvalidationTreeWalkState. |
| + // FIXME: Teach InvalidationTreeWalkState to handle this case. |
|
Julien - ping for review
2014/07/02 00:27:28
Link to the existing bug for LayoutState.
|
| + if (&repaintContainerForChild != newPaintInvalidationContainer) { |
| + ForceHorriblySlowRectMapping slowRectMapping(&childInvalidationTreeWalkState); |
| + InvalidationTreeWalkState disabledTreeWalkState(childInvalidationTreeWalkState, *this, repaintContainerForChild); |
| + box->invalidateTreeAfterLayout(childInvalidationTreeWalkState); |
| + continue; |
| + } |
| + |
| // If the positioned renderer is absolutely positioned and it is inside |
| // a relatively positioend inline element, we need to account for |
| - // the inline elements position in LayoutState. |
| + // the inline elements position in InvalidationTreeWalkState. |
| if (box->style()->position() == AbsolutePosition) { |
| RenderObject* container = box->container(&repaintContainerForChild, 0); |
| if (container->isRelPositioned() && container->isRenderInline()) { |
| - // FIXME: We should be able to use layout-state for this. |
| - // Currently, we will place absolutly positioned elements inside |
| + // FIXME: We should be able to use InvalidationTreeWalkState for this. |
| + // Currently, we will place absolutely positioned elements inside |
| // relatively positioned inline blocks in the wrong location. crbug.com/371485 |
| - ForceHorriblySlowRectMapping slowRectMapping(*this); |
| - box->invalidateTreeAfterLayout(repaintContainerForChild); |
| + ForceHorriblySlowRectMapping slowRectMapping(&childInvalidationTreeWalkState); |
| + InvalidationTreeWalkState disabledTreeWalkState(childInvalidationTreeWalkState, *this, repaintContainerForChild); |
|
Julien - ping for review
2014/07/02 00:27:28
|disabledTreeWalkState| is unused.
|
| + box->invalidateTreeAfterLayout(childInvalidationTreeWalkState); |
| continue; |
| } |
| } |
| - box->invalidateTreeAfterLayout(repaintContainerForChild); |
| + box->invalidateTreeAfterLayout(childInvalidationTreeWalkState); |
| } |
| } |
| } |
| @@ -4001,8 +4014,6 @@ void RenderBlock::updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderO |
| RenderStyle* pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLetterContainer); |
| ASSERT(firstLetter->isFloating() || firstLetter->isInline()); |
| - ForceHorriblySlowRectMapping slowRectMapping(*this); |
| - |
| if (RenderStyle::stylePropagationDiff(firstLetter->style(), pseudoStyle) == Reattach) { |
| // The first-letter renderer needs to be replaced. Create a new renderer of the right type. |
| RenderBoxModelObject* newFirstLetter; |
| @@ -4183,10 +4194,6 @@ void RenderBlock::updateFirstLetter() |
| if (!currChild->isText() || currChild->isBR() || toRenderText(currChild)->isWordBreak()) |
| return; |
| - // Our layout state is not valid for the repaints we are going to trigger by |
| - // adding and removing children of firstLetterContainer. |
| - ForceHorriblySlowRectMapping slowRectMapping(*this); |
| - |
| createFirstLetterRenderer(firstLetterBlock, currChild, length); |
| } |
| @@ -4445,9 +4452,9 @@ void RenderBlock::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const |
| } |
| } |
| -LayoutRect RenderBlock::rectWithOutlineForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, LayoutUnit outlineWidth) const |
| +LayoutRect RenderBlock::rectWithOutlineForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, LayoutUnit outlineWidth, const InvalidationTreeWalkState* invalidationTreeWalkState) const |
| { |
| - LayoutRect r(RenderBox::rectWithOutlineForPaintInvalidation(paintInvalidationContainer, outlineWidth)); |
| + LayoutRect r(RenderBox::rectWithOutlineForPaintInvalidation(paintInvalidationContainer, outlineWidth, invalidationTreeWalkState)); |
| if (isAnonymousBlockContinuation()) |
| r.inflateY(collapsedMarginBefore()); // FIXME: This is wrong for block-flows that are horizontal. |
| return r; |