| 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())
|
|
|