| Index: third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
|
| index 1c06307669e9806504882409f305d5f9f4682975..d7c7721813fabaa2e3b1e56015c14657a4ba085e 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
|
| @@ -137,6 +137,7 @@ static LayoutRect mapLocalRectToVisualRectInBacking(
|
|
|
| // Convert the result to the container's contents space.
|
| result.moveBy(-context.paintInvalidationContainer->paintOffset());
|
| + result.move(context.scrollAdjustment);
|
| }
|
|
|
| object.adjustVisualRectForRasterEffects(result);
|
| @@ -144,9 +145,6 @@ static LayoutRect mapLocalRectToVisualRectInBacking(
|
| PaintLayer::mapRectInPaintInvalidationContainerToBacking(
|
| *context.paintInvalidationContainer, result);
|
|
|
| - result.move(object.scrollAdjustmentForPaintInvalidation(
|
| - *context.paintInvalidationContainer));
|
| -
|
| return result;
|
| }
|
|
|
| @@ -195,6 +193,7 @@ LayoutPoint PaintInvalidator::computeLocationInBacking(
|
|
|
| // Convert the result to the container's contents space.
|
| point.moveBy(-context.paintInvalidationContainer->paintOffset());
|
| + point.move(context.scrollAdjustment);
|
| }
|
|
|
| if (context.paintInvalidationContainer->layer()->groupedMapping()) {
|
| @@ -204,9 +203,6 @@ LayoutPoint PaintInvalidator::computeLocationInBacking(
|
| point = LayoutPoint(floatPoint);
|
| }
|
|
|
| - point.move(object.scrollAdjustmentForPaintInvalidation(
|
| - *context.paintInvalidationContainer));
|
| -
|
| return point;
|
| }
|
|
|
| @@ -290,6 +286,8 @@ class ScopedUndoFrameViewContentClipAndScroll {
|
| void PaintInvalidator::updatePaintInvalidationContainer(
|
| const LayoutObject& object,
|
| PaintInvalidatorContext& context) {
|
| + const auto* oldPaintInvalidationContainer =
|
| + context.paintInvalidationContainer;
|
| if (object.isPaintInvalidationContainer()) {
|
| context.paintInvalidationContainer = toLayoutBoxModelObject(&object);
|
| if (object.styleRef().isStackingContext())
|
| @@ -343,6 +341,15 @@ void PaintInvalidator::updatePaintInvalidationContainer(
|
| }
|
| }
|
|
|
| + if (context.paintInvalidationContainer != oldPaintInvalidationContainer) {
|
| + context.scrollAdjustment = context.paintInvalidationContainer
|
| + ->scrollAdjustmentForPaintInvalidation();
|
| + } else {
|
| + DCHECK(context.scrollAdjustment ==
|
| + context.paintInvalidationContainer
|
| + ->scrollAdjustmentForPaintInvalidation());
|
| + }
|
| +
|
| DCHECK(context.paintInvalidationContainer ==
|
| object.containerForPaintInvalidation());
|
| DCHECK(context.paintingLayer == object.paintingLayer());
|
| @@ -399,6 +406,8 @@ void PaintInvalidator::invalidatePaintIfNeeded(
|
| context.paintInvalidationContainer =
|
| context.paintInvalidationContainerForStackedContents =
|
| &layoutView->containerForPaintInvalidation();
|
| + context.scrollAdjustment = context.paintInvalidationContainer
|
| + ->scrollAdjustmentForPaintInvalidation();
|
| context.paintingLayer = layoutView->layer();
|
|
|
| if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
|
|
|