@@ -5531,7 +5531,7 @@ sign gives the signature of the callback function type.
5531
5531
be used as the type of a [=constant=].
5532
5532
5533
5533
The following extended attribute is applicable to callback functions:
5534
- [{{TreatNonObjectAsNull }}].
5534
+ [{{LegacyTreatNonObjectAsNull }}].
5535
5535
5536
5536
<div data-fill-with="grammar-CallbackOrInterfaceOrMixin"></div>
5537
5537
@@ -6260,7 +6260,7 @@ An [=identifier=] that identifies
6260
6260
a [=callback function=] is used to refer to
6261
6261
a type whose values are references to objects that are functions with the given signature.
6262
6262
6263
- Note: If the [{{TreatNonObjectAsNull }}] [=extended attribute=] is specified on the [=definition=] of
6263
+ Note: If the [{{LegacyTreatNonObjectAsNull }}] [=extended attribute=] is specified on the [=definition=] of
6264
6264
the [=callback function=], the values can be references to objects that are not functions.
6265
6265
6266
6266
An IDL value of the callback function type is represented by a tuple of an object
@@ -7980,7 +7980,7 @@ values.
7980
7980
<h4 id="es-callback-function">Callback function types</h4>
7981
7981
7982
7982
IDL [=callback function types=] are represented by ECMAScript [=function objects=], except in the
7983
- [{{TreatNonObjectAsNull }}] case, when they can be any object.
7983
+ [{{LegacyTreatNonObjectAsNull }}] case, when they can be any object.
7984
7984
7985
7985
<div id="es-to-callback-function" algorithm="convert an ECMAScript value to callback function">
7986
7986
@@ -7993,7 +7993,7 @@ IDL [=callback function types=] are represented by ECMAScript [=function objects
7993
7993
to |V| being assigned to an [=attribute=]
7994
7994
whose type is a [=nullable type|nullable=]
7995
7995
[=callback function=]
7996
- that is annotated with [{{TreatNonObjectAsNull }}],
7996
+ that is annotated with [{{LegacyTreatNonObjectAsNull }}],
7997
7997
then [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
7998
7998
1. Return the IDL [=callback function type=] value
7999
7999
that represents a reference to the same object that |V| represents, with the
@@ -8025,7 +8025,7 @@ the ECMAScript <emu-val>null</emu-val> value.
8025
8025
to |V| being assigned to an [=attribute=]
8026
8026
whose type is a [=nullable type|nullable=]
8027
8027
[=callback function=]
8028
- that is annotated with [{{TreatNonObjectAsNull }}],
8028
+ that is annotated with [{{LegacyTreatNonObjectAsNull }}],
8029
8029
then return the IDL
8030
8030
[=nullable type=] <code class="idl">|T|?</code>
8031
8031
value <emu-val>null</emu-val>.
@@ -10630,21 +10630,21 @@ that does specify [{{SecureContext}}].
10630
10630
</div>
10631
10631
10632
10632
10633
- <h4 id="TreatNonObjectAsNull " extended-attribute lt="TreatNonObjectAsNull">[TreatNonObjectAsNull ]</h4>
10633
+ <h4 id="LegacyTreatNonObjectAsNull " extended-attribute lt="LegacyTreatNonObjectAsNull" oldids=" TreatNonObjectAsNull">[LegacyTreatNonObjectAsNull ]</h4>
10634
10634
10635
10635
<div class="advisement">
10636
10636
10637
- The [{{TreatNonObjectAsNull }}] [=extended attribute=] is an undesirable feature.
10637
+ The [{{LegacyTreatNonObjectAsNull }}] [=extended attribute=] is an undesirable feature.
10638
10638
It exists only so that legacy Web platform features can be specified.
10639
10639
It should not be used in specifications
10640
10640
unless required to specify the behavior of legacy APIs,
10641
10641
or for consistency with these APIs.
10642
10642
Editors who wish to use this feature are strongly advised to discuss this
10643
- by <a href="https://github.com/heycam/webidl/issues/new?title=Intent%20to%20use%20[TreatNonObjectAsNull ]">filing an issue</a>
10643
+ by <a href="https://github.com/heycam/webidl/issues/new?title=Intent%20to%20use%20[LegacyTreatNonObjectAsNull ]">filing an issue</a>
10644
10644
before proceeding.
10645
10645
10646
10646
<small class="non-normative">
10647
- The [{{TreatNonObjectAsNull }}] [=extended attribute=] appears on
10647
+ The [{{LegacyTreatNonObjectAsNull }}] [=extended attribute=] appears on
10648
10648
the [=callback functions=] {{EventHandlerNonNull}},
10649
10649
{{OnBeforeUnloadEventHandlerNonNull}}, and
10650
10650
{{OnErrorEventHandlerNonNull}}
@@ -10654,27 +10654,27 @@ that does specify [{{SecureContext}}].
10654
10654
10655
10655
</div>
10656
10656
10657
- If the [{{TreatNonObjectAsNull }}] [=extended attribute=] appears on a [=callback function=], then
10657
+ If the [{{LegacyTreatNonObjectAsNull }}] [=extended attribute=] appears on a [=callback function=], then
10658
10658
it indicates that any value assigned to an [=attribute=] whose type is a [=nullable type|nullable=]
10659
10659
[=callback function=] will be converted more loosely: if the value is not an object, it will be
10660
10660
converted to null, and if the value is not [=ECMAScript/callable=], it will be converted to a
10661
10661
[=callback function=] value that does nothing when called.
10662
10662
10663
10663
See [[#es-nullable-type]], [[#es-callback-function]] and [[#es-invoking-callback-functions]]
10664
10664
for the specific requirements that the use of
10665
- [{{TreatNonObjectAsNull }}] entails.
10665
+ [{{LegacyTreatNonObjectAsNull }}] entails.
10666
10666
10667
10667
<div class="example">
10668
10668
10669
10669
The following [=IDL fragment=] defines an interface that has one
10670
- attribute whose type is a [{{TreatNonObjectAsNull }}]-annotated
10670
+ attribute whose type is a [{{LegacyTreatNonObjectAsNull }}]-annotated
10671
10671
[=callback function=] and another whose type is a
10672
10672
[=callback function=] without the [=extended attribute=]:
10673
10673
10674
10674
<pre highlight="webidl">
10675
10675
callback OccurrenceHandler = void (DOMString details);
10676
10676
10677
- [TreatNonObjectAsNull ]
10677
+ [LegacyTreatNonObjectAsNull ]
10678
10678
callback ErrorHandler = void (DOMString details);
10679
10679
10680
10680
[Exposed=Window]
@@ -14083,7 +14083,7 @@ described in the previous section).
14083
14083
1. Let |F| be the ECMAScript object corresponding to |callable|.
14084
14084
1. If [=!=] <a abstract-op>IsCallable</a>(|F|) is <emu-val>false</emu-val>:
14085
14085
1. Note: This is only possible when the [=callback function=] came from an attribute
14086
- marked with [{{TreatNonObjectAsNull }}].
14086
+ marked with [{{LegacyTreatNonObjectAsNull }}].
14087
14087
1. If the callback function's return type is {{void}}, return.
14088
14088
1. Return the result of [=converted to an IDL value|converting=]
14089
14089
<emu-val>undefined</emu-val> to the callback function's return type.
0 commit comments