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

More navigation flags cleanup #5847

Closed
domenic opened this issue Aug 19, 2020 · 1 comment · Fixed by #5858
Closed

More navigation flags cleanup #5847

domenic opened this issue Aug 19, 2020 · 1 comment · Fixed by #5858
Assignees
Labels
clarification Standard could be clearer topic: navigation

Comments

@domenic
Copy link
Member

domenic commented Aug 19, 2020

I'm trying to make all the inputs to the navigation algorithm explicit. I think this is the comprehensive list:

I'd like to focus here on reload-triggered, entry update, and replacement enabled, as I think they can be consolidated. In particular, looking at the call sites:

  • location.reload() and user-triggered reloads set reload-triggered = true, entry update = true, replacement enabled = false
  • History traversal with no bfcache entry (traverse the history step 1) sets reload-triggered = false, entry update = true, replacement enabled = false
  • A bunch of places use replacementEnabled, but never in combination with the other two.

So I think we should convert these three into a new parameter, call it historyHandling, with the following values. Here I use (x, y, z) to represent the values of (reload-triggered, entry update, replacement enabled).

  • "default": equivalent to (false, false, false)
  • "reload": equivalent to (true, true, false)
  • "entry update": equivalent to (false, true, false)
  • "replace": equivalent to (false, false, true)

This seems like a big improvement, since it makes it clear there are only 4 valid states, not 23 = 8.

Any bikeshedding on these names is welcome. Example ideas:

  • "reload entry update" instead of just "reload"
  • "repopulate bfcache" instead of "entry update"
@domenic domenic added clarification Standard could be clearer topic: navigation labels Aug 19, 2020
@annevk
Copy link
Member

annevk commented Aug 20, 2020

cc @mystor @smaug----

domenic added a commit that referenced this issue Aug 24, 2020
Fixes #5847, by consolidating the explicit replacementEnabled with the
previously-implicit "reload-triggered navigation" and "entry update"
booleans. They are now unified into a "history handling" parameter,
which is explicitly passed in as needed, and makes it clear what the
four possible history handling behaviors are.
domenic added a commit that referenced this issue Aug 24, 2020
Fixes #5847, by consolidating the explicit replacementEnabled with the
previously-implicit "reload-triggered navigation" and "entry update"
booleans. They are now unified into a "history handling" parameter,
which is explicitly passed in as needed, and makes it clear what the
four possible history handling behaviors are.
@domenic domenic self-assigned this Aug 24, 2020
domenic added a commit that referenced this issue Aug 25, 2020
Fixes #5847, by consolidating the explicit replacementEnabled with the
previously-implicit "reload-triggered navigation" and "entry update"
booleans. They are now unified into a "history handling" parameter,
which is explicitly passed in as needed, and makes it clear what the
four possible history handling behaviors are.
mfreed7 pushed a commit to mfreed7/html that referenced this issue Sep 11, 2020
Fixes whatwg#5847, by consolidating the explicit replacementEnabled with the
previously-implicit "reload-triggered navigation" and "entry update"
booleans. They are now unified into a "history handling" parameter,
which is explicitly passed in as needed, and makes it clear what the
four possible history handling behaviors are.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer topic: navigation
Development

Successfully merging a pull request may close this issue.

2 participants