Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What object is History associated with #2566

Closed
annevk opened this issue Apr 20, 2017 · 10 comments · Fixed by #6315
Closed

What object is History associated with #2566

annevk opened this issue Apr 20, 2017 · 10 comments · Fixed by #6315
Labels
interop Implementations are not interoperable with each other topic: history

Comments

@annevk
Copy link
Member

annevk commented Apr 20, 2017

HTML says Document, but #2545 (comment) suggests Window, at least in Firefox (other browsers seem impossible to test). @bzbarsky?

@annevk annevk added interop Implementations are not interoperable with each other topic: history labels Apr 20, 2017
@bzbarsky
Copy link
Contributor

In Gecko history is in fact associated with the Window.

It doesn't matter too hugely much in practice, because the History always represents the entire browsing context tree anyway, right? We could put it on the Document, but that's a bit weird given that the getter for it is on the Window...

@annevk
Copy link
Member Author

annevk commented May 8, 2017

It seems to matter at least for navigating initial about:blank cross-origin. Handling that would require a complete revamp and complicate out-of-process child browsing contexts.

@bzbarsky
Copy link
Contributor

bzbarsky commented May 8, 2017

It seems to matter at least for navigating initial about:blank cross-origin.

I'm not sure I follow. Why does it matter there? In that case you get a new Document and you get a new Window, right?

@annevk
Copy link
Member Author

annevk commented May 8, 2017

That wasn't clear to me. And doesn't seem to be defined although I'm probably missing something. (If it is defined, we should update the initial about:blank notes to point out that this only happens same-origin.)

@domenic
Copy link
Member

domenic commented May 8, 2017

+1 to it wasn't clear to me. Indeed because most of my intuitive, top-of-the-mind understanding of that case is based on recalling non-normative notes.

@bzbarsky
Copy link
Contributor

bzbarsky commented May 8, 2017

And doesn't seem to be defined although I'm probably missing something.

https://html.spec.whatwg.org/multipage/browsers.html#initialise-the-document-object step 3 says:

If browsingContext's only entry in its session history is the about:blank Document that was added when browsingContext was created, and navigation is occurring with replacement enabled, and that Document has the same origin as the new Document

note that "has the same origin" check.

@bzbarsky
Copy link
Contributor

bzbarsky commented May 8, 2017

And I certainly agree that finding that this is the relevant part of the spec is not simple, by the way! I am in no way averse to making this stuff clearer somehow...

@domenic
Copy link
Member

domenic commented May 8, 2017

In addition to making the spec clearer, it might be a good idea to add another test case to https://github.com/w3c/web-platform-tests/blob/master/common/object-association.js for cross-origin navigation (that tests that the object does change).

@annevk
Copy link
Member Author

annevk commented May 9, 2017

@domenic you can only observe it changes with Location, but that might be enough to be worth it.

@croraf
Copy link

croraf commented Dec 9, 2020

Any progress on this. Should it be changed in https://html.spec.whatwg.org/multipage/history.html#the-session-history-of-browsing-contexts into something like:

the window is associated with a unique History object.

domenic added a commit to web-platform-tests/wpt that referenced this issue Oct 10, 2022
This is done by expanding the object-association.js helper and using it.

See whatwg/html#2566.
domenic added a commit to web-platform-tests/wpt that referenced this issue Oct 12, 2022
This is done by expanding the object-association.js helper and using it.

We can also remove an outdated workaround in that file for extra load events, since no modern browsers suffer from that.

See whatwg/html#2566.
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 21, 2022
…ument, not Window, a=testonly

Automatic update from web-platform-tests
Test that History is associated with Document, not Window

This is done by expanding the object-association.js helper and using it.

We can also remove an outdated workaround in that file for extra load events, since no modern browsers suffer from that.

See whatwg/html#2566.
--

wpt-commits: 09427933ac4883cb6cbe756eaa9c980eb8b76b1d
wpt-pr: 36367
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Oct 26, 2022
…ument, not Window, a=testonly

Automatic update from web-platform-tests
Test that History is associated with Document, not Window

This is done by expanding the object-association.js helper and using it.

We can also remove an outdated workaround in that file for extra load events, since no modern browsers suffer from that.

See whatwg/html#2566.
--

wpt-commits: 09427933ac4883cb6cbe756eaa9c980eb8b76b1d
wpt-pr: 36367
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interop Implementations are not interoperable with each other topic: history
Development

Successfully merging a pull request may close this issue.

4 participants