-
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
Iframe with initial javascript: source needs to fire the load event in various cases #1895
Comments
Once this is sorted out, the html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling.html web platform test should be updated accordingly. I'm going to mostly disable it for now, because the thing it's testing is, while matching the spec, not web-compatible. |
For https://html.spec.whatwg.org/#process-the-iframe-attributes step 2.7 calls
The caller https://html.spec.whatwg.org/#navigate-to-a-javascript:-url step 7 says
Gecko needs to match WebKit/Chromium for web compat (see e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=1931058). From reading the spec, possibly navigate step 20.2 could check the result of the javascript: navigation, and continue the navigate steps with |
Probably the most important question is, do they navigate to a non-initial about:blank, or do they just fire
@natechapin may be able to help us with the Chromium behavior. Maybe @rwlbuis or @cdumez for WebKit? |
When chromium fires the load event, it's still the initial about:blank in the state machine. |
Test different return types, whether it is stringified and parsed and how many load events are fired. See whatwg/html#1895
I've created a PR with tests here: web-platform-tests/wpt#50193 I'm still not sure how to change the spec so that it fires a |
Here's an interesting case with different behavior in Chrome (alert) vs Safari/Firefox (no alert) <iframe src="javascript:alert(1)" hidden loading=lazy> https://software.hixie.ch/utilities/js/live-dom-viewer/saved/13411 |
I think making As far as I can tell, firing a https://html.spec.whatwg.org/#evaluate-a-javascript:-url step 10
PR: #10957 However, this still maybe isn't quite right. Details in the PR. |
Consider this testcase:
Until recently, this fired the load even in all browsers. When Firefox changed to not firing the load event here (following the current spec), we encountered breakage in websites: there are sites that run javascript: URLs that return booleans in frames and wait for the load event before doing something else [1]. Note that Firefox never fired a load event in this situation for the "javascript:undefined" case, but other browsers do.
The current state of this in the spec is as follows:
I don't see anything in the spec right now that would fire a load event in this situation. There presumably needs to be something.
Of course not-initial javascript: loads that return a boolean shouldn't fire a load event (or should it? I haven't tested non-Firefox browsers here), which adds to the fun of the whole thing.
[1] For example, the jQuery fileupload library does this. See https://bugzilla.mozilla.org/show_bug.cgi?id=1307420#c9 but chances are all the duplicates of https://bugzilla.mozilla.org/show_bug.cgi?id=1306472 will have similar issues on their sites.
The text was updated successfully, but these errors were encountered: