Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2573963002: [SPInvalidation] Update paint properties when border radii change (Closed)
Patch Set: Rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 f061939eeb8075ca052186f34717fbbb9e2ad9c1..58cfcd7ddfe6fbf0bc5e05b05a59711eb2e5533c 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -323,13 +323,14 @@ void LayoutBox::styleDidChange(StyleDifference diff,
flowThread->flowThreadDescendantStyleDidChange(this, diff, *oldStyle);
updateScrollSnapMappingAfterStyleChange(&newStyle, oldStyle);
- }
- if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
- if (hasOverflowClip() || styleRef().containsPaint() || hasControlClip()) {
+ if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() &&
+ shouldClipOverflow()) {
// The overflow clip paint property depends on border sizes through
- // overflowClipRect() so we update properties on border size changes.
- if (oldStyle && !oldStyle->border().sizeEquals(newStyle.border()))
+ // overflowClipRect(), and border radii, so we update properties on
+ // border size or radii change.
+ if (!oldStyle->border().sizeEquals(newStyle.border()) ||
+ !oldStyle->border().radiiEqual(newStyle.border()))
setNeedsPaintPropertyUpdate();
}
}
@@ -1702,13 +1703,12 @@ void LayoutBox::frameRectChanged() {
if (!needsLayout())
setMayNeedPaintInvalidation();
- if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
- // The overflow clip paint property depends on the border box rect through
- // overflowClipRect(). The border box rect's size equals the frame rect's
- // size, so we trigger a paint property update when the framerect changes.
- if (hasOverflowClip() || styleRef().containsPaint() || hasControlClip())
- setNeedsPaintPropertyUpdate();
- }
+ // The overflow clip paint property depends on the border box rect through
+ // overflowClipRect(). The border box rect's size equals the frame rect's
+ // size, so we trigger a paint property update when the framerect changes.
+ if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() &&
+ shouldClipOverflow())
+ setNeedsPaintPropertyUpdate();
}
bool LayoutBox::intersectsVisibleViewport() const {
@@ -5669,4 +5669,8 @@ LayoutRect LayoutBox::debugRect() const {
return rect;
}
+bool LayoutBox::shouldClipOverflow() const {
+ return hasOverflowClip() || styleRef().containsPaint() || hasControlClip();
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698