| 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 |
| 250 // Use calcWidth/Height to get the new width/height, since this will take the | 252 // Use calcWidth/Height to get the new width/height, since this will take the |
| 251 // full page zoom factor into account. | 253 // full page zoom factor into account. |
| 252 bool relayoutChildren = | 254 bool relayoutChildren = |
| 253 !shouldUsePrintingLayout() && | 255 !shouldUsePrintingLayout() && |
| 254 (!m_frameView || logicalWidth() != viewLogicalWidthForBoxSizing() || | 256 (!m_frameView || logicalWidth() != viewLogicalWidthForBoxSizing() || |
| 255 logicalHeight() != viewLogicalHeightForBoxSizing()); | 257 logicalHeight() != viewLogicalHeightForBoxSizing()); |
| 256 if (relayoutChildren) { | 258 if (relayoutChildren) { |
| 257 layoutScope.setChildNeedsLayout(this); | 259 layoutScope.setChildNeedsLayout(this); |
| 258 for (LayoutObject* child = firstChild(); child; | 260 for (LayoutObject* child = firstChild(); child; |
| 259 child = child->nextSibling()) { | 261 child = child->nextSibling()) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 274 } | 276 } |
| 275 | 277 |
| 276 ASSERT(!m_layoutState); | 278 ASSERT(!m_layoutState); |
| 277 if (!needsLayout()) | 279 if (!needsLayout()) |
| 278 return; | 280 return; |
| 279 | 281 |
| 280 LayoutState rootLayoutState(pageLogicalHeight(), *this); | 282 LayoutState rootLayoutState(pageLogicalHeight(), *this); |
| 281 | 283 |
| 282 layoutContent(); | 284 layoutContent(); |
| 283 | 285 |
| 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 |
| 284 #if ENABLE(ASSERT) | 297 #if ENABLE(ASSERT) |
| 285 checkLayoutState(); | 298 checkLayoutState(); |
| 286 #endif | 299 #endif |
| 287 clearNeedsLayout(); | 300 clearNeedsLayout(); |
| 288 } | 301 } |
| 289 | 302 |
| 290 LayoutRect LayoutView::visualOverflowRect() const { | 303 LayoutRect LayoutView::visualOverflowRect() const { |
| 291 // In root layer scrolling mode, the LayoutView performs overflow clipping | 304 // In root layer scrolling mode, the LayoutView performs overflow clipping |
| 292 // like a regular scrollable div. | 305 // like a regular scrollable div. |
| 293 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) | 306 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1040 if (block) | 1053 if (block) |
| 1041 block->adjustChildDebugRect(rect); | 1054 block->adjustChildDebugRect(rect); |
| 1042 | 1055 |
| 1043 rect.setWidth(LayoutUnit(viewWidth(IncludeScrollbars))); | 1056 rect.setWidth(LayoutUnit(viewWidth(IncludeScrollbars))); |
| 1044 rect.setHeight(LayoutUnit(viewHeight(IncludeScrollbars))); | 1057 rect.setHeight(LayoutUnit(viewHeight(IncludeScrollbars))); |
| 1045 | 1058 |
| 1046 return rect; | 1059 return rect; |
| 1047 } | 1060 } |
| 1048 | 1061 |
| 1049 } // namespace blink | 1062 } // namespace blink |
| OLD | NEW |