Anchor scroll to iframe when empty hash in parent URL
Reported by
veevers....@gmail.com,
Mar 7 2017
|
||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 Steps to reproduce the problem: 1. Open file in Chrome and append an empty hash (#) to URL 2. Reload page 3. Browser will scroll jump to top of iframe What is the expected behavior? No scroll jump to iframe. What went wrong? Removing the style tag from the head of iframe document "solves" the issue. I'm guessing it's causing a reflow and jump-to-anchor logic is erroneously triggered at that point. Few more notes: - Does not happen when src set to a URL (but does happen when set to about:blank) - Does not happen when hash in parent URL is not empty. "#foo" does not scroll, whereas "#" does. - Works correctly in Firefox latest and Safari latest on Mac Did this work before? N/A Does this work in other browsers? Yes Chrome version: 56.0.2924.87 Channel: stable OS Version: OS X 10.12.3 Flash Version: Maybe related issue: https://bugs.chromium.org/p/chromium/issues/detail?id=446756#
,
Mar 8 2017
Tested on Mac os 10.12.2 using chrome M56 #56.0.2924.87 and followed below steps : 1. Launched chrome and navigated to sample url given in issue 446756 i.e.,http://img04.taobaocdn.com/tfscom/TB1_hhLHXXXXXXqXFXXO04pFXXX.html 2. Appended # to the url end and reloaded the page 3. Page scroll jumps to the first ., observed same behavior in firefox and safari browsers too. Attached screencast for reference. @veevers.paul-- Could you please check attached screencast and confirm us if anything we missed from our side to reproduce the issue and also provide us the test url and expected result screencast , that would help us in traiging the issue better. Thanks!
,
Mar 8 2017
,
Mar 9 2017
veevers.paul@gmail.com: Did you forget to attach a sample page? Also, when you say reload, do you mean pressing "Enter" with focus in the omnibox? Or actually clicking reload? (I assume the former since you added the hash)
,
Mar 9 2017
Also, unless it's a regression, reducing to normal priority.
,
Mar 9 2017
,
Mar 15 2017
Ah yes, very sorry I forgot the attachment. Here it is. Thanks for the responses.
,
Mar 15 2017
bokan@chromium.org: Either way seems to reproduce it.
,
Mar 15 2017
Thank you for providing more feedback. Adding requester "hdodda@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Mar 16 2017
Able to reproduce the issue on Windows 10, mac 10.12.3 and Ubuntu 14.04 using chrome reported version #56.0.2924.87 and latest canary #59.0.3042.4. Bisect Information: ===================== Good build: 56.0.2913.0 Revision(430459) Bad Build : 56.0.2914.0 Revision(430837) Change Log URL: https://chromium.googlesource.com/chromium/src/+log/5db5553160affb9ea2464666320c3855e5d203d2..b8cb16f79a95c8bc639a9c58785a8484c197aca9 From the above change log suspecting below change Review url: https://codereview.chromium.org/2269043002 hiroshige@ - Could you please check whether this is caused with respect to your change, if not please help us in assigning it to the right owner. Thanks...!!
,
Mar 17 2017
,
Apr 4 2017
Hmm. Looks like the scroll (unexpectedly) occurs if doc.write() is called after a certain point of time. The <style> tag + https://codereview.chromium.org/2269043002 makes iframe's load event to occur a little later and thus causes the issue. However, setTimeout() can also be used to delay doc.write() (see the attached test case).
,
Apr 4 2017
Created a layout test: https://codereview.chromium.org/2797783002/ And the test fails even at r406082 on Linux. I suspect this is not a recent regression: my CL just exposed an existing issue in scrolling. bokan@, could you take a look?
,
Apr 4 2017
,
Apr 4 2017
r266359 is also failing.
,
Apr 5 2017
Thank you hiroshige@ for the analysis and test, that will help. I'll take a look - I'm guessing our scroll to fragment logic is being triggered incorrectly.
,
Apr 6 2017
,
Apr 24 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/783d491b68d1b5833b65accba2e4fd595f09a404 commit 783d491b68d1b5833b65accba2e4fd595f09a404 Author: bokan <bokan@chromium.org> Date: Mon Apr 24 21:21:39 2017 Clear hash when setting URL in document.open() A document created via document.open()/write()/close() will have as its URL the "responsible document" (see step #23 of https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open) This is a problem when the URL includes a fragment identifier, any frame with a document.open from a document with a fragment will try to scroll the iframe into view. I believe the intent in the spec was not to include the hash. BUG= 699267 Review-Url: https://codereview.chromium.org/2801093002 Cr-Commit-Position: refs/heads/master@{#466770} [add] https://crrev.com/783d491b68d1b5833b65accba2e4fd595f09a404/third_party/WebKit/LayoutTests/fast/scrolling/doc-write-to-iframe.html [modify] https://crrev.com/783d491b68d1b5833b65accba2e4fd595f09a404/third_party/WebKit/Source/core/dom/Document.cpp
,
Apr 25 2017
Confirmed fix in Canary, this would be good to merge back to 59
,
Apr 25 2017
Your change meets the bar and is auto-approved for M59. Please go ahead and merge the CL to branch 3071 manually. Please contact milestone owner if you have questions. Owners: amineer@(Android), cmasso@(iOS), gkihumba@(ChromeOS), Abdul Syed@(Desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 26 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6c3f14d345e3a04319074eced38eec423b8cd537 commit 6c3f14d345e3a04319074eced38eec423b8cd537 Author: David Bokan <bokan@chromium.org> Date: Wed Apr 26 18:15:25 2017 Clear hash when setting URL in document.open() A document created via document.open()/write()/close() will have as its URL the "responsible document" (see step #23 of https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open) This is a problem when the URL includes a fragment identifier, any frame with a document.open from a document with a fragment will try to scroll the iframe into view. I believe the intent in the spec was not to include the hash. BUG= 699267 Review-Url: https://codereview.chromium.org/2801093002 Cr-Commit-Position: refs/heads/master@{#466770} (cherry picked from commit 783d491b68d1b5833b65accba2e4fd595f09a404) Review-Url: https://codereview.chromium.org/2843763005 . Cr-Commit-Position: refs/branch-heads/3071@{#232} Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641} [add] https://crrev.com/6c3f14d345e3a04319074eced38eec423b8cd537/third_party/WebKit/LayoutTests/fast/scrolling/doc-write-to-iframe.html [modify] https://crrev.com/6c3f14d345e3a04319074eced38eec423b8cd537/third_party/WebKit/Source/core/dom/Document.cpp
,
Apr 26 2017
,
Apr 27 2017
Verified this issue on Windows-10, Ubuntu 14.04 and Mac OS 10.12.4 using chrome latest beta M59 #59.0.3071.29 by following steps mentioned in the original comment using test case provided in the comment #7. Observed no scroll jump to iframe as expected. Hence adding TE-Verified label.
,
May 18 2017
Issue 596051 has been merged into this issue. |
||||||||||||||||||||
►
Sign in to add a comment |
||||||||||||||||||||
Comment 1 by manoranj...@chromium.org
, Mar 7 2017