148 |
</div> |
</div> |
149 |
|
|
150 |
<div class="section" id="serializing"> |
<div class="section" id="serializing"> |
151 |
<h2>Serializing Selectors as |
<h2>Serializing Selectors in |
152 |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
153 |
Representation</h2> |
Representation</h2> |
154 |
|
|
287 |
representations are literally compared.</p> |
representations are literally compared.</p> |
288 |
</div> |
</div> |
289 |
|
|
290 |
|
<div class="issue ed"> |
291 |
|
<p>Need to define <dfn id=lower-case>lower$B!>(Bcase</dfn>. |
292 |
|
It is tr/A-Z/a-z/ for now.</p> |
293 |
|
</div> |
294 |
|
|
295 |
</div> |
</div> |
296 |
|
|
297 |
|
|
314 |
<dt>If <var>ss</var> is a type or universal selector</dt> |
<dt>If <var>ss</var> is a type or universal selector</dt> |
315 |
<dd> |
<dd> |
316 |
<ol> |
<ol> |
317 |
<li> |
<li>Append a namespace prefix as following: |
318 |
|
|
319 |
<dl class=switch> |
<dl class=switch> |
320 |
<dt>If a namespace URI is specified (via namespace prefix, or |
<dt>If a namespace URI is specified (via namespace prefix, or |
321 |
by omitting namespace prefix where a default namespace is specified)</dt> |
by omitting namespace prefix where a default namespace is specified)</dt> |
404 |
to <var>r</var>.</li> |
to <var>r</var>.</li> |
405 |
<li>Append the |
<li>Append the |
406 |
<a href="#algorithm-normalize-an-ident" title="normalize an IDENT">normalized</a> |
<a href="#algorithm-normalize-an-ident" title="normalize an IDENT">normalized</a> |
407 |
name of the pseudo$B!>(Bclass to <var>r</var>.</li> |
name (in <a href="#lower-case">lower$B!>(Bcase</a>) of the pseudo$B!>(Bclass to |
408 |
|
<var>r</var>.</li> |
409 |
<li>Append any arguments as following: |
<li>Append any arguments as following: |
410 |
<dl class=switch> |
<dl class=switch> |
411 |
<dt>If the name of the pseudo$B!>(Bclass is <code>lang</code></dt> |
<dt>If the name of the pseudo$B!>(Bclass is <code>lang</code></dt> |
416 |
to <var>r</var>.</li> |
to <var>r</var>.</li> |
417 |
<li>Append the |
<li>Append the |
418 |
<a href="#algorithm-normalize-an-ident" title="normalize an IDENT">normalized</a> |
<a href="#algorithm-normalize-an-ident" title="normalize an IDENT">normalized</a> |
419 |
language tag (the argument) to <var>r</var>.</li> |
language tag (the argument) to <var>r</var>. |
420 |
|
<span class="issue ed">Should we normalize cases?</span></li> |
421 |
<li>Append a <code class=char>U+0029</code> |
<li>Append a <code class=char>U+0029</code> |
422 |
<code class=charname>RIGHT PARENTHESIS</code> |
<code class=charname>RIGHT PARENTHESIS</code> |
423 |
(<code class=char>)</code>) character |
(<code class=char>)</code>) character |
532 |
to <var>r</var>.</li> |
to <var>r</var>.</li> |
533 |
<li>Append the |
<li>Append the |
534 |
<a href="#algorithm-normalize-an-ident" title="normalize an IDENT">normalized</a> |
<a href="#algorithm-normalize-an-ident" title="normalize an IDENT">normalized</a> |
535 |
name of the pseudo$B!>(Belement to <var>r</var>.</li> |
name (in <a href="#lower-case">lower$B!>(Bcase</a>) of the pseudo$B!>(Belement |
536 |
|
to <var>r</var>.</li> |
537 |
<li>If the pseudo$B!>(Belement has any arguments: |
<li>If the pseudo$B!>(Belement has any arguments: |
538 |
The pseudo$B!>(Belement is not supported by this version of |
The pseudo$B!>(Belement is not supported by this version of |
539 |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
556 |
<h3>Serializing Groups of Selectors</h3> |
<h3>Serializing Groups of Selectors</h3> |
557 |
|
|
558 |
<p>No <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
<p>No <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
559 |
representation is defined for an invalid group of selectors.</p> |
representation is defined for an invalid |
560 |
|
<a href="http://www.w3.org/TR/css3-selectors/#grouping">group of |
561 |
|
selectors</a>.</p> |
562 |
|
|
563 |
<p>To |
<p>To |
564 |
<dfn id=algorithm-serialize-a-group-of-selectors title="serialize a group of selectors">serialize |
<dfn id=algorithm-serialize-a-group-of-selectors title="serialize a group of selectors">serialize |
570 |
<var>gs</var>: |
<var>gs</var>: |
571 |
<ol> |
<ol> |
572 |
<li>If <var>selector</var> is <em>not</em> the first selector |
<li>If <var>selector</var> is <em>not</em> the first selector |
573 |
in the group of selectors, then append a <code class=char>U+002C</code> |
in the <var>gs</var>, then append a <code class=char>U+002C</code> |
574 |
<code class=charname>COMMA</code> (<code class=char>,</code>) followed by a |
<code class=charname>COMMA</code> (<code class=char>,</code>) followed by a |
575 |
<a href="#newline">newline</a> to <var>result</var>.</li> |
<a href="#newline">newline</a> to <var>result</var>.</li> |
576 |
<li>Append four <code class=char>U+0020</code> |
<li>Append four <code class=char>U+0020</code> |
637 |
<div class="section" id="parsing"> |
<div class="section" id="parsing"> |
638 |
<h2>Parsing |
<h2>Parsing |
639 |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
640 |
Groups of Selectors</h2> |
Representations of Selectors</h2> |
641 |
|
|
642 |
<p>Since <a href="#serializing">the serializing algorithm</a> is |
<p>Since <a href="#algorithm-serialize-a-group-of-selectors">the serializing |
643 |
so designed that it always output a valid |
algorithm for groups of selectors</a> is so designed that it always outputs a |
644 |
<a href="http://www.w3.org/TR/css3-selectors/#grouping">group of |
valid <a href="http://www.w3.org/TR/css3-selectors/#grouping">group of |
645 |
selectors</a>, no special parser for the |
selectors</a>, no special parser for the |
646 |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
647 |
representation is necessary. Any conforming parser for |
representation is necessary. Any conforming parser for |
648 |
<a href="http://www.w3.org/TR/css3-selectors/#grouping">groups of |
<a href="http://www.w3.org/TR/css3-selectors/#grouping">groups of |
649 |
selectors</a> <em class=rfc2119>MAY</em> be used |
selectors</a> <em class=rfc2119>MAY</em> be used |
650 |
to parse <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
to parse <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
651 |
representations of groups of selectors.</p> |
representations of |
652 |
|
<a href="http://www.w3.org/TR/css3-selectors/#grouping">groups of |
653 |
|
selectors</a>.</p> |
654 |
|
|
655 |
|
<p>Likewise, <a href="#algorithm-serialize-a-simple-selector">the serializing |
656 |
|
algorithm for simple selectors</a> always outputs a valid |
657 |
|
<a href="#simple-selector">simple selector</a> and therefore any |
658 |
|
conforming parser for <a href="#simple-selector">simple selector</a> |
659 |
|
<em class=rfc2119>MAY</em> be used to parse |
660 |
|
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
661 |
|
representations of <a href="#simple-selector">simple selectors</a>.</p> |
662 |
</div> |
</div> |
663 |
|
|
664 |
<div class="section" id="examples"> |
<div class="section" id="examples"> |
694 |
<a href="urn:ietf:bcp:14"><abbr title="Best Current Practice">BCP</abbr> |
<a href="urn:ietf:bcp:14"><abbr title="Best Current Practice">BCP</abbr> |
695 |
14</a>, <abbr title="Request for Comments">RFC</abbr> 2119, |
14</a>, <abbr title="Request for Comments">RFC</abbr> 2119, |
696 |
<time datetime=1997-03>March 1997</time>. |
<time datetime=1997-03>March 1997</time>. |
697 |
This version of the specification is referenced</dd> |
This version of the specification is referenced.</dd> |
698 |
<dt id=ref-SELECTORS>SELECTORS</dt> |
<dt id=ref-SELECTORS>SELECTORS</dt> |
699 |
<dd><a href="http://www.w3.org/TR/2005/WD-css3-selectors-20051215"><cite>Selectors</cite></a>, |
<dd><a href="http://www.w3.org/TR/2005/WD-css3-selectors-20051215"><cite>Selectors</cite></a>, |
700 |
<abbr title="World Wide Web Consortium">W3C</abbr> Working Draft, |
<abbr title="World Wide Web Consortium">W3C</abbr> Working Draft, |