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 m_fragmentationContext = wrapUnique(new ViewFragmentationContext(*this)); | 240 m_fragmentationContext = 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(); | |
251 | |
252 // Use calcWidth/Height to get the new width/height, since this will take the | 250 // Use calcWidth/Height to get the new width/height, since this will take the |
253 // full page zoom factor into account. | 251 // full page zoom factor into account. |
254 bool relayoutChildren = | 252 bool relayoutChildren = |
255 !shouldUsePrintingLayout() && | 253 !shouldUsePrintingLayout() && |
256 (!m_frameView || logicalWidth() != viewLogicalWidthForBoxSizing() || | 254 (!m_frameView || logicalWidth() != viewLogicalWidthForBoxSizing() || |
257 logicalHeight() != viewLogicalHeightForBoxSizing()); | 255 logicalHeight() != viewLogicalHeightForBoxSizing()); |
258 if (relayoutChildren) { | 256 if (relayoutChildren) { |
259 layoutScope.setChildNeedsLayout(this); | 257 layoutScope.setChildNeedsLayout(this); |
260 for (LayoutObject* child = firstChild(); child; | 258 for (LayoutObject* child = firstChild(); child; |
261 child = child->nextSibling()) { | 259 child = child->nextSibling()) { |
(...skipping 14 matching lines...) Expand all Loading... |
276 } | 274 } |
277 | 275 |
278 ASSERT(!m_layoutState); | 276 ASSERT(!m_layoutState); |
279 if (!needsLayout()) | 277 if (!needsLayout()) |
280 return; | 278 return; |
281 | 279 |
282 LayoutState rootLayoutState(pageLogicalHeight(), *this); | 280 LayoutState rootLayoutState(pageLogicalHeight(), *this); |
283 | 281 |
284 layoutContent(); | 282 layoutContent(); |
285 | 283 |
286 if (layoutOverflowRect() != oldLayoutOverflowRect) { | |
287 // The document element paints the viewport background, so we need to | |
288 // invalidate it when layout overflow changes. | |
289 // FIXME: Improve viewport background styling/invalidation/painting. | |
290 // crbug.com/475115 | |
291 if (Element* documentElement = document().documentElement()) { | |
292 if (LayoutObject* rootObject = documentElement->layoutObject()) | |
293 rootObject->setShouldDoFullPaintInvalidation(); | |
294 } | |
295 } | |
296 | |
297 #if ENABLE(ASSERT) | 284 #if ENABLE(ASSERT) |
298 checkLayoutState(); | 285 checkLayoutState(); |
299 #endif | 286 #endif |
300 clearNeedsLayout(); | 287 clearNeedsLayout(); |
301 } | 288 } |
302 | 289 |
303 LayoutRect LayoutView::visualOverflowRect() const { | 290 LayoutRect LayoutView::visualOverflowRect() const { |
304 // In root layer scrolling mode, the LayoutView performs overflow clipping | 291 // In root layer scrolling mode, the LayoutView performs overflow clipping |
305 // like a regular scrollable div. | 292 // like a regular scrollable div. |
306 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) | 293 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 if (block) | 1038 if (block) |
1052 block->adjustChildDebugRect(rect); | 1039 block->adjustChildDebugRect(rect); |
1053 | 1040 |
1054 rect.setWidth(LayoutUnit(viewWidth(IncludeScrollbars))); | 1041 rect.setWidth(LayoutUnit(viewWidth(IncludeScrollbars))); |
1055 rect.setHeight(LayoutUnit(viewHeight(IncludeScrollbars))); | 1042 rect.setHeight(LayoutUnit(viewHeight(IncludeScrollbars))); |
1056 | 1043 |
1057 return rect; | 1044 return rect; |
1058 } | 1045 } |
1059 | 1046 |
1060 } // namespace blink | 1047 } // namespace blink |
OLD | NEW |