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

Issue 642279 link

Starred by 2 users

Issue metadata

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



Sign in to add a comment

Scroll position restoration is inconsistent

Project Member Reported by toyoshim@chromium.org, Aug 30 2016

Issue description

For Omnibox+Enter to the same page
- Omnibox+Enter without any scale change => Don't reset scroll position (and scale)
- Omnibox+Enter after scale being changed => Reset scroll position and scale

For other same page navigations (e.g., clink anchor to the same URL, embedder requesting to load the same URL)
- Clink an anchor to the current page without any scale change => Reset scroll position (and scale)
- Clink an anchor to the current page after scale being changed => Don't reset scale, scroll position jumps to a half position

In terms of the spec, scroll position and scale factor belong to "user state" and should be restored in the same way.
https://html.spec.whatwg.org/multipage/browsers.html#persisted-user-state-restoration

Also, Chrome UI design principle (by aelias@) is that scale should be treated like simply a part of the scroll position data structure.

This discussion originally happened at  crbug.com/632358#c30 
 
Note: new reload behavior will be launched soon. Once it is enabled by default, reload and omnibox+enter will take the same behavior, "don't reset user content". So, the former case isn't so important, but the latter case may need a fix.

Comment 2 by aelias@chromium.org, Aug 30 2016

Cc: aelias@chromium.org bokan@chromium.org
Status: Available (was: Untriaged)
These observations are based on what platform?  On Android 53.0.2785.80, I can't repro the described behavior.  None of the four scenarios reset the scroll or scale.  Is this perhaps a desktop-specific bug?

Comment 3 by bokan@chromium.org, Aug 30 2016

What I'm seeing in Stable (52.0.2743.98) on Android:

Omnibox+Enter always resets (scroll => (0, 0), scale=>1) regardless of whether we scaled or not.

Reload/Refresh tries to restore the old scroll and scale values, again, regardless of whether we scaled or not.

For other same page navigations, the "half position" you're seeing is probably that we set the scroll position to navigate to the anchor but do so for the layout viewport without resetting the visual viewport to (0, 0). We should probably do that but it's a minor issue.

There shouldn't be a difference in behavior depending on whether we scaled or not (and I can't see it). If there is, that's a regression.

I'm on Android Chrome 52.0.2743.98 / Nexus 5X, and navigate to http://yuri.twintail.org/chrome/reload/fragment.html
This page has a 'link to self html' anchor to navigate to the same page for the latter case.

Sorry, my report for Omnibox+Enter was wrong. But it just results are swapped. Still I can see the problem.

- Omnibox+Enter without any scale change => Reset scroll position and scale
- Omnibox+Enter after scale being changed => Don't reset scale, scroll position jumps to a half position

In some pages, they are managing initial scroll position by themselves. In such case, this problem may not happen.

Comment 5 by bokan@chromium.org, Sep 2 2016

Owner: chaopeng@chromium.org
Ok, maybe the pages I were looking at were managing it themselves. I've now reproduced the "half position" restore (seems we're resetting the main frame scroll offset but not the visual viewport) which is certainly a bug.

chaopeng@, please take a look when you have a chance.
Status: Started (was: Available)

Comment 7 Deleted

Status: Started (was: Fixed)
Project Member

Comment 9 by bugdroid1@chromium.org, Sep 16 2016

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

commit 4521a9bb2402ebfffd709f02413ba3ec5a70de46
Author: chaopeng <chaopeng@chromium.org>
Date: Fri Sep 16 14:54:25 2016

Reset VisualViewport position after same page navigation

This issue can be reproduced using pinch zoom in Android, ChromeOS and Mac.

After navigating to the **exact** same page, we create a new FrameView but
reuse the VisualViewport, meaning its scroll position remains unchanged even
though it was relative to an old FrameView.

In this patch, we reset the VisualViewport position in Page::didCommitLoad
since prior to here we would overwrite the old history item.

BUG= 642279 

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

[add] https://crrev.com/4521a9bb2402ebfffd709f02413ba3ec5a70de46/third_party/WebKit/LayoutTests/fast/scrolling/same-page-navigate.html
[modify] https://crrev.com/4521a9bb2402ebfffd709f02413ba3ec5a70de46/third_party/WebKit/Source/core/page/Page.cpp
[modify] https://crrev.com/4521a9bb2402ebfffd709f02413ba3ec5a70de46/third_party/WebKit/Source/core/testing/Internals.cpp
[modify] https://crrev.com/4521a9bb2402ebfffd709f02413ba3ec5a70de46/third_party/WebKit/Source/core/testing/Internals.h
[modify] https://crrev.com/4521a9bb2402ebfffd709f02413ba3ec5a70de46/third_party/WebKit/Source/core/testing/Internals.idl

Status: Fixed (was: Started)
Labels: Hotlist-Input-Dev

Comment 12 by jeevan.k...@os.uk, Oct 17 2016

Doesn't look fixed to me, see attached.
index.html
1.3 KB View Download
hash-test.mov
6.8 MB Download

Comment 13 by bokan@chromium.org, Oct 17 2016

Thanks for the report. I think this is actually a separate bug due to the scroller being nested, this seems to work fine for the main window (e.g. https://en.wikipedia.org/wiki/Cat#Senses works correctly when reloaded or navigated).  I've filed your repro at  issue 656658 

Sign in to add a comment