-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 a load event for javascript: URL non-strings #10957
base: main
Are you sure you want to change the base?
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. |
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.
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? |
Fixes #1895.
(See WHATWG Working Mode: Changes for more details.)
/browsing-the-web.html ( diff )
/iframe-embed-object.html ( diff )