Skip to content

Commit

Permalink
Fixes to stopping document loading
Browse files Browse the repository at this point in the history
* Makes the discussion of user agent interface invoke "stop document loading", not "abort a document", since the browser stop button also cancels ongoing navigations.

* Remove the "should" suggestion to fire an abort event. Closes #3525. Since this was the only case where abort was fired, this removes the event definition and event handler content attribute definition, effectively making use of the onabort="" content attribute nonconforming. (But, we keep the IDL definition in GlobalEventHandlers and the associated mapping.)

* Tweaks the active document check in "stop document loading" to be more correct.
  • Loading branch information
domenic committed May 26, 2021
1 parent 4ba46b0 commit f67b46d
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -11557,7 +11557,6 @@ https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%
data-x="HTML elements">HTML element</span>:</p>

<ul class="brief">
<li><code data-x="handler-onabort">onabort</code></li>
<li><code data-x="handler-onauxclick">onauxclick</code></li>
<li><code data-x="handler-onblur">onblur</code>*</li>
<li><code data-x="handler-oncancel">oncancel</code></li>
Expand Down Expand Up @@ -87997,24 +87996,19 @@ interface <dfn>BeforeUnloadEvent</dfn> : <span>Event</span> {
</li>
</ol>

<p>User agents may allow users to explicitly invoke the <span data-x="abort a document">abort a
document</span> algorithm for a <code>Document</code>. If the user does so, then, if that
<code>Document</code> is an <span>active document</span>, the user agent should <span>queue a
task</span> to <span data-x="concept-event-fire">fire an event</span> named <code
data-x="event-abort">abort</code> at that <code>Document</code> object's <span>relevant global
object</span> before invoking the <span data-x="abort a document">abort</span> algorithm.</p>

<!-- I'd love to make this more precise, anyone have any suggestions on what it should say? -->
<p>User agents may allow users to explicitly invoke the <span>stop document loading</span> for a
<code>Document</code>.</p>

<p>To <dfn>stop document loading</dfn> given a <code>Document</code> object <var>document</var>,
run these steps:</p>

<ol>
<li><p>If <var>document</var> is not an <span>active document</span>, then return.</p></li>

<li><p>Let <var>browsingContext</var> be <var>document</var>'s <span
data-x="concept-document-bc">browsing context</span>.</p></li>

<li><p>If <var>browsingContext</var>'s <span>active document</span> is not <var>document</var>,
then return.</p></li>

<li><p>If there is an existing attempt to <span>navigate</span> <var>browsingContext</var> and
<var>document</var>'s <span>unload counter</span> is 0, then cancel that <span
data-x="navigate">navigation</span>.</p></li>
Expand Down Expand Up @@ -93533,7 +93527,7 @@ typedef <span>OnBeforeUnloadEventHandlerNonNull</span>? <dfn>OnBeforeUnloadEvent
<thead>
<tr><th><span data-x="event handlers">Event handler</span> <th><span>Event handler event type</span>
<tbody>
<tr><td><dfn attribute for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-onabort">onabort</code></dfn> <td> <code data-x="event-abort">abort</code>
<tr><td><dfn attribute for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-onabort">onabort</code></dfn> <td> <code data-x="">abort</code>
<tr><td><dfn attribute for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-onauxclick">onauxclick</code></dfn> <td> <code data-x="event-auxclick">auxclick</code>
<tr><td><dfn attribute for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-oncancel">oncancel</code></dfn> <td> <code data-x="event-cancel">cancel</code>
<tr><td><dfn attribute for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-oncanplay">oncanplay</code></dfn> <td> <code data-x="event-media-canplay">canplay</code>
Expand Down Expand Up @@ -122520,12 +122514,6 @@ interface <dfn>MimeType</dfn> {
<th> Value
<tbody>

<tr>
<th id="ix-handler-onabort"> <code data-x="">onabort</code>
<td> <span data-x="handler-onabort">HTML elements</span>
<td> <code data-x="event-abort">abort</code> event handler
<td> <span data-x="event handler content attributes">Event handler content attribute</span>

<tr>
<th id="ix-handler-onauxclick"> <code data-x="">onauxclick</code>
<td> <span data-x="handler-onauxclick">HTML elements</span>
Expand Down Expand Up @@ -123496,12 +123484,6 @@ INSERT INTERFACES HERE
<th> Description
<tbody>

<tr> <!-- abort -->
<td> <dfn event for="Window"><code data-x="event-abort">abort</code></dfn>
<td> <code>Event</code>
<td> <code>Window</code>
<td> Fired at the <code>Window</code> when the download was aborted by the user

<tr> <!-- DOMContentLoaded -->
<td> <dfn event for="Document"><code data-x="event-DOMContentLoaded">DOMContentLoaded</code></dfn>
<td> <code>Event</code>
Expand Down

0 comments on commit f67b46d

Please sign in to comment.