Chromium Code Reviews

Issue 2801093002: Clear hash when setting URL in document.open (Closed)

Created:
3 years, 8 months ago by bokan
Modified:
3 years, 8 months ago
Reviewers:
skobes
CC:
chromium-reviews, blink-reviews, blink-reviews-frames_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

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} Committed: https://chromium.googlesource.com/chromium/src/+/783d491b68d1b5833b65accba2e4fd595f09a404

Patch Set 1 #

Patch Set 2 : Fix RLS #

Patch Set 3 : Nit fix to test #

Patch Set 4 : Clear hash for document.open #

Total comments: 4

Patch Set 5 : Rebase + Only clear hash on cross-frame open() #

Unified diffs Side-by-side diffs Stats (+43 lines, -1 line)
A third_party/WebKit/LayoutTests/fast/scrolling/doc-write-to-iframe.html View 1 chunk +34 lines, -0 lines 0 comments
M third_party/WebKit/Source/core/dom/Document.cpp View 1 chunk +9 lines, -1 line 0 comments

Messages

Total messages: 35 (22 generated)
bokan
3 years, 8 months ago (2017-04-06 22:19:56 UTC) #9
skobes
I'm confused. Doesn't an iframe have its own URL and hash fragment, independent of other ...
3 years, 8 months ago (2017-04-11 20:15:02 UTC) #12
bokan
On 2017/04/11 20:15:02, skobes wrote: > I'm confused. Doesn't an iframe have its own URL ...
3 years, 8 months ago (2017-04-12 12:50:44 UTC) #13
bokan
On 2017/04/12 12:50:44, bokan wrote: > On 2017/04/11 20:15:02, skobes wrote: > > I'm confused. ...
3 years, 8 months ago (2017-04-13 13:22:14 UTC) #14
skobes
On 2017/04/13 13:22:14, bokan wrote: > Ok, I figured out what's going on. The test ...
3 years, 8 months ago (2017-04-14 22:20:43 UTC) #15
bokan
On 2017/04/14 22:20:43, skobes wrote: > On 2017/04/13 13:22:14, bokan wrote: > > Ok, I ...
3 years, 8 months ago (2017-04-18 19:47:39 UTC) #16
bokan
On 2017/04/18 19:47:39, bokan wrote: > On 2017/04/14 22:20:43, skobes wrote: > > On 2017/04/13 ...
3 years, 8 months ago (2017-04-21 15:59:38 UTC) #22
bokan
Also, see b/24408263 (Google internal) for a case where this is causing issues. We may ...
3 years, 8 months ago (2017-04-21 16:03:34 UTC) #23
skobes
I'm not sure it's better for document.open() to set the hash without causing a scroll, ...
3 years, 8 months ago (2017-04-21 17:19:57 UTC) #24
bokan
https://codereview.chromium.org/2801093002/diff/60001/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (right): https://codereview.chromium.org/2801093002/diff/60001/third_party/WebKit/Source/core/dom/Document.cpp#newcode2731 third_party/WebKit/Source/core/dom/Document.cpp:2731: // Clear the hash fragment from the inerited URL ...
3 years, 8 months ago (2017-04-24 17:39:04 UTC) #27
skobes
lgtm
3 years, 8 months ago (2017-04-24 18:21:14 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2801093002/80001
3 years, 8 months ago (2017-04-24 21:13:56 UTC) #32
commit-bot: I haz the power
3 years, 8 months ago (2017-04-24 21:21:59 UTC) #35
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/783d491b68d1b5833b65accba2e4...

Powered by Google App Engine