52 |
<div id="abstract" class="section"> |
<div id="abstract" class="section"> |
53 |
<h2>Abstract</h2> |
<h2>Abstract</h2> |
54 |
|
|
55 |
<div class="ed issue">...</div> |
<p>This document defines |
56 |
|
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr>, |
57 |
|
a subset of Selectors language which is suitable for describing results |
58 |
|
of Selectors parsing tests.</p> |
59 |
|
|
60 |
</div> |
</div> |
61 |
|
|
128 |
|
|
129 |
<p>The key words <q><dfn id=must><em class="rfc2119">MUST</em></dfn></q>, |
<p>The key words <q><dfn id=must><em class="rfc2119">MUST</em></dfn></q>, |
130 |
<q><dfn id=must-not><em class="rfc2119">MUST NOT</em></dfn></q>, |
<q><dfn id=must-not><em class="rfc2119">MUST NOT</em></dfn></q>, |
131 |
<q><dfn id=should><em class="rfc2119">SHOULD</em></dfn></q>, |
<q><dfn id=should><em class="rfc2119">SHOULD</em></dfn></q>, and |
|
<q><dfn id=should-not><em class="rfc2119">SHOULD NOT</em></dfn></q>, and |
|
132 |
<q><dfn id=may><em class=rfc2119>MAY</em></dfn></q> in this |
<q><dfn id=may><em class=rfc2119>MAY</em></dfn></q> in this |
133 |
document are to be interpreted as described in |
document are to be interpreted as described in |
134 |
<a href="urn:ietf:rfc:2119"><abbr title="Request for Comments">RFC</abbr> |
<a href="urn:ietf:rfc:2119"><abbr title="Request for Comments">RFC</abbr> |
200 |
<code class=char>U+0080</code> to <code class=char>U+D7FF</code>, or |
<code class=char>U+0080</code> to <code class=char>U+D7FF</code>, or |
201 |
<code class=char>U+E000</code> to <code class=char>U+10FFFF</code> in |
<code class=char>U+E000</code> to <code class=char>U+10FFFF</code> in |
202 |
<var>n</var>, then replace it by string <code>\<var>HHHHHH</var></code>, where |
<var>n</var>, then replace it by string <code>\<var>HHHHHH</var></code>, where |
203 |
<dfn id=var-HHHHHH><var>HHHHHH</var></dfn> is the upper$B!>(Bcase zero$B!>(Bpadded |
<dfn id=var-ident-HHHHHH><var>HHHHHH</var></dfn> is the uppercase |
204 |
hexadecimal representation of the character. If the character |
zero$B!>(Bpadded hexadecimal representation of the character. If the character |
205 |
is outside the range of <code>[<code class=char>U+0000</code>, |
is outside the range of <code>[<code class=char>U+0000</code>, |
206 |
<code class=char>U+10FFFF</code>]</code>, <var>HHHHHH</var> |
<code class=char>U+10FFFF</code>]</code>, <var>HHHHHH</var> |
207 |
<em class=rfc2119>MUST</em> be <code>FFFFFF</code>.</li> |
<em class=rfc2119>MUST</em> be <code>FFFFFF</code>.</li> |
253 |
SQUARE BRACKET</code> to <code class=char>U+D7FF</code>, or |
SQUARE BRACKET</code> to <code class=char>U+D7FF</code>, or |
254 |
<code class=char>U+E000</code> to <code class=char>U+10FFFF</code> in |
<code class=char>U+E000</code> to <code class=char>U+10FFFF</code> in |
255 |
<var>s</var>, then replace it by string <code>\<var>HHHHHH</var></code>, where |
<var>s</var>, then replace it by string <code>\<var>HHHHHH</var></code>, where |
256 |
<dfn id=var-HHHHHH><var>HHHHHH</var></dfn> is the upper$B!>(Bcase zero$B!>(Bpadded |
<dfn id=var-string-HHHHHH><var>HHHHHH</var></dfn> is the uppercase |
257 |
hexadecimal representation of the character. If the character |
zero$B!>(Bpadded hexadecimal representation of the character. If the character |
258 |
is outside the range of <code>[<code class=char>U+0000</code>, |
is outside the range of <code>[<code class=char>U+0000</code>, |
259 |
<code class=char>U+10FFFF</code>]</code>, <var>HHHHHH</var> |
<code class=char>U+10FFFF</code>]</code>, <var>HHHHHH</var> |
260 |
<em class=rfc2119>MUST</em> be <code>FFFFFF</code>.</p></li> |
<em class=rfc2119>MUST</em> be <code>FFFFFF</code>.</p></li> |
290 |
</div> |
</div> |
291 |
|
|
292 |
<div class="issue ed"> |
<div class="issue ed"> |
293 |
<p>Need to define <dfn id=lower-case>lower$B!>(Bcase</dfn>. |
<p>In a future version of the specification, we need to define |
294 |
It is tr/A-Z/a-z/ for now.</p> |
<dfn id=lowercase>lowercase</dfn> (maybe by referencing some version of |
295 |
|
some module of <abbr>CSS</abbr>). It is <code>tr/A-Z/a-z/</code> for now.</p> |
296 |
</div> |
</div> |
297 |
|
|
298 |
<p>To |
<p>To |
299 |
<dfn id=algorithm-normalize-an-integer title="normalize an integer">normalize |
<dfn id=algorithm-normalize-an-integer title="normalize an integer">normalize |
300 |
an integer (<dfn id=var-int-i><var>i</var></dfn>)</dfn>, the following |
an integer (<dfn id=var-int-i><var>i</var></dfn>)</dfn>, the following |
301 |
algorithm <em class=rfc2119>MUST</em> be run:</p> |
algorithm <em class=rfc2119>MUST</em> be used:</p> |
302 |
<ol class=algorithm> |
<ol class=algorithm> |
303 |
<li>If <var>i</var> is equal to zero (0), return a string with only a |
<li>If <var>i</var> is equal to zero (0), return a string with only a |
304 |
character: <code class=char>U+0030</code> |
character: <code class=char>U+0030</code> |
436 |
to <var>r</var>.</li> |
to <var>r</var>.</li> |
437 |
<li>Append the |
<li>Append the |
438 |
<a href="#algorithm-normalize-an-ident" title="normalize a string (IDENT) as an IDENT">normalized</a> |
<a href="#algorithm-normalize-an-ident" title="normalize a string (IDENT) as an IDENT">normalized</a> |
439 |
name (in <a href="#lower-case">lower$B!>(Bcase</a>) of the pseudo$B!>(Bclass to |
name (in <a href="#lowercase">lowercase</a>) of the pseudo$B!>(Bclass to |
440 |
<var>r</var>.</li> |
<var>r</var>.</li> |
441 |
<li>Append any arguments as following: |
<li>Append any arguments as following: |
442 |
<dl class=switch> |
<dl class=switch> |
492 |
<li>Let <var>a</var> be the |
<li>Let <var>a</var> be the |
493 |
<a href="#algorithm-normalize-an-integer" title="normalize an integer">normalized |
<a href="#algorithm-normalize-an-integer" title="normalize an integer">normalized |
494 |
string representation</a> of integer <var>a</var>.</li> |
string representation</a> of integer <var>a</var>.</li> |
495 |
<li>Append <var>a</var> to <var>result</var>.</li> |
<li>Append <var>a</var> to <var>r</var>.</li> |
496 |
<li>Append a <code class=char>U+006E</code> |
<li>Append a <code class=char>U+006E</code> |
497 |
<code class=charname>LATIN SMALL LETTER N</code> |
<code class=charname>LATIN SMALL LETTER N</code> |
498 |
(<code class=char>n</code>) character to <var>r</var>.</li> |
(<code class=char>n</code>) character to <var>r</var>.</li> |
510 |
<code class=charname>HYPHEN-MINUS</code> (<code class=char>-</code>) |
<code class=charname>HYPHEN-MINUS</code> (<code class=char>-</code>) |
511 |
character, then append <code class=char>U+002B</code> |
character, then append <code class=char>U+002B</code> |
512 |
<code class=charname>PLUS SIGN</code> |
<code class=charname>PLUS SIGN</code> |
513 |
(<code class=char>+</code>) to <var>result</var>.</li> |
(<code class=char>+</code>) to <var>r</var>.</li> |
514 |
<li>Append <var>b</var> to <var>result</var>.</li> |
<li>Append <var>b</var> to <var>r</var>.</li> |
515 |
<li>Append a <code class=char>U+0029</code> |
<li>Append a <code class=char>U+0029</code> |
516 |
<code class=charname>RIGHT PARENTHESIS</code> |
<code class=charname>RIGHT PARENTHESIS</code> |
517 |
(<code class=char>)</code>) character |
(<code class=char>)</code>) character |
568 |
to <var>r</var>.</li> |
to <var>r</var>.</li> |
569 |
<li>Append the |
<li>Append the |
570 |
<a href="#algorithm-normalize-an-ident" title="normalize a string (IDENT) as an IDENT">normalized</a> |
<a href="#algorithm-normalize-an-ident" title="normalize a string (IDENT) as an IDENT">normalized</a> |
571 |
name (in <a href="#lower-case">lower$B!>(Bcase</a>) of the pseudo$B!>(Belement |
name (in <a href="#lowercase">lowercase</a>) of the pseudo$B!>(Belement |
572 |
to <var>r</var>.</li> |
to <var>r</var>.</li> |
573 |
<li>If the pseudo$B!>(Belement has any arguments: |
<li>If the pseudo$B!>(Belement has any arguments: |
574 |
The pseudo$B!>(Belement is not supported by this version of |
The pseudo$B!>(Belement is not supported by this version of |
723 |
|
|
724 |
<p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p> |
<p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p> |
725 |
|
|
|
<div class="ed issue"> |
|
|
<p><a href="http://suika.fam.cx/gate/2007/css/parser-interface">Try demo</a>, |
|
|
by choosing <q>Selectors</q> radio button.</p> |
|
|
|
|
726 |
<div class="example figure block"> |
<div class="example figure block"> |
727 |
<div class="caption">...</div> |
<p>The <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
728 |
|
representation of a selector <code>p + q</code> is:</p> |
729 |
|
|
730 |
<pre><code>...</code></pre> |
<pre><code> *|p |
731 |
|
+ *|q |
732 |
|
</code></pre> |
733 |
</div> |
</div> |
734 |
|
|
735 |
|
<div class="example figure block"> |
736 |
|
<p>The <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
737 |
|
representation of a selector <code>a#id.class1:n\ot(:Active)/* |
738 |
|
comment |
739 |
|
*/.class2</code> is:</p> |
740 |
|
|
741 |
|
<pre><code> *|a.class1.class2#id:not( |
742 |
|
:active |
743 |
|
) |
744 |
|
</code></pre> |
745 |
|
</div> |
746 |
|
|
747 |
|
<div class="example figure block"> |
748 |
|
<p>The <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
749 |
|
representation of a |
750 |
|
<a href="http://www.w3.org/TR/css3-selectors/#grouping">group of selectors</a> |
751 |
|
<code>a, #b, C[d^=e], .\31 23</code> is:</p> |
752 |
|
|
753 |
|
<pre><code> *|a |
754 |
|
, |
755 |
|
*|*#b |
756 |
|
, |
757 |
|
*|C[|d^="e"] |
758 |
|
, |
759 |
|
*|*.\00003123 |
760 |
|
</code></pre> |
761 |
</div> |
</div> |
762 |
|
|
763 |
</div> |
</div> |
809 |
<dt id=ref-HTML5>HTML5</dt> |
<dt id=ref-HTML5>HTML5</dt> |
810 |
<dd><cite><a href="http://whatwg.org/html5"><abbr>HTML</abbr> 5</a></cite>, |
<dd><cite><a href="http://whatwg.org/html5"><abbr>HTML</abbr> 5</a></cite>, |
811 |
<abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr> |
<abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr> |
812 |
Working Draft. Work in progress.</dd> |
Working Draft, <time datetime="2007-11-03">3 November 2007</time>. |
813 |
|
Work in progress.</dd> |
814 |
<dt id=ref-SAPI>SAPI</dt> |
<dt id=ref-SAPI>SAPI</dt> |
815 |
<dd><cite><a href="http://dev.w3.org/cvsweb/~checkout~/2006/webapi/selectors-api/Overview.html?rev=1.28&content-type=text/html;%20charset=utf-8">Selectors <abbr>API</abbr></a></cite>, |
<dd><cite><a href="http://dev.w3.org/cvsweb/~checkout~/2006/webapi/selectors-api/Overview.html?rev=1.28&content-type=text/html;%20charset=utf-8">Selectors <abbr>API</abbr></a></cite>, |
816 |
<abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft, |
<abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft, |