Skip to content

Commit 054356d

Browse files
authored
Update to use new "report an exception" algorithm in HTML
It's necessary to specify which global these are reported to. This seems to be the event listener callback's realm's global in the event listener case, and the custom element constructor's realm, based on a combination of consistency with the related sites in HTML and browser behavior -- though browser behavior for custom elements isn't consistent in the (unusual) case of custom elements across realms. Part of whatwg/html#10516.
1 parent ad422be commit 054356d

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

dom.bs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,10 +1636,13 @@ and an optional <var>legacyOutputDidListenersThrowFlag</var>, run these steps:
16361636
<li>
16371637
<p><a>Call a user object's operation</a> with <var>listener</var>'s
16381638
<a for="event listener">callback</a>, "<code>handleEvent</code>", « <var>event</var> », and
1639-
<var>event</var>'s {{Event/currentTarget}} attribute value. If this throws an exception, then:
1639+
<var>event</var>'s {{Event/currentTarget}} attribute value. If this throws an exception
1640+
<var>exception</var>, then:
16401641

16411642
<ol>
1642-
<li><p><a>Report the exception</a>.
1643+
<li><p><a lt="report an exception">Report</a> <var>exception</var> for <var>listener</var>'s
1644+
<a for="event listener">callback</a>'s corresponding JavaScript object's
1645+
<a>associated realm</a>'s <a for="realm">global object</a>.
16431646

16441647
<li>
16451648
<p>Set <var>legacyOutputDidListenersThrowFlag</var> if given.
@@ -6320,10 +6323,12 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
63206323
<li><p><a lt="upgrade an element">Upgrade</a> <var>element</var> using <var>definition</var>.
63216324
</ol>
63226325

6323-
<p>If this step threw an exception, then:</p>
6326+
<p>If this step threw an exception <var>exception</var>:
63246327

63256328
<ol>
6326-
<li><p><a>Report the exception</a>.
6329+
<li><p><a lt="report an exception">Report</a> <var>exception</var> for <var>definition</var>'s
6330+
<a for="custom element definition">constructor</a>'s corresponding JavaScript object's
6331+
<a>associated realm</a>'s <a for="realm">global object</a>.
63276332

63286333
<li><p>Set <var>result</var>'s <a for=Element>custom element state</a> to
63296334
"<code>failed</code>".
@@ -6336,7 +6341,7 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
63366341
</li>
63376342

63386343
<li>
6339-
<p>Otherwise, if <var>definition</var> is non-null, then:
6344+
<p>Otherwise, if <var>definition</var> is non-null:
63406345

63416346
<ol>
63426347
<li>
@@ -6379,10 +6384,12 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
63796384
<li><p>Set <var>result</var>'s <a for=Element><code>is</code> value</a> to null.
63806385
</ol>
63816386

6382-
<p>If any of these steps threw an exception, then:</p>
6387+
<p>If any of these steps threw an exception <var>exception</var>:
63836388

63846389
<ol>
6385-
<li><p><a>Report the exception</a>.
6390+
<li><p><a lt="report an exception">Report</a> <var>exception</var> for <var>definition</var>'s
6391+
<a for="custom element definition">constructor</a>'s corresponding JavaScript object's
6392+
<a>associated realm</a>'s <a for="realm">global object</a>.
63866393

63876394
<li><p>Set <var>result</var> to a new <a for=/>element</a> that implements the
63886395
{{HTMLUnknownElement}} interface, with no attributes, <a for=Element>namespace</a> set to the

0 commit comments

Comments
 (0)