Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| index fc48cab3e05c766569f25454af712a7460b27e11..9cc848b652cf494cfe192ad08cf18fd74c5ba87b 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| @@ -325,6 +325,17 @@ void LayoutBox::styleDidChange(StyleDifference diff, |
| updateScrollSnapMappingAfterStyleChange(&newStyle, oldStyle); |
| } |
| + if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
| + // The overflow clip paint property depends on border sizes through |
| + // overflowClipRect(), so we trigger a property update if any border is or |
| + // was present. This check could be more precise (checking the actual |
| + // border values) if performance is an issue. |
| + if (hasOverflowClip() || styleRef().containsPaint() || hasControlClip()) { |
| + if (newStyle.hasBorder() || (oldStyle && oldStyle->hasBorder())) |
|
Xianzhu
2016/12/05 16:55:53
How does it work if overflow clip changed without
|
| + setNeedsPaintPropertyUpdate(); |
| + } |
| + } |
| + |
| // Non-atomic inlines should be LayoutInline or LayoutText, not LayoutBox. |
| DCHECK(!isInline() || isAtomicInlineLevel()); |
| } |
| @@ -1692,6 +1703,13 @@ void LayoutBox::frameRectChanged() { |
| // Should check this object for paint invalidation. |
| if (!needsLayout()) |
| setMayNeedPaintInvalidation(); |
| + |
| + if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
| + // The overflow clip paint property depends on the border box rect through |
| + // overflowClipRect, which in turn depends on the frame rect. |
| + if (hasOverflowClip() || styleRef().containsPaint() || hasControlClip()) |
| + setNeedsPaintPropertyUpdate(); |
| + } |
| } |
| bool LayoutBox::intersectsVisibleViewport() const { |