173 |
<dl class=switch> |
<dl class=switch> |
174 |
<dt>If it is a sequence of simle selector |
<dt>If it is a sequence of simle selector |
175 |
(<dfn id=var-sss><var>sss</var></dfn>)</dt> |
(<dfn id=var-sss><var>sss</var></dfn>)</dt> |
176 |
<dd class=ed>@@</dd> |
<dd> |
177 |
|
<ol> |
178 |
|
<li class=ed><a href="#algorithm-serialize-a-simple-selector">Serialize |
179 |
|
each simple selector</a> in <var>sss</var>.</li> |
180 |
|
<li class=ed>sort</li> |
181 |
|
<li>Append a <a href="#newline">newline</a> to <var>result</var>.</li> |
182 |
|
</ol> |
183 |
|
</dd> |
184 |
<dt>If it is a combinator (<dfn id=var-c><var>c</var></dfn>)</dt> |
<dt>If it is a combinator (<dfn id=var-c><var>c</var></dfn>)</dt> |
185 |
<dd> |
<dd> |
186 |
<ol> |
<ol> |
257 |
</ol> |
</ol> |
258 |
</dd> |
</dd> |
259 |
<dt>If <var>ss</var> is an attribute selector</dt> |
<dt>If <var>ss</var> is an attribute selector</dt> |
260 |
<dd class=ed>@@</dd> |
<dd> |
261 |
|
<ol> |
262 |
|
<li>Append a <code class=char>U+005B</code> <code class=charname>LEFT |
263 |
|
SQUARE BRACKET</code> (<code class=char>[</code>) to |
264 |
|
<var>result</var>.</li> |
265 |
|
<li> |
266 |
|
Append a namespace prefix as following: |
267 |
|
<dl> |
268 |
|
<dt>If a namespace URI is specified</dt> |
269 |
|
<dd class=ed>@@</dd> |
270 |
|
<dd class=ed>@@ Current reference implementation is wrong, |
271 |
|
since its result of sorting depends on namespace prefix.</dd> |
272 |
|
<dt>If the null namespace is specified</dt> |
273 |
|
<dd>Append a <code class=char>U+007C</code> |
274 |
|
<code class=charname>VERTICAL BAR</code> character to |
275 |
|
<var>result</var>.</dd> |
276 |
|
<dt>If no namespace is specified</dt> |
277 |
|
<dd>Append a <code class=char>U+002A</code> |
278 |
|
<code class=charname>ASTERISK</code> (<code class=char>*</code>) |
279 |
|
character, followed by a <code class=char>U+007C</code> |
280 |
|
<code class=charname>VERTICAL BAR</code> (<code class=char>|</code>) |
281 |
|
character, to <var>result</var>.</dd> |
282 |
|
</dl> |
283 |
|
</li> |
284 |
|
<li>Append the <span class=ed>@@ normalized</span> local name to |
285 |
|
<var>result</var>.</li> |
286 |
|
<li>If a value is specified in <var>ss</var>: |
287 |
|
<ol> |
288 |
|
<li>Depending on the way to match, append <code>=</code>, |
289 |
|
<code>~=</code>, <code>|=</code>, <code>^=</code>, |
290 |
|
<code>$=</code>, or <code>*=</code> to <var>result</var>.</li> |
291 |
|
<li>Append the <span class=ed>@@ normalized</span> value to |
292 |
|
<var>result</var>.</li> |
293 |
|
</ol> |
294 |
|
</li> |
295 |
|
<li>Append a <code class=char>U+005D</code> <code class=charname>RIGHT |
296 |
|
SQUARE BRACKET</code> (<code class=char>]</code>) to |
297 |
|
<var>result</var>.</li> |
298 |
|
</ol> |
299 |
|
</dd> |
300 |
<dt>If <var>ss</var> is a class selector</dt> |
<dt>If <var>ss</var> is a class selector</dt> |
301 |
<dd>Append a <code class=char>U+002E</code> <code class=charname>FULL |
<dd>Append a <code class=char>U+002E</code> <code class=charname>FULL |
302 |
STOP</code> (<code class=char>.</code>) character, followed |
STOP</code> (<code class=char>.</code>) character, followed |
446 |
representation is in use, a sequence of |
representation is in use, a sequence of |
447 |
<code class=char>U+000D</code> <code class=charname>CARRIAGE RETURN</code> |
<code class=char>U+000D</code> <code class=charname>CARRIAGE RETURN</code> |
448 |
followed by a <code class=char>U+000A</code> |
followed by a <code class=char>U+000A</code> |
449 |
<code class=charname>LINE FEED</code> or a character |
<code class=charname>LINE FEED</code> (i.e. a |
450 |
|
<code>CRLF</code> sequence) or a character |
451 |
<code class=char>U+000D</code> <code class=charname>CARRIAGE RETURN</code> |
<code class=char>U+000D</code> <code class=charname>CARRIAGE RETURN</code> |
452 |
<em class=rfc2119>MAY</em> be used as a newline instead.</p> |
<em class=rfc2119>MAY</em> be used as a <a href="#newline">newline</a> instead. |
453 |
|
<a href="#newline">Newline</a> representations |
454 |
|
<em class=rfc2119>SHOULD</em> be consistent in an |
455 |
|
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
456 |
|
representation.</p> |
457 |
|
|
458 |
<div class="note memo"> |
<div class="note memo"> |
459 |
<p>Therefore, when |
<p>Therefore, newlines must be normalized before |
460 |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
461 |
representations are literally compared, newlines must be normalized.</p> |
representations are literally compared.</p> |
462 |
</div> |
</div> |
463 |
|
|
464 |
</div> |
</div> |