New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 603376 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug

Blocking:
issue 558575



Sign in to add a comment

can't scroll mdn with scroll anchoring enabled

Project Member Reported by ojan@chromium.org, Apr 14 2016

Issue description

1. Go to https://developer.mozilla.org/en-US/docs/Web/Events/visibilitychange
2. Scroll down. You keep getting scrolled back to the top.
 

Comment 1 by ymalik@chromium.org, Apr 18 2016

Cc: skobes@chromium.org
Status: Available (was: Untriaged)
After some investigation, here's what I think is happening.

We have a div on the right that becomes position:fixed once it is about to be scrolled out of view (simulating position:sticky).

The html for the floating panel is roughly as follows:

<div id = "div1" style="float:right">
  <div id="div2">
     This becomes position:fixed
  </div>
</div>

When we start scrolling past div1, JS on the page adds position:fixed to div2 which causes a layout, triggering the Scroll Anchor Save->Restore logic. We pick div1 as the anchor and adjust the scroll position because it scrolls with the scroller (div2 is what's actually fixed). Once the scroll position is adjusted, JS on the page removes position:fixed from div2 (because we adjust upwards and no longer need position:fixed) which causes another layout and an adjustment of the scroll offset to a location where position:fixed is added again.

This issue is very similar to  issue 601906 , where the root cause is that the changes made by JS interfere with the adjustments we make.
Project Member

Comment 2 by bugdroid1@chromium.org, May 18 2016

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

commit 2fd28b5102e73c49b3891d9bc7c05ffda979e2ea
Author: skobes <skobes@chromium.org>
Date: Wed May 18 21:27:18 2016

Implement bounce suppression in ScrollAnchor.

An element can "bounce", by making the inverse of its last movement, when a
scroll anchoring adjustment interacts with a scroll event handler that changes
layout at a scroll offset threshold.

ScrollAnchor now detects bounces by tracking the most recent adjustment and the
element that triggered it (even if we have anchored to a different element since
then), and suppresses repeat bounces.

BUG= 598233 , 601906 , 603376 

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

[add] https://crrev.com/2fd28b5102e73c49b3891d9bc7c05ffda979e2ea/third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/onscroll-bouncing.html
[modify] https://crrev.com/2fd28b5102e73c49b3891d9bc7c05ffda979e2ea/third_party/WebKit/Source/core/layout/LayoutObject.cpp
[modify] https://crrev.com/2fd28b5102e73c49b3891d9bc7c05ffda979e2ea/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
[modify] https://crrev.com/2fd28b5102e73c49b3891d9bc7c05ffda979e2ea/third_party/WebKit/Source/core/layout/ScrollAnchor.h

Cc: -ymalik@chromium.org
Owner: skobes@chromium.org
Need to verify.
Cc: -skobes@chromium.org ymalik@chromium.org
Status: Fixed (was: Available)
This is fixed.

Comment 5 by skobes@chromium.org, Jul 20 2016

Cc: skobes@chromium.org
 Issue 629849  has been merged into this issue.

Sign in to add a comment