Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| index ba2878b3f7468b7f66b5582495755e38850c1913..bf90d39f4dcad2efc4c4314620129e3e230d6556 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| @@ -612,10 +612,12 @@ void PaintLayerScrollableArea::scrollToPosition(const DoublePoint& scrollPositio |
| ScrollableArea::setScrollPosition(newScrollPosition, scrollType, scrollBehavior); |
| } |
| -void PaintLayerScrollableArea::updateAfterLayout() |
| +bool PaintLayerScrollableArea::updateAfterLayout(SubtreeLayoutScope* delayedLayoutScope) |
| { |
| ASSERT(box().hasOverflowClip()); |
| + bool didMarkForLayout = false; |
| + |
| if (needsScrollbarReconstruction()) { |
| m_scrollbarManager.setCanDetachScrollbars(false); |
| setHasHorizontalScrollbar(false); |
| @@ -683,18 +685,23 @@ void PaintLayerScrollableArea::updateAfterLayout() |
| if ((horizontalScrollBarChanged && box().style()->overflowX() != OOVERLAY) || (verticalScrollBarChanged && box().style()->overflowY() != OOVERLAY)) { |
| if (!m_inOverflowRelayout) { |
| m_inOverflowRelayout = true; |
| - SubtreeLayoutScope layoutScope(box()); |
| - layoutScope.setNeedsLayout(&box(), LayoutInvalidationReason::ScrollbarChanged); |
| - if (box().isLayoutBlock()) { |
| - LayoutBlock& block = toLayoutBlock(box()); |
| - block.scrollbarsChanged(horizontalScrollBarChanged, verticalScrollBarChanged); |
| - block.layoutBlock(true); |
| + if (delayedLayoutScope) { |
| + delayedLayoutScope->setNeedsLayout(&box(), LayoutInvalidationReason::ScrollbarChanged); |
| } else { |
| - box().layout(); |
| + SubtreeLayoutScope layoutScope(box()); |
| + layoutScope.setNeedsLayout(&box(), LayoutInvalidationReason::ScrollbarChanged); |
| + if (box().isLayoutBlock()) { |
| + LayoutBlock& block = toLayoutBlock(box()); |
| + block.scrollbarsChanged(horizontalScrollBarChanged, verticalScrollBarChanged); |
| + block.layoutBlock(true); |
| + } else { |
| + box().layout(); |
| + } |
| } |
| LayoutObject* parent = box().parent(); |
| if (parent && parent->isFlexibleBox()) |
| toLayoutFlexibleBox(parent)->clearCachedMainSizeForChild(box()); |
| + didMarkForLayout = true; |
|
szager1
2016/02/25 21:08:08
Should this go inside the "if (delayedLayoutScope)
|
| m_inOverflowRelayout = false; |
| } |
| } |
| @@ -727,6 +734,8 @@ void PaintLayerScrollableArea::updateAfterLayout() |
| DisableCompositingQueryAsserts disabler; |
| positionOverflowControls(); |
| + |
| + return didMarkForLayout; |
| } |
| ScrollBehavior PaintLayerScrollableArea::scrollBehaviorStyle() const |