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

Update to HTML changes for ShadowRealms #1437

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
66 changes: 32 additions & 34 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6036,7 +6036,7 @@ about the execution context at the time the language binding specific object ref
converted to an IDL value.

Note: For JavaScript objects, the [=callback context=] is used to hold a reference to the
<a spec="HTML">incumbent settings object</a> at the time the Object value is converted to an IDL
<a spec="HTML">incumbent realm</a> at the time the Object value is converted to an IDL
callback interface type value. See [[#js-callback-interface]].

There is no way to represent a constant object reference value for a particular
Expand Down Expand Up @@ -6085,7 +6085,7 @@ An IDL value of the callback function type is represented by a tuple of an objec
reference and a [=callback context=].

Note: As with [=callback interface types=], the [=callback context=] is used to hold a
reference to the <a spec="HTML">incumbent settings object</a> at
reference to the <a spec="HTML">incumbent realm</a> at
the time a JavaScript Object value is converted to an IDL
callback function type value. See [[#js-callback-function]].

Expand Down Expand Up @@ -7783,7 +7783,7 @@ values are represented by JavaScript Object values (including [=function objects

1. If <a abstract-op>Type</a>(|V|) is not Object, then [=JavaScript/throw=] a <l spec=ecmascript>{{TypeError}}</l>.
1. Return the IDL [=callback interface type=] value that represents a reference to |V|, with
the <a spec="HTML">incumbent settings object</a> as the [=callback context=].
the <a spec="HTML">incumbent realm</a> as the [=callback context=].
</div>

<p id="callback-interface-to-js">
Expand Down Expand Up @@ -7911,7 +7911,7 @@ IDL [=callback function types=] are represented by JavaScript [=function objects
then [=JavaScript/throw=] a <l spec=ecmascript>{{TypeError}}</l>.
1. Return the IDL [=callback function type=] value
that represents a reference to the same object that |V| represents, with the
<a spec="HTML">incumbent settings object</a> as the [=callback context=].
<a spec="HTML">incumbent realm</a> as the [=callback context=].
</div>

<p id="callback-function-to-js">
Expand Down Expand Up @@ -9677,9 +9677,10 @@ Otherwise, it is the [=host interface=]'s [=exposure set=].

1. If |construct|'s [=exposure set=] is not <code>*</code>, and |realm|.\[[GlobalObject]] does
not implement an [=interface=] that is in |construct|'s [=exposure set=], then return false.
1. If |realm|'s [=realm/settings object=] is not a [=secure context=], and |construct| is
[=conditionally exposed=] on [{{SecureContext}}], then return false.
1. If |realm|'s [=realm/settings object=]'s
1. If |realm|'s [=realm/principal realm=]'s [=principal realm/settings object=] is not a
[=secure context=], and |construct| is [=conditionally exposed=] on [{{SecureContext}}],
then return false.
1. If |realm|'s [=realm/principal realm=]'s [=principal realm/settings object=]'s
[=environment settings object/cross-origin isolated capability=] is false, and |construct|
is [=conditionally exposed=] on [{{CrossOriginIsolated}}], then return false.
1. Return true.
Expand Down Expand Up @@ -11840,8 +11841,7 @@ is the concatenation of the [=interface=]'s
When the \[[SetPrototypeOf]] internal method of a [=named properties object=] |O| is called with
JavaScript language value |V|, the following step is taken:

1. If |O|'s [=associated realm=]'s [=is global prototype chain mutable=] is true,
return [=?=] [$OrdinarySetPrototypeOf$](|O|, |V|).
1. Assert: |O|'s [=associated realm=]'s [=is global prototype chain mutable=] is false.
1. Return [=?=] <a abstract-op>SetImmutablePrototype</a>(|O|, |V|).

</div>
Expand Down Expand Up @@ -13551,7 +13551,8 @@ the realm given as an argument.
1. [=Define the iteration methods=] of |interface| on |instance| given |realm|.
1. [=Define the asynchronous iteration methods=] of |interface| on |instance| given |realm|.
1. [=Define the global property references=] on |instance|, given |realm|.
1. Set |instance|.\[[SetPrototypeOf]] as defined in [[#platform-object-setprototypeof]].
1. If |realm|'s [=is global prototype chain mutable=] is false, then:
1. Set |instance|.\[[SetPrototypeOf]] as defined in [[#platform-object-setprototypeof]].
1. Otherwise, if |interfaces| contains an [=interface=] which
[=support indexed properties|supports indexed properties=],
[=support named properties|named properties=], or both:
Expand Down Expand Up @@ -13660,8 +13661,7 @@ Issue: Define those properties imperatively instead.
[=interface=] with the [{{Global}}] [=extended attribute=] is called with
JavaScript language value |V|, the following step is taken:

1. If |O|'s [=associated realm=]'s [=is global prototype chain mutable=] is true,
return [=?=] [$OrdinarySetPrototypeOf$](|O|, |V|).
1. Assert: |O|'s [=associated realm=]'s [=is global prototype chain mutable=] is false.
1. Return [=?=] <a abstract-op>SetImmutablePrototype</a>(|O|, |V|).

</div>
Expand Down Expand Up @@ -14323,11 +14323,10 @@ the special value “missing”, which represents a missing optional argument.
1. Let |completion| be an uninitialized variable.
1. If |thisArg| was not given, let |thisArg| be <emu-val>undefined</emu-val>.
1. Let |O| be the JavaScript object corresponding to |value|.
1. Let |realm| be |O|'s [=associated realm=].
1. Let |relevant settings| be |realm|'s [=realm/settings object=].
1. Let |stored settings| be |value|'s [=callback context=].
1. [=Prepare to run script=] with |relevant settings|.
1. [=Prepare to run a callback=] with |stored settings|.
1. Let |relevant realm| be |O|'s [=associated realm=].
1. Let |stored realm| be |value|'s [=callback context=].
1. [=Prepare to run script=] with |relevant realm|.
1. [=Prepare to run a callback=] with |stored realm|.
1. Let |X| be |O|.
1. If <a abstract-op>IsCallable</a>(|O|) is false, then:
1. Let |getResult| be <a abstract-op>Completion</a>(<a abstract-op>Get</a>(|O|, |opName|)).
Expand All @@ -14352,8 +14351,8 @@ the special value “missing”, which represents a missing optional argument.
representing the thrown exception.
1. <i id="call-user-object-operation-return">Return:</i> at this
point |completion| will be set to an IDL value or an [=abrupt completion=].
1. [=Clean up after running a callback=] with |stored settings|.
1. [=Clean up after running script=] with |relevant settings|.
1. [=Clean up after running a callback=] with |stored realm|.
1. [=Clean up after running script=] with |relevant realm|.
1. If |completion| is an IDL value, return |completion|.
1. If |completion| is an [=abrupt completion=] and the operation has a [=return type=]
that is <em>not</em> a [=promise type=], throw |completion|.\[[Value]].
Expand Down Expand Up @@ -14434,11 +14433,10 @@ described in the previous section).
marked with [{{LegacyTreatNonObjectAsNull}}].
1. Return the result of [=converted to an IDL value|converting=]
<emu-val>undefined</emu-val> to the callback function's return type.
1. Let |realm| be |F|'s [=associated realm=].
1. Let |relevant settings| be |realm|'s [=realm/settings object=].
1. Let |stored settings| be |callable|'s [=callback context=].
1. [=Prepare to run script=] with |relevant settings|.
1. [=Prepare to run a callback=] with |stored settings|.
1. Let |relevant realm| be |F|'s [=associated realm=].
1. Let |stored realm| be |callable|'s [=callback context=].
1. [=Prepare to run script=] with |relevant realm|.
1. [=Prepare to run a callback=] with |stored realm|.
1. Let |jsArgs| be the result of [=Web IDL arguments list/converting=] |args| to a JavaScript
arguments list. If this throws an exception, set |completion| to the completion value
representing the thrown exception and jump to the step labeled
Expand All @@ -14452,14 +14450,15 @@ described in the previous section).
representing the thrown exception.
1. <i id="invoke-return">Return:</i> at this
point |completion| will be set to an IDL value or an [=abrupt completion=].
1. [=Clean up after running a callback=] with |stored settings|.
1. [=Clean up after running script=] with |relevant settings|.
1. [=Clean up after running a callback=] with |stored realm|.
1. [=Clean up after running script=] with |relevant realm|.
1. If |completion| is an IDL value, return |completion|.
1. [=Assert=]: |completion| is an [=abrupt completion=].
1. If |exceptionBehavior| is "<code>rethrow</code>", throw |completion|.\[[Value]].
1. Otherwise, if |exceptionBehavior| is "<code>report</code>":
1. [=Assert=]: |callable|'s [=return type=] is {{undefined}} or {{any}}.
1. [=Report an exception=] |completion|.\[[Value]] for |realm|'s [=realm/global object=].
1. [=Report an exception=] |completion|.\[[Value]] for |relevant realm|'s
[=realm/global object=].
1. Return the unique {{undefined}} IDL value.
1. [=Assert=]: |callable|'s [=return type=] is a [=promise type=].
1. Let |rejectedPromise| be [=!=] <a abstract-op>Call</a>({{%Promise.reject%}},
Expand All @@ -14482,11 +14481,10 @@ a return type that is a [=promise type=].
1. Let |F| be the JavaScript object corresponding to |callable|.
1. If <a abstract-op>IsConstructor</a>(|F|) is <emu-val>false</emu-val>, throw a
<l spec=ecmascript>{{TypeError}}</l> exception.
1. Let |realm| be |F|'s [=associated realm=].
1. Let |relevant settings| be |realm|'s [=realm/settings object=].
1. Let |stored settings| be |callable|'s [=callback context=].
1. [=Prepare to run script=] with |relevant settings|.
1. [=Prepare to run a callback=] with |stored settings|.
1. Let |relevant realm| be |F|'s [=associated realm=].
1. Let |stored realm| be |callable|'s [=callback context=].
1. [=Prepare to run script=] with |relevant realm|.
1. [=Prepare to run a callback=] with |stored realm|.
1. Let |jsArgs| be the result of [=Web IDL arguments list/converting=] |args| to a JavaScript
arguments list. If this throws an exception, set |completion| to the completion value
representing the thrown exception and jump to the step labeled
Expand All @@ -14500,8 +14498,8 @@ a return type that is a [=promise type=].
representing the thrown exception.
1. <i id="construct-return">Return:</i> at this
point |completion| will be set to an IDL value or an [=abrupt completion=].
1. [=Clean up after running a callback=] with |stored settings|.
1. [=Clean up after running script=] with |relevant settings|.
1. [=Clean up after running a callback=] with |stored realm|.
1. [=Clean up after running script=] with |relevant realm|.
1. If |completion| is an [=abrupt completion=], throw |completion|.\[[Value]].
1. Return |completion|.
</div>
Expand Down
Loading