Index: Source/core/rendering/RenderInline.cpp |
diff --git a/Source/core/rendering/RenderInline.cpp b/Source/core/rendering/RenderInline.cpp |
index 80041d5a9347a75ed72c0db09d8dfafa1641db3b..52a70bfbb135ddd40a6c49714286f47ab3c9914c 100644 |
--- a/Source/core/rendering/RenderInline.cpp |
+++ b/Source/core/rendering/RenderInline.cpp |
@@ -989,10 +989,8 @@ LayoutRect RenderInline::linesVisualOverflowBoundingBox() const |
return rect; |
} |
-LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer) const |
+LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, const InvalidationTreeWalkState* invalidationTreeWalkState) const |
{ |
- ASSERT(!view() || !view()->layoutStateCachedOffsetsEnabled()); |
- |
if (!firstLineBoxIncludingCulling() && !continuation()) |
return LayoutRect(); |
@@ -1024,7 +1022,7 @@ LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLay |
if (cb->hasOverflowClip()) |
cb->applyCachedClipAndScrollOffsetForRepaint(repaintRect); |
- cb->mapRectToPaintInvalidationBacking(paintInvalidationContainer, repaintRect); |
+ cb->mapRectToPaintInvalidationBacking(paintInvalidationContainer, repaintRect, invalidationTreeWalkState); |
if (outlineSize) { |
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) { |
@@ -1039,29 +1037,25 @@ LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLay |
return repaintRect; |
} |
-LayoutRect RenderInline::rectWithOutlineForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, LayoutUnit outlineWidth) const |
+LayoutRect RenderInline::rectWithOutlineForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, LayoutUnit outlineWidth, const InvalidationTreeWalkState* invalidationTreeWalkState) const |
{ |
- LayoutRect r(RenderBoxModelObject::rectWithOutlineForPaintInvalidation(paintInvalidationContainer, outlineWidth)); |
+ LayoutRect r(RenderBoxModelObject::rectWithOutlineForPaintInvalidation(paintInvalidationContainer, outlineWidth, invalidationTreeWalkState)); |
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) { |
if (!curr->isText()) |
- r.unite(curr->rectWithOutlineForPaintInvalidation(paintInvalidationContainer, outlineWidth)); |
+ r.unite(curr->rectWithOutlineForPaintInvalidation(paintInvalidationContainer, outlineWidth, invalidationTreeWalkState)); |
} |
return r; |
} |
-void RenderInline::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, bool fixed) const |
+void RenderInline::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, bool fixed, const InvalidationTreeWalkState* invalidationTreeWalkState) const |
{ |
- if (RenderView* v = view()) { |
- // LayoutState is only valid for root-relative repainting |
- if (v->canMapUsingLayoutStateForContainer(paintInvalidationContainer)) { |
- LayoutState* layoutState = v->layoutState(); |
- if (style()->hasInFlowPosition() && layer()) |
- rect.move(layer()->offsetForInFlowPosition()); |
- rect.move(layoutState->paintOffset()); |
- if (layoutState->isClipped()) |
- rect.intersect(layoutState->clipRect()); |
- return; |
- } |
+ if (invalidationTreeWalkState && invalidationTreeWalkState->canMapToContainer(paintInvalidationContainer)) { |
+ if (style()->hasInFlowPosition() && layer()) |
+ rect.move(layer()->offsetForInFlowPosition()); |
+ rect.move(invalidationTreeWalkState->paintOffset()); |
+ if (invalidationTreeWalkState->isClipped()) |
+ rect.intersect(invalidationTreeWalkState->clipRect()); |
+ return; |
} |
if (paintInvalidationContainer == this) |
@@ -1109,7 +1103,7 @@ void RenderInline::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec |
return; |
} |
- o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, fixed); |
+ o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, fixed, invalidationTreeWalkState); |
} |
LayoutSize RenderInline::offsetFromContainer(const RenderObject* container, const LayoutPoint& point, bool* offsetDependsOnPoint) const |
@@ -1134,20 +1128,17 @@ LayoutSize RenderInline::offsetFromContainer(const RenderObject* container, cons |
return offset; |
} |
-void RenderInline::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const |
+void RenderInline::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed, const InvalidationTreeWalkState* invalidationTreeWalkState) const |
{ |
if (repaintContainer == this) |
return; |
- if (RenderView *v = view()) { |
- if (v->canMapUsingLayoutStateForContainer(repaintContainer)) { |
- LayoutState* layoutState = v->layoutState(); |
- LayoutSize offset = layoutState->paintOffset(); |
- if (style()->hasInFlowPosition() && layer()) |
- offset += layer()->offsetForInFlowPosition(); |
- transformState.move(offset); |
- return; |
- } |
+ if (invalidationTreeWalkState && invalidationTreeWalkState->canMapToContainer(repaintContainer)) { |
+ LayoutSize offset = invalidationTreeWalkState->paintOffset(); |
+ if (style()->hasInFlowPosition() && layer()) |
+ offset += layer()->offsetForInFlowPosition(); |
+ transformState.move(offset); |
+ return; |
} |
bool containerSkipped; |
@@ -1181,7 +1172,7 @@ void RenderInline::mapLocalToContainer(const RenderLayerModelObject* repaintCont |
return; |
} |
- o->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed); |
+ o->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed, invalidationTreeWalkState); |
} |
void RenderInline::updateDragState(bool dragOn) |
@@ -1569,10 +1560,12 @@ void RenderInline::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions) |
regions.append(region); |
} |
-void RenderInline::invalidateTreeAfterLayout(const RenderLayerModelObject& paintInvalidationContainer) |
+void RenderInline::invalidateTreeAfterLayout(const InvalidationTreeWalkState& invalidationTreeWalkState) |
{ |
- LayoutState state(*this); |
- RenderObject::invalidateTreeAfterLayout(paintInvalidationContainer); |
+ bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer(); |
+ const RenderLayerModelObject& newPaintInvalidationContainer = *adjustCompositedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &invalidationTreeWalkState.paintInvalidationContainer()); |
dsinclair
2014/07/02 18:48:24
Is there any benefit to putting this into a newPai
|
+ InvalidationTreeWalkState childInvalidationTreeWalkState(invalidationTreeWalkState, *this, newPaintInvalidationContainer); |
+ RenderObject::invalidateTreeAfterLayout(invalidationTreeWalkState); |
} |
} // namespace WebCore |