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

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

Issue 2529293012: Invalidate paint properties on paint offset changes (Closed)
Patch Set: Simpler fix for overflowclip 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 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 {
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('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