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

Issue 764605 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: 2017-10-12
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Chrome not following hash anchor if URL is opened in a new background tab

Reported by term...@gmail.com, Sep 13 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.0; rv:52.0) Gecko/20100101 Firefox/52.0

Example URL:
https://helpx.adobe.com/flash-player/kb/installation-problems-flash-player-windows.html#main-pars_text_8

Steps to reproduce the problem:
1. Show the bookmarks bar
2. Click on the bookmarks bar 'Add page'
3. Add a page with the URL https://helpx.adobe.com/flash-player/kb/installation-problems-flash-player-windows.html#main-pars_text_8
4. Click on that URL, observe it goes to the anchor 'Still having problems?'
5. Now middle-click on the URL to open it in a new tab, and observe it stays at the top of the page and doesn't go to the anchor.

What is the expected behavior?
It should go to the anchor regardless of how I open the page

What went wrong?
No idea

Does it occur on multiple sites: N/A

Is it a problem with a plugin? N/A 

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: Version 61.0.3163.79 (Official Build) (64-bit)  Channel: stable
OS Version: 6.1
Flash Version:
 
Labels: Needs-Triage-M61

Comment 2 by woxxom@gmail.com, Sep 13 2017

It should be noted that the problem is specific to that Adobe site because it hides the page body by default via CSS, checks the hash part and scrolls to the anchor using its javascript.

Non-interactive pages with anchors are displayed/scrolled correctly regardless of being opened in background.
Components: UI>Browser>NewTabPage
Labels: -Type-Compat M-63 OS-Linux OS-Mac Type-Bug
Status: Untriaged (was: Unconfirmed)
Able to reproduce this issue on Mac 10.12.6, Win-10 and Ubuntu 14.04 using chrome reported version #61.0.3163.79 and latest canary #63.0.3214.0.

This is a non-regression issue as it is observed from M50 old builds. 

Hence, marking it as untriaged to get more inputs from dev team.

Thanks...!!

Comment 4 by treib@chromium.org, Sep 14 2017

Components: -UI>Browser>NewTabPage UI>Browser>Navigation
This is not related to the NTP. Not sure how to classify it.

Comment 5 by creis@chromium.org, Sep 14 2017

Cc: pnoland@chromium.org chrisha@chromium.org panicker@chromium.org nasko@chromium.org lukasza@chromium.org creis@chromium.org
Components: Blink>Scroll
Summary: Chrome not following hash anchor if URL is opened in a new background tab (was: Chrome not following hash anchor if URL is opened in a new tab)
I can repro in 61.0.3163.91, with and without PlzNavigate (BrowserSideNavigation).

The bug seems to repro for both middle-click and "Open in new tab" from the context menu (which use different code paths), but not for shift-click or "Open in new window" from the context menu.  That suggests it only affects links opened specifically in background tabs.  It affects both bookmarks and links in normal web pages.

Comment 2 is interesting.  For links to a simpler page like https://www.chromium.org/developers#TOC-Blink, the page *does* scroll when opening in the background, but it scrolls to the wrong place (too far).  It should show "Blink" at the top, but when opening the link in a background tab, it jumps all the way to "Web Platform Tests" and scrolls "Blink" well off the top of the page.

I suspect this may be related to some scrolling logic and/or optimizations for background tabs?  Adding chrisha@ and panicker@ to help triage, and pnoland@ in case scroll anchoring might be involved.

Comment 6 by panicker@google.com, Sep 14 2017

we haven't made any recent changes for background tabs that I am aware of that might cause this issue.
I don't think this is scroll anchor related, nor is it apparent to me that it's a Chrome bug at all. As #2 points out, the page has custom logic for scrolling to elements using the hash fragment. Furthermore, the page in question doesn't have an element with the id "#main-pars_text_8" at all. So the failure to scroll to the desired location in the page is purely a failure of this custom logic. I can only speculate as to why this works when the page is foreground loaded but not otherwise.

Comment 8 by creis@chromium.org, Sep 14 2017

Labels: Needs-Bisect
Comment 7: I'd still be concerned about scrolling to the wrong location in the simpler page (from comment 5).  Seems like it's worth understanding why there's a difference between foreground and background, since I wouldn't otherwise expect it here.

I'll request a bisect to see if it's a regression, but maybe it's just a matter of Blink not being able to scroll properly if it doesn't actually paint the page?
I agree that if what you describe in #5 is happening reliably then it's concerning; FWIW I wasn't able to repro that behavior in any of the milestones or platforms I tried. 

Comment 10 by creis@chromium.org, Sep 14 2017

Components: Platform>DevTools
Interesting-- the Chromium link issue is not currently repro'ing for me from the bookmarks bar, but it does for links on a web page when DevTools is open!

More specific steps (based on what I saw in #5):
1) Visit http://csreis.github.io/tests/
2) Right click the first link and choose Inspect (opening DevTools docked within the tab).
3) Double click the href for the link and replace it with https://www.chromium.org/developers#TOC-Blink.
4) Middle click the link, while DevTools is still open.

Repros on both 61.0.3163.91 and 63.0.3215.0.

I wonder why the presence of DevTools in one tab affects how a newly opened background tab scrolls?
Cc: sc00335...@techmahindra.com
Labels: -Needs-Bisect Triaged-ET
Tested the issue with steps mentioned in comment#10 and is reproducible on latest stable 61.0.3163.91 and latest canary 63.0.3215.0 using Ubuntu 14.04,Windows 10 and Mac 10.12.1.

Issue is seen from M50 series[50.0.2661.0]. Attaching screencast for reference..
Issue 764605.ogv
1.6 MB View Download
Cc: -chrisha@chromium.org dgozman@chromium.org
Note that the platform devtools scroll issue doesn't happen if it is docked at the bottom or in a new window or the page is opened in an incognito window or a new window (ie. it only happens on a new tab).

dgozman@ any idea?
This is due to this [1] line. DevTools docked to the right changes the width of active tab, newly opened tab gets that width and scrolls to the anchor. Once you switch to it, we resize it because there is no DevTools open for new tab, and scroll position changes. You can even see briefly the old-sized content sometimes.

Although there is a TODO next to the problematic line, it has been there for a long time so changing this significantly will surely break things. I don't see an easy way to fix the DevTools usecase, so it's probably not worth doing. This is a first time I see someone complain.

[1] https://cs.chromium.org/chromium/src/chrome/browser/ui/tabs/tab_strip_model.cc?rcl=769a874fb57870662933ad0a7083b4e50c838149&l=818
Components: -Platform>DevTools
NextAction: 2017-10-12
Thanks dgozman@, that explains the problem in  issue #5 . The original issue seems likely to be a page issue and I can't repro it with 63.0.3230.0, perhaps the page itself was fixed? Any objections to closing this?
^^ erm, "that explains the problem in _comment_ #5"
The NextAction date has arrived: 2017-10-12

Comment 18 by bokan@chromium.org, Oct 12 2017

Status: WontFix (was: Untriaged)

Sign in to add a comment