Skip to content

Commit f7eb809

Browse files
committed
Rename [TreatNullAs=EmptyString] to [LegacyNullToEmptyString]
Part of #350.
1 parent 6c11bcd commit f7eb809

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

index.bs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6549,7 +6549,7 @@ The following extended attributes are <dfn for="extended attributes">applicable
65496549
[{{AllowShared}}],
65506550
[{{Clamp}}],
65516551
[{{EnforceRange}}], and
6552-
[{{TreatNullAs}}].
6552+
[{{LegacyNullToEmptyString}}].
65536553

65546554
<div algorithm>
65556555
The <dfn for="IDL type" lt="extended attribute associated with|extended attributes associated with">extended attributes associated with</dfn>
@@ -7735,7 +7735,7 @@ value when its bit pattern is interpreted as an unsigned 64 bit integer.
77357735
to an IDL {{DOMString}} value by running the following algorithm:
77367736

77377737
1. If |V| is <emu-val>null</emu-val> and the conversion is to an IDL type
7738-
[=extended attribute associated with|associated with=] the [{{TreatNullAs}}] extended
7738+
[=extended attribute associated with|associated with=] the [{{LegacyNullToEmptyString}}] extended
77397739
attribute, then return the {{DOMString}} value that represents the empty string.
77407740
1. Let |x| be <a abstract-op>ToString</a>(|V|).
77417741
1. Return the IDL {{DOMString}} value that represents the same sequence of code units as the one the ECMAScript String value |x| represents.
@@ -10715,34 +10715,31 @@ for the specific requirements that the use of
1071510715
</div>
1071610716

1071710717

10718-
<h4 id="TreatNullAs" extended-attribute lt="TreatNullAs">[TreatNullAs]</h4>
10718+
<h4 id="LegacyNullToEmptyString" extended-attribute lt="LegacyNullToEmptyString" oldids="TreatNullAs">[LegacyNullToEmptyString]</h4>
1071910719

1072010720
<p class="advisement">
10721-
The [{{TreatNullAs}}] [=extended attribute=] is an undesirable feature.
10721+
The [{{LegacyNullToEmptyString}}] [=extended attribute=] is an undesirable feature.
1072210722
It exists only so that legacy Web platform features can be specified.
1072310723
It should not be used in specifications
1072410724
unless required to specify the behavior of legacy APIs,
1072510725
or for consistency with these APIs.
1072610726
Editors who wish to use this feature are strongly advised to discuss this
10727-
by <a href="https://github.com/heycam/webidl/issues/new?title=Intent%20to%20use%20[TreatNullAs]">filing an issue</a>
10727+
by <a href="https://github.com/heycam/webidl/issues/new?title=Intent%20to%20use%20[LegacyNullToEmptyString]">filing an issue</a>
1072810728
before proceeding.
1072910729
</div>
1073010730

10731-
If the [{{TreatNullAs}}] [=extended attribute=] appears on the {{DOMString}} type, it creates a new
10731+
If the [{{LegacyNullToEmptyString}}] [=extended attribute=] appears on the {{DOMString}} type, it creates a new
1073210732
IDL type such that that when an ECMAScript <emu-val>null</emu-val> is converted to the IDL type, it
1073310733
will be handled differently from its default handling. Instead of being stringified to
1073410734
"<code>null</code>", which is the default, it will be converted to the empty string.
1073510735

10736-
The [{{TreatNullAs}}] extended attribute must [=takes an identifier|take the identifier=]
10737-
<code>EmptyString</code>.
10738-
10739-
The [{{TreatNullAs}}] extended attribute must not be
10736+
The [{{LegacyNullToEmptyString}}] extended attribute must not be
1074010737
[=extended attribute associated with|associated with=] a type that is not {{DOMString}}.
1074110738

10742-
Note: This means that even <code class="idl">DOMString?</code> must not use [{{TreatNullAs}}], since
10739+
Note: This means that even <code class="idl">DOMString?</code> must not use [{{LegacyNullToEmptyString}}], since
1074310740
<emu-val>null</emu-val> is a valid value of that type.
1074410741

10745-
See [[#es-DOMString]] for the specific requirements that the use of [{{TreatNullAs}}] entails.
10742+
See [[#es-DOMString]] for the specific requirements that the use of [{{LegacyNullToEmptyString}}] entails.
1074610743

1074710744
<div class="example">
1074810745
The following [=IDL fragment=] defines an interface that has one attribute whose type has the
@@ -10752,9 +10749,9 @@ See [[#es-DOMString]] for the specific requirements that the use of [{{TreatNull
1075210749
[Exposed=Window]
1075310750
interface Dog {
1075410751
attribute DOMString name;
10755-
attribute [TreatNullAs=EmptyString] DOMString owner;
10752+
attribute [LegacyNullToEmptyString] DOMString owner;
1075610753

10757-
boolean isMemberOfBreed([TreatNullAs=EmptyString] DOMString breedName);
10754+
boolean isMemberOfBreed([LegacyNullToEmptyString] DOMString breedName);
1075810755
};
1075910756
</pre>
1076010757

0 commit comments

Comments
 (0)