Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 1734203002: Fully (?) fix overflow: auto with delayed scroll updates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added comment Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..771acb511c8fb4426626165b72876116e6f5dd5d 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 didMarkForDelayedLayout = false;
+
if (needsScrollbarReconstruction()) {
m_scrollbarManager.setCanDetachScrollbars(false);
setHasHorizontalScrollbar(false);
@@ -683,14 +685,19 @@ 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);
+ didMarkForDelayedLayout = true;
} 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())
@@ -727,6 +734,8 @@ void PaintLayerScrollableArea::updateAfterLayout()
DisableCompositingQueryAsserts disabler;
positionOverflowControls();
+
+ return didMarkForDelayedLayout;
}
ScrollBehavior PaintLayerScrollableArea::scrollBehaviorStyle() const
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698