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

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

Issue 1837033002: Invalidate objects when their content box changes dimensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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 382501f6a7694e0a02dc01d7e081da30305af60f..e06de06fba5997b9ae7005f3873e12617909594d 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -3830,6 +3830,13 @@ PaintInvalidationReason LayoutBox::getPaintInvalidationReason(const LayoutBoxMod
&& hasLayer() && layer()->transform() && !layer()->transform()->isIdentityOrTranslation())
return PaintInvalidationBoundsChange;
+ if (style()->backgroundLayers().thisOrNextLayersUseContentBox() || style()->maskLayers().thisOrNextLayersUseContentBox() || style()->boxSizing() == BoxSizingBorderBox) {
+ LayoutRect oldContentBoxRect = m_rareData ? m_rareData->m_previousContentBoxRect : LayoutRect();
+ LayoutRect newContentBoxRect = contentBoxRect();
+ if (oldContentBoxRect != newContentBoxRect)
+ return PaintInvalidationContentBoxChange;
+ }
+
if (!style()->hasBackground() && !style()->hasBoxDecorations()) {
// We could let incremental invalidation cover non-composited scrollbars, but just
// do a full invalidation because incremental invalidation will go away with slimming paint.
@@ -3838,13 +3845,6 @@ PaintInvalidationReason LayoutBox::getPaintInvalidationReason(const LayoutBoxMod
return invalidationReason;
}
- if (style()->backgroundLayers().thisOrNextLayersUseContentBox() || style()->maskLayers().thisOrNextLayersUseContentBox()) {
- LayoutRect oldContentBoxRect = m_rareData ? m_rareData->m_previousContentBoxRect : LayoutRect();
- LayoutRect newContentBoxRect = contentBoxRect();
- if (oldContentBoxRect != newContentBoxRect)
- return PaintInvalidationContentBoxChange;
- }
-
if (style()->backgroundLayers().thisOrNextLayersHaveLocalAttachment()) {
LayoutRect oldLayoutOverflowRect = m_rareData ? m_rareData->m_previousLayoutOverflowRect : LayoutRect();
LayoutRect newLayoutOverflowRect = layoutOverflowRect();
@@ -4519,6 +4519,10 @@ bool LayoutBox::needToSavePreviousBoxSizes()
if (paintInvalidationSize.isEmpty())
return false;
+ // If we use border-box sizing we need to track changes in the size of the content box.
+ if (style()->boxSizing() == BoxSizingBorderBox)
+ return true;
+
// We need the old box sizes only when the box has background, decorations, or masks.
// Main LayoutView paints base background, thus interested in box size.
if (!isLayoutView() && !style()->hasBackground() && !style()->hasBoxDecorations() && !style()->hasMask())

Powered by Google App Engine
This is Rietveld 408576698