| Index: Source/core/rendering/RenderBlock.cpp
|
| diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
|
| index 4dc625a006d76555ae5979d23a8a9f9715abb689..32175d5e795d124659372246731a642a8e3fe8c3 100644
|
| --- a/Source/core/rendering/RenderBlock.cpp
|
| +++ b/Source/core/rendering/RenderBlock.cpp
|
| @@ -362,19 +362,21 @@
|
| ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRenderObject(this);
|
| }
|
|
|
| -void RenderBlock::invalidateTreeAfterLayout(const RenderLayerModelObject& invalidationContainer)
|
| +void RenderBlock::invalidateTreeAfterLayout(const PaintInvalidationState& paintInvalidationState)
|
| {
|
| // 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);
|
| -
|
| - // Take care of positioned objects. This is required as LayoutState keeps a single clip rect.
|
| + RenderBox::invalidateTreeAfterLayout(paintInvalidationState);
|
| +
|
| + // Take care of positioned objects. This is required as PaintInvalidationState 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 : &paintInvalidationState.paintInvalidationContainer());
|
| + PaintInvalidationState childPaintInvalidationState(paintInvalidationState, *this, newPaintInvalidationContainer);
|
| for (TrackedRendererListHashSet::iterator it = positionedObjects->begin(); it != end; ++it) {
|
| RenderBox* box = *it;
|
|
|
| @@ -382,22 +384,33 @@
|
| // so we can't pass our own repaint container along.
|
| const RenderLayerModelObject& repaintContainerForChild = *box->containerForPaintInvalidation();
|
|
|
| + // If it's a new paint invalidation container, we won't have properly accumulated the offset into the
|
| + // PaintInvalidationState.
|
| + // FIXME: Teach PaintInvalidationState to handle this case. crbug.com/371485
|
| + if (&repaintContainerForChild != newPaintInvalidationContainer) {
|
| + ForceHorriblySlowRectMapping slowRectMapping(&childPaintInvalidationState);
|
| + PaintInvalidationState disabledPaintInvalidationState(childPaintInvalidationState, *this, repaintContainerForChild);
|
| + box->invalidateTreeAfterLayout(disabledPaintInvalidationState);
|
| + 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.
|
| + // a relatively positioned inline element, we need to account for
|
| + // the inline elements position in PaintInvalidationState.
|
| 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 PaintInvalidationState 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(&childPaintInvalidationState);
|
| + PaintInvalidationState disabledPaintInvalidationState(childPaintInvalidationState, *this, repaintContainerForChild);
|
| + box->invalidateTreeAfterLayout(disabledPaintInvalidationState);
|
| continue;
|
| }
|
| }
|
|
|
| - box->invalidateTreeAfterLayout(repaintContainerForChild);
|
| + box->invalidateTreeAfterLayout(childPaintInvalidationState);
|
| }
|
| }
|
| }
|
| @@ -4011,8 +4024,6 @@
|
| 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;
|
| @@ -4193,10 +4204,6 @@
|
| 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);
|
| }
|
|
|
| @@ -4455,9 +4462,9 @@
|
| }
|
| }
|
|
|
| -LayoutRect RenderBlock::rectWithOutlineForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, LayoutUnit outlineWidth) const
|
| -{
|
| - LayoutRect r(RenderBox::rectWithOutlineForPaintInvalidation(paintInvalidationContainer, outlineWidth));
|
| +LayoutRect RenderBlock::rectWithOutlineForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalidationState* paintInvalidationState) const
|
| +{
|
| + LayoutRect r(RenderBox::rectWithOutlineForPaintInvalidation(paintInvalidationContainer, outlineWidth, paintInvalidationState));
|
| if (isAnonymousBlockContinuation())
|
| r.inflateY(collapsedMarginBefore()); // FIXME: This is wrong for block-flows that are horizontal.
|
| return r;
|
|
|