Chromium Code Reviews| Index: Source/core/layout/LayoutObject.cpp |
| diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp |
| index 2a53e6c0bcf239ece950374033a7d277288384c1..27beeecfa72953c51c952fc5c61d46f1705bf98c 100644 |
| --- a/Source/core/layout/LayoutObject.cpp |
| +++ b/Source/core/layout/LayoutObject.cpp |
| @@ -1749,6 +1749,13 @@ void LayoutObject::setStyle(PassRefPtr<ComputedStyle> style) |
| return; |
| } |
| + // These are used later to check invalidation of document element caused by |
| + // body background change. FIXME: This may be related to crbug.com/475115. |
| + LayoutObject* oldViewBackgroundLayoutObject = nullptr; |
| + LayoutView* layoutView = view(); |
| + if (RuntimeEnabledFeatures::slimmingPaintEnabled() && layoutView && isBody()) |
| + oldViewBackgroundLayoutObject = layoutView->backgroundLayoutObject(); |
| + |
| StyleDifference diff; |
| if (m_style) |
| diff = m_style->visualInvalidationDiff(*style); |
| @@ -1772,6 +1779,18 @@ void LayoutObject::setStyle(PassRefPtr<ComputedStyle> style) |
| styleDidChange(diff, oldStyle.get()); |
| + if (RuntimeEnabledFeatures::slimmingPaintEnabled() && layoutView && isBody() && layoutView->backgroundLayoutObject() == this) { |
|
chrishtr
2015/04/30 01:23:57
How about always invalidating the LayoutView and t
Xianzhu
2015/04/30 04:46:39
We don't need to invalidate the LayoutView, but th
chrishtr
2015/04/30 17:48:36
Yeah I mean just always invalidating both if one o
|
| + // The rootObject paints view's background. We need to invalidate it when |
| + // view's background changes because of change of body's style. |
| + if (LayoutObject* rootObject = document().documentElement()->layoutObject()) { |
| + if (oldViewBackgroundLayoutObject != this |
| + || (!oldStyle && m_style->hasBackground()) |
| + || (oldStyle && oldStyle->visitedDependentColor(CSSPropertyBackgroundColor) != m_style->visitedDependentColor(CSSPropertyBackgroundColor)) |
| + || (oldStyle && oldStyle->backgroundLayers() != m_style->backgroundLayers())) |
| + rootObject->setShouldDoFullPaintInvalidation(); |
| + } |
| + } |
| + |
| // FIXME: |this| might be destroyed here. This can currently happen for a LayoutTextFragment when |
| // its first-letter block gets an update in LayoutTextFragment::styleDidChange. For LayoutTextFragment(s), |
| // we will safely bail out with the doesNotNeedLayoutOrPaintInvalidation flag. We might want to broaden |