Commit 380630a9 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

Mark only self for invalidation if inside pre-paint.

Marking the entire ancestry for invalidation while inside pre-paint
probably isn't too healthy anyway, and when the pre paint machinery is
updated to walk the NG physical fragment tree rather than the layout
object tree, we're potentially going to visit the same layout object
more than once, and not always in exact tree order.

Bug: 1043787
Change-Id: Id99f46f4704cc279323a94a80762c4e0d2cd166b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089832Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747470}
parent 06789711
...@@ -2279,7 +2279,13 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -2279,7 +2279,13 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
} }
} }
void SetShouldCheckForPaintInvalidation() { void SetShouldCheckForPaintInvalidation() {
layout_object_.SetShouldCheckForPaintInvalidation(); // This method is only intended to be called when visiting this object
// during pre-paint, and as such it should only mark itself, and not the
// entire containing block chain.
DCHECK_EQ(layout_object_.GetDocument().Lifecycle().GetState(),
DocumentLifecycle::kInPrePaint);
layout_object_.bitfields_.SetNeedsPaintOffsetAndVisualRectUpdate(true);
layout_object_.bitfields_.SetShouldCheckForPaintInvalidation(true);
} }
void SetShouldDoFullPaintInvalidation(PaintInvalidationReason reason) { void SetShouldDoFullPaintInvalidation(PaintInvalidationReason reason) {
layout_object_.SetShouldDoFullPaintInvalidation(reason); layout_object_.SetShouldDoFullPaintInvalidation(reason);
......
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