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

Clarify "same-document" and "cross-document" terminology in the explainer #3

Closed
domenic opened this issue Feb 3, 2021 · 0 comments · Fixed by #26
Closed

Clarify "same-document" and "cross-document" terminology in the explainer #3

domenic opened this issue Feb 3, 2021 · 0 comments · Fixed by #26

Comments

@domenic
Copy link
Collaborator

domenic commented Feb 3, 2021

Moved from slightlyoff/history_api#31 by @matt-buland-sfdc and summarized by me.

The explainer discusses same-document and cross-document navigations. While this concept is clear to spec people and implementers, it is not commonly used by web developers, and can cause confusion. (Additionally, I've previously gotten feedback that "cross-document" sounds kind of security-related, like "cross-origin", so maybe "different-document" would be a better name.)

The meaning of these terms is that any navigation that would normally result in a new Document object is what I call "cross-document". I believe the only "same-document" navigations are: fragment navigations, history.pushState()/appHistory.pushNewEntry(), and history.replaceState()/appHistory.updateCurrentEntry().

This should be summarized the first time the term is used. Additionally, this can help with the confusion around case (5) mentioned in slightlyoff/history_api#19.

domenic added a commit that referenced this issue Feb 5, 2021
The normative change here is to resolve "TODO: should the event even fire at all, for these latter two cases?" in the negative: i.e., the navigate event will not fire at all for non-interceptable cases. Additionally, this makes same-document fragment navigations, even initiated via browser UI or window.open(), interceptable.

Beyond that, this commit:

* Expands the discussion of navigation interception to be clearer about what "user-initiated" means
* Adds an appendix detailing all the navigations on the platform, the distinction between cross-document and same-document (closes #3), and a summary table listing how this spec works for each type.
* Discusses the connection between the navigations we're considering, and the HTML Standard algorithms.
domenic added a commit that referenced this issue Feb 5, 2021
The normative change here is to resolve "TODO: should the event even fire at all, for these latter two cases?" in the negative: i.e., the navigate event will not fire at all for non-interceptable cases. Additionally, this makes same-document fragment navigations, even initiated via browser UI or window.open(), interceptable.

Beyond that, this commit:

* Expands the discussion of navigation interception to be clearer about what "user-initiated" means
* Adds an appendix detailing all the navigations on the platform, the distinction between cross-document and same-document (closes #3), and a summary table listing how this spec works for each type.
* Discusses the connection between the navigations we're considering, and the HTML Standard algorithms.
domenic added a commit that referenced this issue Feb 8, 2021
The normative change here is to resolve "TODO: should the event even fire at all, for these latter two cases?" in the negative: i.e., the navigate event will not fire at all for non-interceptable cases. Additionally, this makes same-document fragment navigations, even initiated via browser UI or window.open(), interceptable.

Beyond that, this commit:

* Expands the discussion of navigation interception to be clearer about what "user-initiated" means
* Adds an appendix detailing all the navigations on the platform, the distinction between cross-document and same-document (closes #3), and a summary table listing how this spec works for each type.
* Discusses the connection between the navigations we're considering, and the HTML Standard algorithms.
domenic added a commit that referenced this issue Feb 9, 2021
The normative changes here are to change when the navigate event fires. In particular:

* We allow interception for programatically-initiated navigations from other windows (e.g. history.back() in a subframe), at least for now.

* We allow interception for non-back/forward fragment change only browser UI navigations (e.g. hacking the fragment in the URL bar).

* We do not fire the navigate event for non-interceptable navigations (which are now just down to a couple cases).

Beyond that, this commit:

* Expands the discussion of navigation interception to be clearer about what "user-initiated" means.

* Tries to make it clearer why cross-origin navigation interception is OK and when you would use it.

* Adds an appendix detailing all the navigations on the platform, the distinction between cross-document and same-document (closes #3), and a summary table listing how this spec works for each type.

* Discusses the connection between the navigations we're considering, and the HTML Standard algorithms.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant