html
html copied to clipboard
Add navigation hooks for WebDriver BiDi history traversal
WebDriver BiDi wants to invoke the 'traverse the history by a delta` algorithm, and get a callback whenever the algoritihm has run to completion, either by failing or by the navigation or state restoration completing.
https://github.com/w3c/webdriver-bidi/pull/109 is the WebDriver BiDi side of this change.
/browsing-the-web.html ( diff ) /history.html ( diff ) /infrastructure.html ( diff )
I'll review Monday (although can you try fixing the build first?).
Sadly this algorithm does not match browsers very well, but I imagine we can slot something in for now. /cc @jakearchibald as something to take into account when rewriting.
@jgraham Can I help make progress on this somehow? It's blocking https://github.com/w3c/webdriver-bidi/pull/109, right?
At this point, any work in this area should be done against the branch in #6315. Note that traversing can traverse multiple frames (and this is much more explicit in that branch), or maybe zero (if bfcache is not in effect and the server ends up with a 204/download). I imagine that might affect the "one callback, once" idea...
https://github.com/whatwg/html/pull/6315 has been merged now so this could be rebased. @jgraham do you think you'll get a chance to do that? Happy to help if that would be... helpful.
I tried to resolve conflicts, but everything except the first 2-line change to link definitions conflicts. I think the best approach is to go hook-by-hook and find the right place to invoke it in the new spec:
- [ ] WebDriver BiDi navigation failed
- [x] WebDriver BiDi page show
- [x] WebDriver BiDi pop state
- [x] WebDriver BiDi fragment navigated
OK, I've put everything where I think it needs to be. I'll do a self-review to point out things I'd like feedback on.
Looking some more at this, I'm not sure we we need to add additional callbacks. https://github.com/whatwg/html/pull/6315 did a lot of refactoring and it's now easier to follow whether a callback is always reached.
I spotted one error that I'm fixing in https://github.com/whatwg/html/pull/8939.