File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -256,6 +256,41 @@ the last item. Unless otherwise specified, an empty list is serialized as the
256256empty string.
257257
258258
259+ CSSOMString {#cssomstring-type}
260+ ===============================
261+
262+ Most strings in CSSOM interfaces use the <dfn>CSSOMString</dfn> type.
263+ Each implementation chooses to define it as either {{USVString}} or {{DOMString}} :
264+
265+ <pre class=idl>
266+ typedef USVString CSSOMString;
267+ </pre>
268+
269+ Or, alternatively:
270+
271+ <pre class="def lang-webidl">
272+ typedef DOMString CSSOMString;
273+ </pre>
274+
275+ <div class=note>
276+ The difference is only observable from web content
277+ when <a>surrogate</a> code units are involved.
278+ {{DOMString}} would preserve them,
279+ whereas {{USVString}} would replace them with U+FFFD REPLACEMENT CHARACTER.
280+
281+ This choice effectively allows implementations to do this replacement,
282+ but does not require it.
283+
284+ This enables an implementation to use UTF-8 internally to represent strings in memory.
285+ Since well-formed UTF-8 specifically disallows <a>surrogate</a> code points,
286+ it effectively requires this replacement.
287+
288+ On the other hand,
289+ implementations that internally represent strings as 16-bit <a>code units</a>
290+ may prefer to avoid the cost of doing this replacement.
291+ </div>
292+
293+
259294Media Queries {#media-queries}
260295==============================
261296
You can’t perform that action at this time.
0 commit comments