Fire a load event for javascript: URL non-strings#10957
Conversation
I suppose the PR matches Chrome in that a |
|
Just noting that this is on my queue, although @domfarolino and @natechapin might also be interested. |
domenic
left a comment
There was a problem hiding this comment.
I guess the end result here is fine, but the spec is so ugly 😅. I wonder how this is implemented in WebKit and Blink, and if it is similarly ugly or if it falls out more naturally in some way?
One idea would be that instead of passing a parameter to navigate, you always check if the "navigate to a javascript: URL" is being performed in a child navigable, and if so, fire the event on the navigable container? That would be different than this in that:
- It would also fire load events for embed and object
- It would also fire if code did
iframe.contentWindow.location.href = "javascript:undefined"
Maybe writing tests for those scenarios would be instructive?
|
Navigations to No
|
|
Darn. I've asked @natechapin to see if we can understand Chromium's behavior better, and maybe find a more elegant solution inspired by that. But given what you've checked so far, this seems to be the best way forward. |
|
An approach I considered was to check for |
|
I've added more tests now in web-platform-tests/wpt#50193 |
|
Nate has gone out of office, and we seem to have landed something that caused a merge conflict on this. But I'd still like to help get this landed. I noticed from the WPT results that WebKit passes 100% of these tests. Combined with Gecko's interest, that should suffice to land this. However, I'd still like to make a last-ditch attempt at figuring out a nicer way to spec this. @annevk, would you or someone else from WebKit (maybe @cdumez?) be able to tell us how WebKit manages to pass all the tests? Is it via some sort of special "fire the load event" flag like this PR does, or is there something more elegant that doesn't require threading through as many layers? |
|
In which seems more locally managed than this PR. I'm not super familiar with the entire setup however. Maybe @achristensen07 is. |
|
Hmmm this is still incorrect. This PR says to fire 2 load events for https://software.hixie.ch/utilities/js/live-dom-viewer/saved/13709 but Chromium and WebKit fire only 1. Maybe Maybe also when initialInsertion is true, though that could be different between Chromium and WebKit. https://software.hixie.ch/utilities/js/live-dom-viewer/saved/13711 gets 2 load events in chromium, 1 in webkit. cc @EdgarChen |
|
This should now more closely match WebKit and what @EdgarChen implemented in Gecko (bug). Still need to rebase and add more tests. |
f7e0ccd to
10eece1
Compare
domenic
left a comment
There was a problem hiding this comment.
LGTM. Assuming the tests are updated, it looks like this matches WebKit perfectly and Chromium in everything except the lazy-loading case. (Which can just be treated as a Chromium bug: please file!) So it should be mergeable, if you're happy with the test coverage.
|
Still need to add some more tests based on the Live DOM Viewer demos. |
|
I've written the tests I was planning to and filed a chromium bug. |
Fixes #1895.
(See WHATWG Working Mode: Changes for more details.)
/browsing-the-web.html ( diff )
/iframe-embed-object.html ( diff )
/obsolete.html ( diff )