Skip to content

Commit 45168db

Browse files
committed
Address Domenic's review
1 parent bbfd100 commit 45168db

File tree

1 file changed

+21
-37
lines changed

1 file changed

+21
-37
lines changed

index.bs

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8970,7 +8970,7 @@ are represented by objects of the corresponding ECMAScript class, with the follo
89708970
a {{ECMAScript/TypeError}}.
89718971
1. If the conversion is not to an IDL type
89728972
[=extended attributes associated with|associated with=] the [{{AllowResizable}}]
8973-
[=extended attribute=], and <a abstract-op>IsResizableArrayBuffer</a>(|V|) is false,
8973+
[=extended attribute=], and <a abstract-op>IsResizableArrayBuffer</a>(|V|) is true,
89748974
then [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
89758975
1. Return the IDL {{ArrayBuffer}} value that is a reference
89768976
to the same object as |V|.
@@ -8990,7 +8990,7 @@ are represented by objects of the corresponding ECMAScript class, with the follo
89908990
then [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
89918991
1. If the conversion is not to an IDL type
89928992
[=extended attributes associated with|associated with=] the [{{AllowResizable}}]
8993-
[=extended attribute=], and <a abstract-op>IsResizableArrayBuffer</a>(|V|.\[[ViewedArrayBuffer]]) is false,
8993+
[=extended attribute=], and <a abstract-op>IsResizableArrayBuffer</a>(|V|.\[[ViewedArrayBuffer]]) is true,
89948994
then [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
89958995
1. Return the IDL {{DataView}} value that is a reference
89968996
to the same object as |V|.
@@ -9024,7 +9024,7 @@ are represented by objects of the corresponding ECMAScript class, with the follo
90249024
then [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
90259025
1. If the conversion is not to an IDL type
90269026
[=extended attributes associated with|associated with=] the [{{AllowResizable}}]
9027-
[=extended attribute=], and <a abstract-op>IsResizableArrayBuffer</a>(|V|.\[[ViewedArrayBuffer]]) is false,
9027+
[=extended attribute=], and <a abstract-op>IsResizableArrayBuffer</a>(|V|.\[[ViewedArrayBuffer]]) is true,
90289028
then [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
90299029
1. Return the IDL value of type |T| that is a reference to the same object as |V|.
90309030
</div>
@@ -9163,7 +9163,24 @@ A type that is not a [=buffer source type=] must not be
91639163
See the rules for converting ECMAScript values to IDL [=buffer source types=] in
91649164
[[#es-buffer-source-types]] for the specific requirements that the use of [{{AllowResizable}}] entails.
91659165

9166-
<div class="example">
9166+
See the <a href="#example-allowresizable-allowshared">example</a> in [[#AllowShared]] for example usage of both [{{AllowResizable}}] and [{{AllowShared}}].
9167+
9168+
9169+
<h4 id="AllowShared" extended-attribute lt="AllowShared">[AllowShared]</h4>
9170+
9171+
If the [{{AllowShared}}] [=extended attribute=] appears on one of the [=buffer source types=], it
9172+
creates a new IDL type that allows the buffer source type to be backed by an ECMAScript
9173+
{{ECMAScript/SharedArrayBuffer}}, instead of only by a non-shared {{ECMAScript/ArrayBuffer}}.
9174+
9175+
The [{{AllowShared}}] extended attribute must [=takes no arguments|take no arguments=].
9176+
9177+
A type that is not a [=buffer source type=] must not be
9178+
[=extended attributes associated with|associated with=] the [{{AllowShared}}] extended attribute.
9179+
9180+
See the rules for converting ECMAScript values to IDL [=buffer source types=] in
9181+
[[#es-buffer-source-types]] for the specific requirements that the use of [{{AllowShared}}] entails.
9182+
9183+
<div class="example" id="example-allowresizable-allowshared">
91679184
In the following [=IDL fragment=], one operation's argument uses the [{{AllowResizable}}] extended
91689185
attribute, while the other does not:
91699186

@@ -9203,39 +9220,6 @@ See the rules for converting ECMAScript values to IDL [=buffer source types=] in
92039220
</div>
92049221

92059222

9206-
<h4 id="AllowShared" extended-attribute lt="AllowShared">[AllowShared]</h4>
9207-
9208-
If the [{{AllowShared}}] [=extended attribute=] appears on one of the [=buffer source types=], it
9209-
creates a new IDL type that allows the buffer source type to be backed by an ECMAScript
9210-
{{ECMAScript/SharedArrayBuffer}}, instead of only by a non-shared {{ECMAScript/ArrayBuffer}}.
9211-
9212-
The [{{AllowShared}}] extended attribute must [=takes no arguments|take no arguments=].
9213-
9214-
A type that is not a [=buffer source type=] must not be
9215-
[=extended attributes associated with|associated with=] the [{{AllowShared}}] extended attribute.
9216-
9217-
See the rules for converting ECMAScript values to IDL [=buffer source types=] in
9218-
[[#es-buffer-source-types]] for the specific requirements that the use of [{{AllowShared}}] entails.
9219-
9220-
<div class="example">
9221-
In the following [=IDL fragment=], one operation's argument uses the [{{AllowShared}}] extended
9222-
attribute, while the other does not:
9223-
9224-
<pre highlight="webidl">
9225-
[Exposed=Window]
9226-
interface RenderingContext {
9227-
undefined readPixels(long width, long height, BufferSource pixels);
9228-
undefined readPixelsShared(long width, long height, [AllowShared] BufferSource pixels);
9229-
};
9230-
</pre>
9231-
9232-
With this definition, a call to <code>readPixels</code> with an {{ECMAScript/SharedArrayBuffer}}
9233-
instance, or any typed array or {{ECMAScript/DataView}} backed by one, will throw a
9234-
{{ECMAScript/TypeError}} exception. In contrast, a call to <code>readPixelsShared</code> will allow such
9235-
objects as input.
9236-
</div>
9237-
9238-
92399223
<h4 id="Clamp" extended-attribute lt="Clamp">[Clamp]</h4>
92409224

92419225
If the [{{Clamp}}] [=extended attribute=] appears on one of the [=integer types=], it creates a new

0 commit comments

Comments
 (0)