Skip to content

Commit c202863

Browse files
committed
[cssom] CSS.escape() serialize U+0000 as \FFFD instead of throwing
Fixes https://lists.w3.org/Archives/Public/www-style/2015Nov/0293.html.
1 parent dc8717d commit c202863

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

cssom/Overview.bs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ To <dfn export>serialize an identifier</dfn> means to create a string represente
189189
by the concatenation of, for each character of the identifier:
190190

191191
<ul>
192-
<li>If the character is NULL (U+0000), then <a>throw</a> an
193-
{{InvalidCharacterError}} exception and terminate these steps.
192+
<li>If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD)
193+
<a>escaped as a code point</a>.
194194
<li>If the character is in the range [\1-\1f] (U+0001 to U+001F) or is U+007F, then the character
195195
<a>escaped as code point</a>.
196196
<li>If the character is the first character and is in the range \[0-9]
@@ -218,8 +218,8 @@ below to each character of the given string, followed by
218218
'"' (U+0022):
219219

220220
<ul>
221-
<li>If the character is NULL (U+0000), then <a>throw</a> an
222-
{{InvalidCharacterError}} exception and terminate these steps.
221+
<li>If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD)
222+
<a>escaped as a code point</a>.
223223
<li>If the character is in the range [\1-\1f] (U+0001 to U+001F) or is U+007F, the character
224224
<a>escaped as code point</a>.
225225
<li>If the character is '"' (U+0022) or "<code>\</code>"
@@ -3002,7 +3002,7 @@ The <code>CSS</code> interface holds useful CSS-related functions that do not be
30023002
};</pre>
30033003

30043004
The <dfn method for=CSS>escape(<var>ident</var>)</dfn> method must return the result of invoking <a>serialize an identifier</a> of
3005-
<var>ident</var>. Any exceptions thrown must be re-thrown.
3005+
<var>ident</var>.
30063006

30073007
<div class=example>
30083008
For example, to escape a string for use as part of a selector, the {{CSS/escape()}} method can be used:
@@ -3203,6 +3203,7 @@ Ms2ger,
32033203
Peter Sloetjes,
32043204
Philip Jägenstedt,
32053205
Philip Taylor,
3206+
Richard Gibson,
32063207
Robert O'Callahan,
32073208
Simon Sapin,
32083209
Sjoerd Visscher,

0 commit comments

Comments
 (0)