Chromium Code Reviews| Index: Source/core/rendering/RenderObject.cpp |
| diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp |
| index 612025741947dfc4a0327918231b98b6bb27393f..fbd8f6add1395d999a446f1f5ee2a88a69dc3a29 100644 |
| --- a/Source/core/rendering/RenderObject.cpp |
| +++ b/Source/core/rendering/RenderObject.cpp |
| @@ -1531,7 +1531,10 @@ void RenderObject::paintInvalidationForWholeRenderer() const |
| // Until those states are fully fledged, I'll just disable the ASSERTS. |
| DisableCompositingQueryAsserts disabler; |
| const RenderLayerModelObject* paintInvalidationContainer = containerForPaintInvalidation(); |
| - LayoutRect paintInvalidationRect = boundsRectForPaintInvalidation(paintInvalidationContainer); |
| + |
| + // FIXME: We should invalidate previousPaintInvalidationRect, but for objects that don't save previousPaintInvalidationRect, |
| + // we have to use the current paint invalidation rect. crbug.com/394133. |
| + LayoutRect paintInvalidationRect = savesPreviousPaintInvalidationRect() ? previousPaintInvalidationRect() : boundsRectForPaintInvalidation(paintInvalidationContainer); |
| invalidatePaintUsingContainer(paintInvalidationContainer, paintInvalidationRect, InvalidationPaint); |
| } |
| @@ -2059,12 +2062,23 @@ void RenderObject::setStyle(PassRefPtr<RenderStyle> style) |
| // Invalidate paints with the new style, e.g., for example if we go from not having |
| // an outline to having an outline. |
| - // The paintInvalidationForWholeRenderer() call is needed for non-layout changes to style. See the corresponding |
| - // comment in RenderObject::styleWillChange for why. |
| - if (needsLayout()) |
| + if (needsLayout()) { |
| setShouldDoFullPaintInvalidationAfterLayout(true); |
| - else if (!selfNeedsLayout()) |
| + } else { |
| + // The paintInvalidationForWholeRenderer() calls are needed for non-layout changes to style. See the corresponding |
| + // comment in RenderObject::styleWillChange for why. |
| + if (savesPreviousPaintInvalidationRect()) { |
| + LayoutRect paintInvalidationRect = boundsRectForPaintInvalidation(containerForPaintInvalidation()); |
| + if (paintInvalidationRect != previousPaintInvalidationRect()) { |
| + // If the original diff didn't require repaint, invalidate previousPaintInvalidationRect |
| + // before we save a new previousPaintInvalidationRect. |
| + if (!diff.needsRepaint()) |
|
chrishtr
2014/07/16 00:49:22
Why the !diff.needsRepaint() conditional?
Why don
Xianzhu
2014/07/16 01:59:49
'!diff.needsRepaint() && updatedDiff.needsRepaint(
|
| + paintInvalidationForWholeRenderer(); |
| + setPreviousPaintInvalidationRect(paintInvalidationRect); |
| + } |
| + } |
| paintInvalidationForWholeRenderer(); |
| + } |
| } |
| } |