| Index: Source/core/rendering/RenderObject.cpp
|
| diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
|
| index 4db5c5918070ac914af0f20b1068121555da0b79..e46ec13718e17d829f1b5ee3280ae45b40f3b357 100644
|
| --- a/Source/core/rendering/RenderObject.cpp
|
| +++ b/Source/core/rendering/RenderObject.cpp
|
| @@ -2059,15 +2059,14 @@ void RenderObject::setStyle(PassRefPtr<RenderStyle> style)
|
| container->setNeedsOverflowRecalcAfterStyleChange();
|
| }
|
|
|
| - if (updatedDiff.needsRepaint()) {
|
| - // 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 (updatedDiff.needsRepaintLayer()) {
|
| + toRenderLayerModelObject(this)->layer()->setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants();
|
| + } else if (updatedDiff.needsRepaint()) {
|
| + // FIXME: For objects whose invalidateTreeIfNeeded won't invalidate themselves,
|
| + // we still need to invalidate now. crbug.com/394133.
|
| + if (needsLayout() || canSelfInvalidateDuringTreeInvalidation())
|
| setShouldDoFullPaintInvalidation(true);
|
| - else if (!selfNeedsLayout())
|
| + else
|
| paintInvalidationForWholeRenderer();
|
| }
|
| }
|
| @@ -2103,12 +2102,14 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newS
|
| }
|
| }
|
|
|
| - // For style-only changes that need paint invalidation, we currently need to issue a paint invalidation before and after the style
|
| - // change. The paint invalidation before style change is accomplished here. The paint invalidation after style change is accomplished
|
| - // in RenderObject::setStyle.
|
| if (m_parent && diff.needsRepaintObject()) {
|
| - if (!diff.needsLayout() && !needsLayout())
|
| - paintInvalidationForWholeRenderer();
|
| + if (!diff.needsLayout() && !needsLayout()) {
|
| + // Invalidate before style change.
|
| + // FIXME: See FIXMEs in setStyle() before calling paintInvalidationForWholeRenderer
|
| + // for the reason of this paintInvalidationForWholeRenderer.
|
| + if (!canSelfInvalidateDuringTreeInvalidation())
|
| + paintInvalidationForWholeRenderer();
|
| + }
|
| }
|
|
|
| if (isFloating() && (m_style->floating() != newStyle.floating()))
|
|
|