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

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: Updated Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/repaint/box-sizing-padding-keeping-size-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9d334df05181eeafb53095a651fb4bd46125ed0c..94509d27f455e582f9b36cda7362e4c3e2102575 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -3826,6 +3826,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.
@@ -3834,13 +3841,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();
@@ -4517,6 +4517,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())
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/repaint/box-sizing-padding-keeping-size-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698