1 |
<!DOCTYPE html> |
<!DOCTYPE html> |
2 |
<html lang="en" class="formal-specification status-work-in-progress"> |
<html lang="en" class="formal-specification status-work-in-progress"> |
3 |
<head> |
<head> |
4 |
<title>Selectors Serialization Format for Testing (SSFT) Specification</title> |
<title>Selectors Serialization Format for Testing (SSFT)</title> |
5 |
<link rel="stylesheet" href="http://suika.fam.cx/www/style/html/spec"> |
<link rel="stylesheet" href="http://suika.fam.cx/www/style/html/spec"> |
6 |
<link rel="license" href="http://suika.fam.cx/c/gnu/fdl"> |
<link rel="license" href="http://suika.fam.cx/c/gnu/fdl"> |
7 |
</head> |
</head> |
8 |
<body class="has-abstract"> |
<body class="has-abstract"> |
9 |
|
|
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>)</h1> |
12 |
Specification</h1> |
<h2>Working Draft |
13 |
<h2>Working Draft <time datetime=2007-11-05>5 November 2007</time></h2> |
<time datetime=2007-12-09>9 December 2007</time></h2> |
14 |
|
|
15 |
<dl class="versions-uri"> |
<dl class="versions-uri"> |
16 |
<dt>This Version</dt> |
<dt>This Version</dt> |
17 |
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/selectors/ssft/ssft" |
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/selectors/ssft/ssft-work" |
18 |
>http://suika.fam.cx/www/markup/selectors/ssft/ssft</a>></code></dd> |
>http://suika.fam.cx/www/markup/selectors/ssft/ssft-work</a>></code></dd> |
19 |
<dt>Latest Version</dt> |
<dt>Latest Version</dt> |
20 |
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/selectors/ssft/ssft" |
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/selectors/ssft/ssft" |
21 |
>http://suika.fam.cx/www/markup/selectors/ssft/ssft</a>></code></dd> |
>http://suika.fam.cx/www/markup/selectors/ssft/ssft</a>></code></dd> |
|
<!-- |
|
22 |
<dt>Latest Working Draft</dt> |
<dt>Latest Working Draft</dt> |
23 |
--> |
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/selectors/ssft/ssft-work" |
24 |
<!-- <dt>Previous Version</dt> --> |
>http://suika.fam.cx/www/markup/selectors/ssft/ssft-work</a>></code></dd> |
25 |
|
<dt>Previous Version</dt> |
26 |
|
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/selectors/ssft/ssft-20071105" |
27 |
|
>http://suika.fam.cx/www/markup/selectors/ssft/ssft-20071105</a>></code></dd> |
28 |
<dt>Version History</dt> |
<dt>Version History</dt> |
29 |
<dd><code class=URI><<a href="http://suika.fam.cx/gate/cvs/markup/selectors/ssft/ssft.en.html">http://suika.fam.cx/gate/cvs/markup/selectors/ssft/ssft.en.html</a>></code></dd> |
<dd><code class=URI><<a href="http://suika.fam.cx/gate/cvs/markup/selectors/ssft/ssft-work.en.html">http://suika.fam.cx/gate/cvs/markup/selectors/ssft/ssft-work.en.html</a>></code></dd> |
30 |
</dl> |
<dt id=author>Author</dt> |
|
<dl class="authors" id="author"> |
|
|
<dt>Author</dt> |
|
31 |
<dd><a href="http://suika.fam.cx/~wakaba/who?" rel="author" |
<dd><a href="http://suika.fam.cx/~wakaba/who?" rel="author" |
32 |
lang=ja>Wakaba</a> |
lang=ja>Wakaba</a> |
33 |
<code class="mail"><<a href="mailto:w@suika.fam.cx" rel="author" |
<code class="mail"><<a href="mailto:w@suika.fam.cx" rel="author" |
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 |
|
|
62 |
<div id="status" class="section"> |
<div id="status" class="section"> |
63 |
<h2>Status of This Document</h2> |
<h2>Status of This Document</h2> |
64 |
|
|
65 |
<p class=section-info><em>This section describes the status of this document |
<p class=section-info>This section describes the status of this document at the |
66 |
at the time of its publication. Other documents |
time of its publication. Other documents might supersede this document.</p> |
67 |
might supersede this document.</em></p> |
|
68 |
|
<p><!-- This document is the specification -->This document is a working draft |
69 |
<p>This document is a working draft, produced as part of the |
of <abbr title="Selectors Serialization Format for Testing">SSFT</abbr>, |
70 |
<a href="http://suika.fam.cx/www/markup/html/whatpm/readme">Whatpm</a> |
produced as part of the |
71 |
subproject |
<a href="http://suika.fam.cx/www/markup/html/whatpm/readme">Whatpm</a> product |
72 |
of the <a href="http://suika.fam.cx/www/manakai-core/doc/web/">manakai</a> |
of the <a href="http://suika.fam.cx/www/manakai-core/doc/web/">manakai</a> |
73 |
project. It might be updated, replaced, or obsoleted by |
project. |
74 |
|
It might be updated, replaced, or obsoleted by |
75 |
other documents at any time. It is inappropriate to |
other documents at any time. It is inappropriate to |
76 |
cite this document as other than <q>work in progress</q>.</p> |
cite this document as other than <q>work in progress</q>.</p> |
77 |
|
|
78 |
<p>Comments on this document are welcome and |
<p>Comments on this document are welcome and |
79 |
may be sent to the <a href="#author">author</a>.</p> |
may be sent to the <a href="#author">author</a>.</p> |
80 |
|
|
81 |
<p>Translations of thie document might be available. |
<p>Translations of this document might be available. |
82 |
The English version of the document is the only |
The English version of the document is the only |
83 |
normative version.</p> |
normative version.</p> |
84 |
</div> |
</div> |
103 |
<cite class="bibref informative">[<a href="#ref-SAPI">SAPI</a>]</cite>.</p> |
<cite class="bibref informative">[<a href="#ref-SAPI">SAPI</a>]</cite>.</p> |
104 |
|
|
105 |
<p>It is so flexible language that a conceptually same pattern |
<p>It is so flexible language that a conceptually same pattern |
106 |
can be represented in inifnite numbers of instances of selectors. |
can be represented in infinite numbers of instances of selectors. |
107 |
It might be convinient for e.g. validation of a test result to |
It might be convenient for e.g. validation of a test result to |
108 |
define a subset of the language, in which no semantically equivalent |
define a subset of the language, in which no semantically equivalent |
109 |
selectors are contained.</p> |
selectors are contained.</p> |
110 |
|
|
129 |
|
|
130 |
<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>, |
131 |
<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>, |
132 |
<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 |
|
133 |
<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 |
134 |
document are to be interpreted as described in |
document are to be interpreted as described in |
135 |
<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> |
169 |
<p>The serialized representation will not contain any comment.</p> |
<p>The serialized representation will not contain any comment.</p> |
170 |
</div> |
</div> |
171 |
|
|
|
<div class="ed issue"><p>TODO: link terms to Selectors</p></div> |
|
|
|
|
172 |
<div class=section id=serializing-tokens> |
<div class=section id=serializing-tokens> |
173 |
<h3>Serializing Tokens</h3> |
<h3>Serializing Tokens</h3> |
174 |
|
|
199 |
<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 |
200 |
<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 |
201 |
<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 |
202 |
<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 |
203 |
hexadecimal representation of the character. If the character |
zero$B!>(Bpadded hexadecimal representation of the character. If the character |
204 |
is outside the range of <code>[<code class=char>U+0000</code>, |
is outside the range of <code>[<code class=char>U+0000</code>, |
205 |
<code class=char>U+10FFFF</code>]</code>, <var>HHHHHH</var> |
<code class=char>U+10FFFF</code>]</code>, <var>HHHHHH</var> |
206 |
<em class=rfc2119>MUST</em> be <code>FFFFFF</code>.</li> |
<em class=rfc2119>MUST</em> be <code>FFFFFF</code>.</li> |
252 |
SQUARE BRACKET</code> to <code class=char>U+D7FF</code>, or |
SQUARE BRACKET</code> to <code class=char>U+D7FF</code>, or |
253 |
<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 |
254 |
<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 |
255 |
<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 |
256 |
hexadecimal representation of the character. If the character |
zero$B!>(Bpadded hexadecimal representation of the character. If the character |
257 |
is outside the range of <code>[<code class=char>U+0000</code>, |
is outside the range of <code>[<code class=char>U+0000</code>, |
258 |
<code class=char>U+10FFFF</code>]</code>, <var>HHHHHH</var> |
<code class=char>U+10FFFF</code>]</code>, <var>HHHHHH</var> |
259 |
<em class=rfc2119>MUST</em> be <code>FFFFFF</code>.</p></li> |
<em class=rfc2119>MUST</em> be <code>FFFFFF</code>.</p></li> |
289 |
</div> |
</div> |
290 |
|
|
291 |
<div class="issue ed"> |
<div class="issue ed"> |
292 |
<p>Need to define <dfn id=lower-case>lower$B!>(Bcase</dfn>. |
<p>In a future version of the specification, we need to define |
293 |
It is tr/A-Z/a-z/ for now.</p> |
<dfn id=lowercase>lowercase</dfn> (maybe by referencing some version of |
294 |
|
some module of <abbr>CSS</abbr>). It is <code>tr/A-Z/a-z/</code> for now.</p> |
295 |
</div> |
</div> |
296 |
|
|
297 |
<p>To |
<p>To |
298 |
<dfn id=algorithm-normalize-an-integer title="normalize an integer">normalize |
<dfn id=algorithm-normalize-an-integer title="normalize an integer">normalize |
299 |
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 |
300 |
algorithm <em class=rfc2119>MUST</em> be run:</p> |
algorithm <em class=rfc2119>MUST</em> be used:</p> |
301 |
<ol class=algorithm> |
<ol class=algorithm> |
302 |
<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 |
303 |
character: <code class=char>U+0030</code> |
character: <code class=char>U+0030</code> |
435 |
to <var>r</var>.</li> |
to <var>r</var>.</li> |
436 |
<li>Append the |
<li>Append the |
437 |
<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> |
438 |
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 |
439 |
<var>r</var>.</li> |
<var>r</var>.</li> |
440 |
<li>Append any arguments as following: |
<li>Append any arguments as following: |
441 |
<dl class=switch> |
<dl class=switch> |
491 |
<li>Let <var>a</var> be the |
<li>Let <var>a</var> be the |
492 |
<a href="#algorithm-normalize-an-integer" title="normalize an integer">normalized |
<a href="#algorithm-normalize-an-integer" title="normalize an integer">normalized |
493 |
string representation</a> of integer <var>a</var>.</li> |
string representation</a> of integer <var>a</var>.</li> |
494 |
<li>Append <var>a</var> to <var>result</var>.</li> |
<li>Append <var>a</var> to <var>r</var>.</li> |
495 |
<li>Append a <code class=char>U+006E</code> |
<li>Append a <code class=char>U+006E</code> |
496 |
<code class=charname>LATIN SMALL LETTER N</code> |
<code class=charname>LATIN SMALL LETTER N</code> |
497 |
(<code class=char>n</code>) character to <var>r</var>.</li> |
(<code class=char>n</code>) character to <var>r</var>.</li> |
509 |
<code class=charname>HYPHEN-MINUS</code> (<code class=char>-</code>) |
<code class=charname>HYPHEN-MINUS</code> (<code class=char>-</code>) |
510 |
character, then append <code class=char>U+002B</code> |
character, then append <code class=char>U+002B</code> |
511 |
<code class=charname>PLUS SIGN</code> |
<code class=charname>PLUS SIGN</code> |
512 |
(<code class=char>+</code>) to <var>result</var>.</li> |
(<code class=char>+</code>) to <var>r</var>.</li> |
513 |
<li>Append <var>b</var> to <var>result</var>.</li> |
<li>Append <var>b</var> to <var>r</var>.</li> |
514 |
<li>Append a <code class=char>U+0029</code> |
<li>Append a <code class=char>U+0029</code> |
515 |
<code class=charname>RIGHT PARENTHESIS</code> |
<code class=charname>RIGHT PARENTHESIS</code> |
516 |
(<code class=char>)</code>) character |
(<code class=char>)</code>) character |
567 |
to <var>r</var>.</li> |
to <var>r</var>.</li> |
568 |
<li>Append the |
<li>Append the |
569 |
<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> |
570 |
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 |
571 |
to <var>r</var>.</li> |
to <var>r</var>.</li> |
572 |
<li>If the pseudo$B!>(Belement has any arguments: |
<li>If the pseudo$B!>(Belement has any arguments: |
573 |
The pseudo$B!>(Belement is not supported by this version of |
The pseudo$B!>(Belement is not supported by this version of |
613 |
<li>Process each sequence of simple selectors or |
<li>Process each sequence of simple selectors or |
614 |
combinator in <var>selector</var> as following: |
combinator in <var>selector</var> as following: |
615 |
<dl class=switch> |
<dl class=switch> |
616 |
<dt>If it is a sequence of simle selector |
<dt>If it is a sequence of simple selector |
617 |
(<dfn id=var-sss><var>sss</var></dfn>)</dt> |
(<dfn id=var-sss><var>sss</var></dfn>)</dt> |
618 |
<dd> |
<dd> |
619 |
<ol> |
<ol> |
722 |
|
|
723 |
<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> |
724 |
|
|
|
<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> |
|
|
|
|
725 |
<div class="example figure block"> |
<div class="example figure block"> |
726 |
<div class="caption">...</div> |
<p>The <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
727 |
|
representation of a selector <code>p + q</code> is:</p> |
728 |
|
|
729 |
<pre><code>...</code></pre> |
<pre><code> *|p |
730 |
|
+ *|q |
731 |
|
</code></pre> |
732 |
</div> |
</div> |
733 |
|
|
734 |
|
<div class="example figure block"> |
735 |
|
<p>The <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
736 |
|
representation of a selector <code>a#id.class1:n\ot(:Active)/* |
737 |
|
comment |
738 |
|
*/.class2</code> is:</p> |
739 |
|
|
740 |
|
<pre><code> *|a.class1.class2#id:not( |
741 |
|
:active |
742 |
|
) |
743 |
|
</code></pre> |
744 |
|
</div> |
745 |
|
|
746 |
|
<div class="example figure block"> |
747 |
|
<p>The <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
748 |
|
representation of a |
749 |
|
<a href="http://www.w3.org/TR/css3-selectors/#grouping">group of selectors</a> |
750 |
|
<code>a, #b, C[d^=e], .\31 23</code> is:</p> |
751 |
|
|
752 |
|
<pre><code> *|a |
753 |
|
, |
754 |
|
*|*#b |
755 |
|
, |
756 |
|
*|C[|d^="e"] |
757 |
|
, |
758 |
|
*|*.\00003123 |
759 |
|
</code></pre> |
760 |
</div> |
</div> |
761 |
|
|
762 |
</div> |
</div> |
808 |
<dt id=ref-HTML5>HTML5</dt> |
<dt id=ref-HTML5>HTML5</dt> |
809 |
<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>, |
810 |
<abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr> |
<abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr> |
811 |
Working Draft. Work in progress.</dd> |
Working Draft, <time datetime="2007-11-03">3 November 2007</time>. |
812 |
|
Work in progress.</dd> |
813 |
<dt id=ref-SAPI>SAPI</dt> |
<dt id=ref-SAPI>SAPI</dt> |
814 |
<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>, |
815 |
<abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft, |
<abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft, |