Skip to content

Commit

Permalink
Allow to use LegacyNullToEmptyString on USVString
Browse files Browse the repository at this point in the history
This is needed for the CSSOM spec, as that allows to use USVString as
the underlying string type. See
w3c/csswg-drafts#5010.
  • Loading branch information
emilio authored Sep 3, 2020
1 parent 02abd62 commit 6bccbca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -10377,13 +10377,13 @@ for the specific requirements that the use of

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

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

The [{{LegacyNullToEmptyString}}] extended attribute must not be
[=extended attribute associated with|associated with=] a type that is not {{DOMString}}.
[=extended attribute associated with|associated with=] a type that is not {{DOMString}} or {{USVString}}.

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

0 comments on commit 6bccbca

Please sign in to comment.