-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fire the pageswap
event when navigating away from a document
#10002
Conversation
pageconceal
event when navigating away from a document
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Some minor comments about renames and clean up from removing userInitiated from the event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems much simpler now, thanks!
pageconceal
event when navigating away from a documentpageswap
event when navigating away from a document
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the hard parts look good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
It occurs to me that maybe it would be cleaner to create separate algorithms instead of the many closures. (Namely the closures for firePageSwap, unloadSteps, everything inside "Otherwise, queue a global task on the navigation and traversal task source given navigable's active window to run the steps:".) That might help keep the overall complexity of reading the algorithm from top to bottom contained.
However, doing so would require adding a good amount of parameters to those separate algorithms (to correspond to the various closed-over variables). And I'm not sure the end result would be that much better, especially since the algorithm is already huge. So, definitely not a blocker for this PR. Just something I'm curious to get your impression of.
I'm thinking that perhaps we should keep the closure style, but use something like labels or list/details to make it easier to read? |
Eh, the main thing I was hoping to get was the ability to read the algorithms top to bottom. So moving from closures to standalone functions would be a form of https://refactoring.guru/extract-method |
Together with w3c/csswg-drafts#9819.
The
pageswap
event is specified here to work as folows:NavigationActivation
object for same-origin navigations.pageswap
is fired and then unloading is deferred until the old state is captured for the view-transition or immediately if theViewTransition
is skipped.Closes #9702
pageconceal
name, will rename once the spec settles)pageswap
event mdn/mdn#528(See WHATWG Working Mode: Changes for more details.)
/browsing-the-web.html ( diff )
/document-lifecycle.html ( diff )
/index.html ( diff )
/indices.html ( diff )
/infrastructure.html ( diff )
/nav-history-apis.html ( diff )
/sections.html ( diff )
/webappapis.html ( diff )