OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. |
4 * All rights reserved. | 4 * All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 WTF::wrapUnique(new ViewFragmentationContext(*this)); | 240 WTF::wrapUnique(new ViewFragmentationContext(*this)); |
241 m_paginationStateChanged = true; | 241 m_paginationStateChanged = true; |
242 } | 242 } |
243 } else if (m_fragmentationContext) { | 243 } else if (m_fragmentationContext) { |
244 m_fragmentationContext.reset(); | 244 m_fragmentationContext.reset(); |
245 m_paginationStateChanged = true; | 245 m_paginationStateChanged = true; |
246 } | 246 } |
247 | 247 |
248 SubtreeLayoutScope layoutScope(*this); | 248 SubtreeLayoutScope layoutScope(*this); |
249 | 249 |
250 LayoutRect oldLayoutOverflowRect = layoutOverflowRect(); | 250 LayoutSize oldBackgroundPositioningSize; |
251 const LayoutObject* backgroundPositioningObject = nullptr; | |
252 if (!styleRef().hasEntirelyFixedBackground()) { | |
253 if (Element* documentElement = document().documentElement()) { | |
254 backgroundPositioningObject = documentElement->layoutObject(); | |
255 if (backgroundPositioningObject && backgroundPositioningObject->isBox()) { | |
256 oldBackgroundPositioningSize = | |
257 toLayoutBox(backgroundPositioningObject)->size(); | |
258 } | |
259 } | |
260 } | |
251 | 261 |
252 // Use calcWidth/Height to get the new width/height, since this will take the | 262 // Use calcWidth/Height to get the new width/height, since this will take the |
253 // full page zoom factor into account. | 263 // full page zoom factor into account. |
254 bool relayoutChildren = | 264 bool relayoutChildren = |
255 !shouldUsePrintingLayout() && | 265 !shouldUsePrintingLayout() && |
256 (!m_frameView || logicalWidth() != viewLogicalWidthForBoxSizing() || | 266 (!m_frameView || logicalWidth() != viewLogicalWidthForBoxSizing() || |
257 logicalHeight() != viewLogicalHeightForBoxSizing()); | 267 logicalHeight() != viewLogicalHeightForBoxSizing()); |
258 if (relayoutChildren) { | 268 if (relayoutChildren) { |
259 layoutScope.setChildNeedsLayout(this); | 269 layoutScope.setChildNeedsLayout(this); |
260 for (LayoutObject* child = firstChild(); child; | 270 for (LayoutObject* child = firstChild(); child; |
(...skipping 15 matching lines...) Expand all Loading... | |
276 } | 286 } |
277 | 287 |
278 ASSERT(!m_layoutState); | 288 ASSERT(!m_layoutState); |
279 if (!needsLayout()) | 289 if (!needsLayout()) |
280 return; | 290 return; |
281 | 291 |
282 LayoutState rootLayoutState(*this); | 292 LayoutState rootLayoutState(*this); |
283 | 293 |
284 layoutContent(); | 294 layoutContent(); |
285 | 295 |
286 if (layoutOverflowRect() != oldLayoutOverflowRect) { | 296 if (backgroundPositioningObject && backgroundPositioningObject->isBox()) { |
chrishtr
2017/02/16 18:39:36
could the layout between the code you added above
| |
287 // The document element paints the viewport background, so we need to | 297 LayoutSize newSize = toLayoutBox(backgroundPositioningObject)->size(); |
288 // invalidate it when layout overflow changes. | 298 const auto& backgroundLayers = styleRef().backgroundLayers(); |
289 // FIXME: Improve viewport background styling/invalidation/painting. | 299 if ((oldBackgroundPositioningSize.width() != newSize.width() && |
290 // crbug.com/475115 | 300 mustInvalidateFillLayersPaintOnWidthChange(backgroundLayers)) || |
291 if (Element* documentElement = document().documentElement()) { | 301 (oldBackgroundPositioningSize.height() != newSize.height() && |
292 if (LayoutObject* rootObject = documentElement->layoutObject()) | 302 mustInvalidateFillLayersPaintOnHeightChange(backgroundLayers))) |
293 rootObject->setShouldDoFullPaintInvalidation(); | 303 setShouldDoFullPaintInvalidation(); |
294 } | |
295 } | 304 } |
296 | 305 |
297 #if DCHECK_IS_ON() | 306 #if DCHECK_IS_ON() |
298 checkLayoutState(); | 307 checkLayoutState(); |
299 #endif | 308 #endif |
300 clearNeedsLayout(); | 309 clearNeedsLayout(); |
301 } | 310 } |
302 | 311 |
303 LayoutRect LayoutView::visualOverflowRect() const { | 312 LayoutRect LayoutView::visualOverflowRect() const { |
304 // In root layer scrolling mode, the LayoutView performs overflow clipping | 313 // In root layer scrolling mode, the LayoutView performs overflow clipping |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1049 bool LayoutView::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { | 1058 bool LayoutView::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { |
1050 // Frame scroll corner is painted using LayoutView as the display item client. | 1059 // Frame scroll corner is painted using LayoutView as the display item client. |
1051 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() && | 1060 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() && |
1052 (frameView()->horizontalScrollbar() || frameView()->verticalScrollbar())) | 1061 (frameView()->horizontalScrollbar() || frameView()->verticalScrollbar())) |
1053 return false; | 1062 return false; |
1054 | 1063 |
1055 return LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); | 1064 return LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); |
1056 } | 1065 } |
1057 | 1066 |
1058 } // namespace blink | 1067 } // namespace blink |
OLD | NEW |