10 |
<div class="header"> |
<div class="header"> |
11 |
<h1>Selectors Serialization Format for Testing (<abbr>SSFT</abbr>) |
<h1>Selectors Serialization Format for Testing (<abbr>SSFT</abbr>) |
12 |
Specification</h1> |
Specification</h1> |
13 |
<h2>Working Draft <time datetime=2007-10-07>7 October 2007</time></h2> |
<h2>Working Draft <time datetime=2007-10-15>15 October 2007</time></h2> |
14 |
|
|
15 |
<dl class="versions-uri"> |
<dl class="versions-uri"> |
16 |
<dt>This Version</dt> |
<dt>This Version</dt> |
145 |
for now.</p> |
for now.</p> |
146 |
</div> |
</div> |
147 |
|
|
148 |
<p><dfn id=newline title=newline>Newline</dfn> is |
<p>No <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
149 |
<code class=char>U+000A</code> <code class=charname>LINE FEED</code> |
representation is defined for an invalid group of selectors.</p> |
150 |
<span class=ed>or U+000D U+000A or U+000A ??</span>.</p> |
|
151 |
|
<div class="note memo"> |
152 |
|
<p>The serialized representation will not contain any comment.</p> |
153 |
|
</div> |
154 |
|
|
155 |
<!-- TODO: link terms to Selectors --> |
<!-- TODO: link terms to Selectors --> |
156 |
|
|
211 |
</ol> |
</ol> |
212 |
</li> |
</li> |
213 |
<li>Then, <var>result</var> is the |
<li>Then, <var>result</var> is the |
214 |
<abbr title="Selectors Serialization Format for Testing">SFFT</abbr> |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
215 |
representation of the group of selectors.</li> |
representation of <var>gs</var>.</li> |
216 |
</ol> |
</ol> |
217 |
|
|
218 |
<p>To |
<p>To |
267 |
<li>Append a <code class=char>U+003A</code> |
<li>Append a <code class=char>U+003A</code> |
268 |
<code class=charname>COLON</code> (<code class=char>:</code>) character |
<code class=charname>COLON</code> (<code class=char>:</code>) character |
269 |
to <var>result</var>.</li> |
to <var>result</var>.</li> |
270 |
<li>Append <span class=ed>@@ normalized</span> |
<li>Append the <span class=ed>@@ normalized</span> name of the |
271 |
pseudo$B!>(Bclass name to <var>result</var>.</li> |
pseudo$B!>(Bclass to <var>result</var>.</li> |
272 |
<li>Append any arguments as following: |
<li>Append any arguments as following: |
273 |
<dl class=switch> |
<dl class=switch> |
274 |
<dt>If pseudo$B!>(Bclass name is <code>lang</code></dt> |
<dt>If the name of the pseudo$B!>(Bclass is <code>lang</code></dt> |
275 |
<dd> |
<dd> |
276 |
<ol> |
<ol> |
277 |
<li>Append a <code class=char>U+0028</code> <code class=charname>LEFT |
<li>Append a <code class=char>U+0028</code> <code class=charname>LEFT |
285 |
to <var>result</var>.</li> |
to <var>result</var>.</li> |
286 |
</ol> |
</ol> |
287 |
</dd> |
</dd> |
288 |
<dt>If pseudo$B!>(Bclass name is <code>-manakai-contains</code></dt> |
<dt>If the name of the pseudo$B!>(Bclass is |
289 |
|
<code>-manakai-contains</code></dt> |
290 |
<dd> |
<dd> |
291 |
<ol> |
<ol> |
292 |
<li>Append a <code class=char>U+0028</code> <code class=charname>LEFT |
<li>Append a <code class=char>U+0028</code> <code class=charname>LEFT |
300 |
to <var>result</var>.</li> |
to <var>result</var>.</li> |
301 |
</ol> |
</ol> |
302 |
</dd> |
</dd> |
303 |
<dt>If pseudo$B!>(Bclass name is <code>nth-child</code>, |
<dt>If name of the pseudo$B!>(Bclass is either <code>nth-child</code>, |
304 |
<code>nth-last-child</code>, <code>nth-of-type</code>, or |
<code>nth-last-child</code>, <code>nth-of-type</code>, or |
305 |
<code>nth-last-of-type</code></dt> |
<code>nth-last-of-type</code></dt> |
306 |
<dd> |
<dd> |
342 |
to <var>result</var>.</li> |
to <var>result</var>.</li> |
343 |
</ol> |
</ol> |
344 |
</dd> |
</dd> |
345 |
<dt>If pseudo$B!>(Bclass name is <code>not</code></dt> |
<dt>If the name of the pseudo$B!>(Bclass is <code>not</code></dt> |
346 |
<dd class=ed>@@</dd> |
<dd> |
347 |
|
<ol> |
348 |
|
<li>Append a string of <code class=char>U+003A</code> |
349 |
|
<code class=charname>COLON</code>, <code class=char>U+006E</code> |
350 |
|
<code class=charname>LATIN SMALL LETTER N</code>, |
351 |
|
<code class=char>U+006F</code> <code class=charname>LATIN |
352 |
|
SMALL LETTER O</code>, <code class=char>U+0074</code> |
353 |
|
<code class=charname>LATIN SMALL LETTER T</code>, and |
354 |
|
<code class=char>U+0028</code> <code class=charname>LEFT |
355 |
|
PARENTHESIS</code> (<code>:not(</code>), followed by a |
356 |
|
<a href="#newline">newline</a>, to <var>result</var>.</li> |
357 |
|
<li>Append four <code class=char>U+0020</code> |
358 |
|
<code class=charname>SPACE</code> characters to |
359 |
|
<var>result</var>.</li> |
360 |
|
<li>Append four <code class=char>U+0020</code> |
361 |
|
<code class=charname>SPACE</code> characters to |
362 |
|
<var>result</var> again.</li> |
363 |
|
<li><a href="#algorithm-serialize-a-simple-selector">Serialize |
364 |
|
the simple selector specified as the argument to the |
365 |
|
<code>not</code> pseudo$B!>(Bclass</a>.</li> |
366 |
|
<li>Append a <a href="#newline">newline</a> to |
367 |
|
<var>result</var>.</li> |
368 |
|
<li>Append four <code class=char>U+0020</code> |
369 |
|
<code class=charname>SPACE</code> characters to |
370 |
|
<var>result</var>.</li> |
371 |
|
<li>Append a <code class=char>U+0029</code> |
372 |
|
<code class=charname>RIGHT PARENTHESIS</code> |
373 |
|
(<code class=char>)</code>) character |
374 |
|
to <var>result</var>.</li> |
375 |
|
</ol> |
376 |
|
</dd> |
377 |
</dl> |
</dl> |
378 |
</li> |
</li> |
379 |
</ol> |
</ol> |
384 |
<li>Append two <code class=char>U+003A</code> |
<li>Append two <code class=char>U+003A</code> |
385 |
<code class=charname>COLON</code> characters (<code>::</code>) |
<code class=charname>COLON</code> characters (<code>::</code>) |
386 |
to <var>result</var>.</li> |
to <var>result</var>.</li> |
387 |
<li>Append <span class=ed>@@ normalized</span> |
<li>Append the <span class=ed>@@ normalized</span> name of the |
388 |
pseudo$B!>(Belement name to <var>result</var>.</li> |
pseudo$B!>(Belement to <var>result</var>.</li> |
389 |
<!-- For future version: append "(", arguments, ")", if any. --> |
<!-- For future version: append "(", arguments, ")", if any. --> |
390 |
</ol> |
</ol> |
391 |
</dd> |
</dd> |
392 |
</dl> |
</dl> |
393 |
|
|
394 |
|
|
395 |
|
<p>A <dfn id=newline title=newline>newline</dfn> |
396 |
|
<em class=rfc2119>SHOULD</em> be represented as a |
397 |
|
<code class=char>U+000A</code> <code class=charname>LINE FEED</code> |
398 |
|
character. However, depending on the context where |
399 |
|
the <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
400 |
|
representation is in use, a sequence of |
401 |
|
<code class=char>U+000D</code> <code class=charname>CARRIAGE RETURN</code> |
402 |
|
followed by a <code class=char>U+000A</code> |
403 |
|
<code class=charname>LINE FEED</code> or a character |
404 |
|
<code class=char>U+000D</code> <code class=charname>CARRIAGE RETURN</code> |
405 |
|
<em class=rfc2119>MAY</em> be used as a newline instead.</p> |
406 |
|
|
407 |
|
<div class="note memo"> |
408 |
|
<p>Therefore, when |
409 |
|
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
410 |
|
representations are literally compared, newlines must be normalized.</p> |
411 |
|
</div> |
412 |
|
|
413 |
</div> |
</div> |
414 |
|
|
415 |
<div class="section" id="parsing"> |
<div class="section" id="parsing"> |
416 |
<h2>Parsing |
<h2>Parsing |
417 |
<abbr title="Selectors Serialization Format for Testing">SFFT</abbr> |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
418 |
Groups of Selectors</h2> |
Groups of Selectors</h2> |
419 |
|
|
420 |
<p>Since <a href="#serializing">the serializing algorithm</a> is |
<p>Since <a href="#serializing">the serializing algorithm</a> is |
421 |
so designed that it always output a valid |
so designed that it always output a valid |
422 |
<a href="http://www.w3.org/TR/css3-selectors/#grouping">group of |
<a href="http://www.w3.org/TR/css3-selectors/#grouping">group of |
423 |
selectors</a>, no special parser for |
selectors</a>, no special parser for the |
424 |
<abbr title="Selectors Serialization Format for Testing">SFFT</abbr> |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
425 |
is necessary. Any conforming |
representation is necessary. Any conforming parser for |
426 |
<a href="http://www.w3.org/TR/css3-selectors/#grouping">group of |
<a href="http://www.w3.org/TR/css3-selectors/#grouping">groups of |
427 |
selectors</a> parser <em class=rfc2119>MAY</em> be used |
selectors</a> <em class=rfc2119>MAY</em> be used |
428 |
to parse <abbr title="Selectors Serialization Format for Testing">SFFT</abbr> |
to parse <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
429 |
groups of selectors.</p> |
representations of groups of selectors.</p> |
430 |
</div> |
</div> |
431 |
|
|
432 |
<div class="section" id="examples"> |
<div class="section" id="examples"> |