| Index: Source/core/layout/LayoutView.cpp
|
| diff --git a/Source/core/layout/LayoutView.cpp b/Source/core/layout/LayoutView.cpp
|
| index 66e7c764e20d271e8b2f3a9db35012cc709631ed..71f8f06ac67bdc4125aee779cacd12112b3299b3 100644
|
| --- a/Source/core/layout/LayoutView.cpp
|
| +++ b/Source/core/layout/LayoutView.cpp
|
| @@ -219,8 +219,6 @@ void LayoutView::layout()
|
|
|
| SubtreeLayoutScope layoutScope(*this);
|
|
|
| - LayoutRect oldLayoutOverflowRect = layoutOverflowRect();
|
| -
|
| // Use calcWidth/Height to get the new width/height, since this will take the full page zoom factor into account.
|
| bool relayoutChildren = !shouldUsePrintingLayout() && (!m_frameView
|
| || logicalWidth() != viewLogicalWidthForBoxSizing()
|
| @@ -252,22 +250,64 @@ void LayoutView::layout()
|
|
|
| layoutContent();
|
|
|
| - if (RuntimeEnabledFeatures::slimmingPaintEnabled() && layoutOverflowRect() != oldLayoutOverflowRect) {
|
| - // The document element paints the viewport background, so we need to invalidate it when
|
| - // layout overflow changes.
|
| - // FIXME: Improve viewport background styling/invalidation/painting. crbug.com/475115
|
| - if (Element* documentElement = document().documentElement()) {
|
| - if (LayoutObject* rootObject = documentElement->layoutObject())
|
| - rootObject->setShouldDoFullPaintInvalidation();
|
| - }
|
| - }
|
| -
|
| #if ENABLE(ASSERT)
|
| checkLayoutState();
|
| #endif
|
| clearNeedsLayout();
|
| }
|
|
|
| +void LayoutView::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyle)
|
| +{
|
| + const ComputedStyle& newStyle = styleRef();
|
| +
|
| + if (oldStyle && oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFixedBackground())
|
| + compositor()->setNeedsUpdateFixedBackground();
|
| +
|
| + LayoutBlockFlow::styleDidChange(diff, oldStyle);
|
| +}
|
| +
|
| +PaintInvalidationReason LayoutView::invalidatePaintIfNeeded(PaintInvalidationState& paintInvalidationState, const LayoutBoxModelObject& newPaintInvalidationContainer)
|
| +{
|
| + const LayoutObject* rootObject = document().documentElement() ? document().documentElement()->layoutObject() : nullptr;
|
| + TransformationMatrix newTransform;
|
| + LayoutSize newBorderBoxSize;
|
| + LayoutRect newPaddingBoxRect;
|
| + LayoutRect newContentBoxRect;
|
| +
|
| + if (rootObject && rootObject->isBox()) {
|
| + const LayoutBox& rootBox = toLayoutBox(*rootObject);
|
| + if (rootBox.hasLayer()) {
|
| + const DeprecatedPaintLayer& rootLayer = *rootBox.layer();
|
| + LayoutPoint offset;
|
| + rootLayer.convertToLayerCoords(nullptr, offset);
|
| + newTransform.translate(offset.x(), offset.y());
|
| + newTransform.multiply(rootLayer.currentTransform());
|
| + }
|
| + newBorderBoxSize = rootBox.size();
|
| + newPaddingBoxRect = rootBox.paddingBoxRect();
|
| + newContentBoxRect = rootBox.contentBoxRect();
|
| + }
|
| +
|
| + if (m_previousRootBackgroundPositioning.transform != newTransform)
|
| + setShouldDoFullPaintInvalidation(PaintInvalidationLocationChange);
|
| +
|
| + const FillLayer& backgroundLayers = style()->backgroundLayers();
|
| + if (mustInvalidateFillLayersPaintOnWidthChange(backgroundLayers) || mustInvalidateFillLayersPaintOnHeightChange(backgroundLayers)) {
|
| + if (m_previousRootBackgroundPositioning.borderBoxSize != newBorderBoxSize
|
| + || m_previousRootBackgroundPositioning.paddingBoxRect != newPaddingBoxRect
|
| + || m_previousRootBackgroundPositioning.contentBoxRect != newContentBoxRect) {
|
| + setShouldDoFullPaintInvalidation(PaintInvalidationBorderBoxChange);
|
| + }
|
| + }
|
| +
|
| + m_previousRootBackgroundPositioning.transform = newTransform;
|
| + m_previousRootBackgroundPositioning.borderBoxSize = newBorderBoxSize;
|
| + m_previousRootBackgroundPositioning.paddingBoxRect = newPaddingBoxRect;
|
| + m_previousRootBackgroundPositioning.contentBoxRect = newContentBoxRect;
|
| +
|
| + return LayoutBox::invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer);
|
| +}
|
| +
|
| void LayoutView::mapLocalToContainer(const LayoutBoxModelObject* paintInvalidationContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed, const PaintInvalidationState* paintInvalidationState) const
|
| {
|
| ASSERT_UNUSED(wasFixed, !wasFixed || *wasFixed == static_cast<bool>(mode & IsFixed));
|
|
|