Avoid ForceHorriblySlowRectMapping in RenderInline::clippedOverflowRectForPaintInvalidation()

ForceHorriblySlowRectMapping was needed in RenderInline::
clippedOverflowRectForPaintInvalidation() to avoid errors when calling
containingBlock->mapRectToPaintInvalidationBacking() with the provided
paintInvalidationState.

Now call RenderInline's own mapRectToPaintInvalidationBacking() instead
of containingBlock's to make paintInvalidationState applicable and
reduce duplicate code.

BUG=402994
TEST=exsiting tests

Review URL: https://codereview.chromium.org/555933002

git-svn-id: svn://svn.chromium.org/blink/trunk@181921 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0708d535
......@@ -1026,37 +1026,11 @@ LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLay
return LayoutRect();
LayoutRect paintInvalidationRect(linesVisualOverflowBoundingBox());
bool hitPaintInvalidationContainer = false;
// We need to add in the in-flow position offsets of any inlines (including us) up to our
// containing block.
RenderBlock* cb = containingBlock();
for (const RenderObject* inlineFlow = this; inlineFlow && inlineFlow->isRenderInline() && inlineFlow != cb;
inlineFlow = inlineFlow->parent()) {
if (inlineFlow == paintInvalidationContainer) {
hitPaintInvalidationContainer = true;
break;
}
if (inlineFlow->style()->hasInFlowPosition() && inlineFlow->hasLayer())
paintInvalidationRect.move(toRenderInline(inlineFlow)->layer()->offsetForInFlowPosition());
}
LayoutUnit outlineSize = style()->outlineSize();
paintInvalidationRect.inflate(outlineSize);
if (hitPaintInvalidationContainer || !cb)
return paintInvalidationRect;
if (cb->hasColumns())
cb->adjustRectForColumns(paintInvalidationRect);
if (cb->hasOverflowClip())
cb->applyCachedClipAndScrollOffsetForPaintInvalidation(paintInvalidationRect);
// FIXME: Passing paintInvalidationState directly to mapRectToPaintInvalidationBacking causes incorrect invalidations.
// Should avoid slowRectMapping by properly adjusting paintInvalidationState. crbug.com/402994.
ForceHorriblySlowRectMapping slowRectMapping(paintInvalidationState);
cb->mapRectToPaintInvalidationBacking(paintInvalidationContainer, paintInvalidationRect, paintInvalidationState);
mapRectToPaintInvalidationBacking(paintInvalidationContainer, paintInvalidationRect, paintInvalidationState);
if (outlineSize) {
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment