Commit 5577210e authored by Stefan Zager's avatar Stefan Zager Committed by Commit Bot

[RootLayerScrolls] Update scroll dimensions before clamping

When an overflow:auto vertical scrollbar is removed from an RTL
LayoutView, then the call to ClampScrollOffsetAfterOverflowChange in
LayoutView::UpdateAfterLayout during the second layout pass (after
removing the scrollbar) will happen when the ScrollableArea's
overflow_rect_ needs updating.

BUG=711468
R=skobes@chromium.org,pdr@chromium.org,bokan@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_root_layer_scrolls;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I191a7142808851b266904b1916afc57b4b305940
Reviewed-on: https://chromium-review.googlesource.com/802179
Commit-Queue: Stefan Zager <szager@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521607}
parent fefda76f
...@@ -3,7 +3,6 @@ crbug.com/417782 compositing/layer-creation/iframe-background-attachment-fixed.h ...@@ -3,7 +3,6 @@ crbug.com/417782 compositing/layer-creation/iframe-background-attachment-fixed.h
crbug.com/417782 compositing/squashing/squash-above-fixed-1.html [ Failure ] crbug.com/417782 compositing/squashing/squash-above-fixed-1.html [ Failure ]
crbug.com/417782 compositing/squashing/squash-above-fixed-3.html [ Failure ] crbug.com/417782 compositing/squashing/squash-above-fixed-3.html [ Failure ]
crbug.com/417782 compositing/visibility/visibility-image-layers-dynamic.html [ Failure ] crbug.com/417782 compositing/visibility/visibility-image-layers-dynamic.html [ Failure ]
crbug.com/417782 [ Linux Mac ] fast/dom/horizontal-scrollbar-when-dir-change.html [ Failure ]
crbug.com/417782 fast/dom/rtl-scroll-to-leftmost-and-resize.html [ Failure ] crbug.com/417782 fast/dom/rtl-scroll-to-leftmost-and-resize.html [ Failure ]
crbug.com/417782 fast/dom/scroll-reveal-left-overflow.html [ Failure ] crbug.com/417782 fast/dom/scroll-reveal-left-overflow.html [ Failure ]
crbug.com/417782 fast/dom/scroll-reveal-top-overflow.html [ Failure ] crbug.com/417782 fast/dom/scroll-reveal-top-overflow.html [ Failure ]
......
...@@ -749,11 +749,6 @@ void LocalFrameView::SetLayoutOverflowSize(const IntSize& size) { ...@@ -749,11 +749,6 @@ void LocalFrameView::SetLayoutOverflowSize(const IntSize& size) {
return; return;
page->GetChromeClient().ContentsSizeChanged(frame_.Get(), size); page->GetChromeClient().ContentsSizeChanged(frame_.Get(), size);
// Ensure the scrollToFragmentAnchor is called before
// restoreScrollPositionAndViewState when reload
ScrollToFragmentAnchor();
GetFrame().Loader().RestoreScrollPositionAndViewState();
} }
void LocalFrameView::AdjustViewSize() { void LocalFrameView::AdjustViewSize() {
...@@ -2627,7 +2622,10 @@ void LocalFrameView::PerformPostLayoutTasks() { ...@@ -2627,7 +2622,10 @@ void LocalFrameView::PerformPostLayoutTasks() {
scrolling_coordinator->NotifyGeometryChanged(this); scrolling_coordinator->NotifyGeometryChanged(this);
} }
// If we're restoring a scroll position from history, that takes precedence
// over scrolling to the anchor in the URL.
ScrollToFragmentAnchor(); ScrollToFragmentAnchor();
GetFrame().Loader().RestoreScrollPositionAndViewState();
SendResizeEventIfNeeded(); SendResizeEventIfNeeded();
} }
......
...@@ -954,6 +954,7 @@ void PaintLayerScrollableArea::ClampScrollOffsetAfterOverflowChange() { ...@@ -954,6 +954,7 @@ void PaintLayerScrollableArea::ClampScrollOffsetAfterOverflowChange() {
return; return;
} }
UpdateScrollDimensions();
if (ScrollOriginChanged()) if (ScrollOriginChanged())
SetScrollOffsetUnconditionally(ClampScrollOffset(GetScrollOffset())); SetScrollOffsetUnconditionally(ClampScrollOffset(GetScrollOffset()));
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment