-
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 a load event for network errors in <embed> #4247
Conversation
d3f5326
to
5dd1288
Compare
I resurrected this after some time, and wrote tests. It turns out that only some network errors generate load events in Firefox and Safari. Since I think distinguishing types of network errors is not something we'd want to start doing, I suggest the spec adopt Chrome's semantics. What do you think, @annevk? |
Hmm, right. So it seems like there's at least some world where we move frame-ancestors/X-Frame-Options into navigate, and treat it as a "load" of an error page (and fire a I might want to tackle this larger issue, or at least f-a/X-F-O, as part of cleaning up the foundations so that portals can use them properly. But in the meantime, what should we do with this PR? I'd like to put in a vote for merging, as it fixes the regression noted in #4024 (and caused by #3900). However, we could hold off on filing bugs and updating the larger swathe of tests until we have a better handle on the bigger picture. What do you think? |
I was hoping at least one other Mozilla person could chime in with yes/no. I'm personally fine with small steps towards always firing a load event for navigation contexts. @mattwoodrow what do you think? |
This sounds reasonable to me. I definitely agree that we want to move towards always firing an event for navigation contexts (though no strong preference on load vs error event). It'd be nice to do the same for |
It looks like iframe is already specified to fire a load event when any document is created, including a network error document (created via https://html.spec.whatwg.org/#read-ua-inline). object elements seem to explicitly fire an error event in step 4.7 of the algorithm at https://html.spec.whatwg.org/#the-object-element (no direct link, sorry). I will expand the tests to see what the result is for those two... |
It appears that object is significantly worse than embed and iframe.
whereas with My recommendation is that we leave Does that sound reasonable? |
I think that's fine. |
Great. Want to review/approve this PR then? :) |
@@ -30648,6 +30648,10 @@ interface <dfn>HTMLEmbedElement</dfn> : <span>HTMLElement</span> { | |||
<span>the <code>embed</code> element setup steps</span> for <var>element</var>, then | |||
return.</p></li> | |||
|
|||
<li><p>If <var>response</var> is a <span>network error</span>, then <span | |||
data-x="concept-event-fire">fire an event</span> named <code | |||
data-x="event-load">load</code> at <var>element</var>, and return.</p></li> |
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.
It seems that the current tests are not testing whether this results in a browsing context/plugin being created or not.
I guess that goes back to the general issue of the embed
element being much more like object
in implementations than the specification makes it appear.
But given that the note below I suspect this might be inaccurate?
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 found this to be inconsistent among Firefox and Chrome :(.
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.
This would also close #1461 I suppose.
Reluctantly approving as embed
is in shambles so it's not clear to me if this is helping or hurting.
Thanks :). Web platform tests are merged, and the OP is updated with Gecko and WebKit bugs that I filed. |
Follows whatwg/html#4247 for <embed> and existing spec text for <iframe>.
…d>, a=testonly Automatic update from web-platform-tests Add a test for network errors with <embed> and <iframe> Follows whatwg/html#4247 for <embed> and existing spec text for <iframe>. -- wpt-commits: 91b0d35770bcb521c540d08002d8d3700666180c wpt-pr: 24518
…d>, a=testonly Automatic update from web-platform-tests Add a test for network errors with <embed> and <iframe> Follows whatwg/html#4247 for <embed> and existing spec text for <iframe>. -- wpt-commits: 91b0d35770bcb521c540d08002d8d3700666180c wpt-pr: 24518
…d>, a=testonly Automatic update from web-platform-tests Add a test for network errors with <embed> and <iframe> Follows whatwg/html#4247 for <embed> and existing spec text for <iframe>. -- wpt-commits: 91b0d35770bcb521c540d08002d8d3700666180c wpt-pr: 24518 UltraBlame original commit: 08ab2bb58f49c3dbacd5d3d9c7fa0405f9573f92
…d>, a=testonly Automatic update from web-platform-tests Add a test for network errors with <embed> and <iframe> Follows whatwg/html#4247 for <embed> and existing spec text for <iframe>. -- wpt-commits: 91b0d35770bcb521c540d08002d8d3700666180c wpt-pr: 24518 UltraBlame original commit: 08ab2bb58f49c3dbacd5d3d9c7fa0405f9573f92
…d>, a=testonly Automatic update from web-platform-tests Add a test for network errors with <embed> and <iframe> Follows whatwg/html#4247 for <embed> and existing spec text for <iframe>. -- wpt-commits: 91b0d35770bcb521c540d08002d8d3700666180c wpt-pr: 24518 UltraBlame original commit: 08ab2bb58f49c3dbacd5d3d9c7fa0405f9573f92
Fixes #4024.
(See WHATWG Working Mode: Changes for more details.)
/iframe-embed-object.html ( diff )