New issue
Advanced search Search tips

Issue 626315 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocking:
issue 456622



Sign in to add a comment

ScrollableArea::scrollPositionChanged() updates scrollAnimator with non-clamped position

Project Member Reported by eseckler@chromium.org, Jul 7 2016

Issue description

Currently, ScrollableArea updates the scrollAnimator with the argument to scrollPositionChanged(), which may lie outside the min/max scroll position of the area. Instead, it should use the clamped new scroll position obtained from the subclass through scrollPositionDouble().
 
Cc: -bokan@chromium.org skobes@chromium.org eseckler@chromium.org
Owner: bokan@chromium.org
Status: Assigned (was: Started)
Since ScrollableArea may store truncated integer offsets rather than fractional offsets, and Scrollanimator always uses fractional offsets, we cannot currently keep the scroll positions of both in sync. Thus, we cannot pass ScrollableArea::scrollPositionDouble() to the animator in scrollPositionChanged().

We also can't easily clamp in ScrollableArea::scrollPositionChanged(), because PaintLayerScrollableArea may be updated with non-clamped positions.

It seems the best way to solve this would be to always store fractional positions in both the animator and ScrollableArea, so that we can keep both in sync. Then, truncating (for the case that FractionalScrollOffsets is disabled) needs to happen at the web API boundary. Assigning this to bokan@ for the time being.

For further details, see the discussion on https://codereview.chromium.org/2124973004/ .
Project Member

Comment 2 by bugdroid1@chromium.org, Jul 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3f022f5dd7dba6eb56ea8f27ff8636fd33bb0543

commit 3f022f5dd7dba6eb56ea8f27ff8636fd33bb0543
Author: eseckler <eseckler@chromium.org>
Date: Tue Jul 12 08:07:20 2016

Clamp in VisualViewport::setScrollPosition.

This avoids situations where the viewport's scroll animator may be
updated with non-clamped positions by ScrollableArea::setScrollPosition
and RootFrameViewport's scrolling may behave incorrectly.

BUG=626315

Review-Url: https://codereview.chromium.org/2138823002
Cr-Commit-Position: refs/heads/master@{#404799}

[modify] https://crrev.com/3f022f5dd7dba6eb56ea8f27ff8636fd33bb0543/third_party/WebKit/Source/core/frame/VisualViewport.cpp
[modify] https://crrev.com/3f022f5dd7dba6eb56ea8f27ff8636fd33bb0543/third_party/WebKit/Source/core/frame/VisualViewport.h

Comment 3 by bokan@chromium.org, Nov 23 2017

Blocking: 456622
This is still relevant, though the method name has since changed to ScrollableArea::ScrollOffsetChanged().

This would likely need to be fixed when we enable Blink to keep fractional scroll offsets so blocking that bug here.

Sign in to add a comment