Skip to content
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

Merged
merged 1 commit into from
Jul 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Copy link
Member

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?

Copy link
Member Author

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 :(.


<li><p>Let <var>type</var> be the result of determining the <span
data-x="concept-embed-type">type of content</span> given <var>element</var> and
<var>response</var>.</p></li>
Expand Down Expand Up @@ -30753,10 +30757,9 @@ interface <dfn>HTMLEmbedElement</dfn> : <span>HTMLElement</span> {
</ol>
<!-- This algorithm is a monument to bad design. Go legacy! -->

<p class="note">It is intentional that the above algorithm allows <var>response</var> to be a
<span>network error</span> or to have a non-<span>ok status</span>. This allows servers to return
data for plugins even with error responses (e.g., HTTP 500 Internal Server Error codes can still
contain plugin data).</p>
<p class="note">It is intentional that the above algorithm allows <var>response</var> to have a
non-<span>ok status</span>. This allows servers to return data for plugins even with error
responses (e.g., HTTP 500 Internal Server Error codes can still contain plugin data).</p>

<p>To <dfn>display a plugin</dfn> for an <code>embed</code> element <var>element</var>, given a
string <var>type</var> and optionally a <span data-x="concept-response">response</span>
Expand Down