| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en" class="formal-specification status-work-in-progress"> |
| 3 |
<head> |
| 4 |
<title>Selectors Serialization Format for Testing (SSFT) Specification</title> |
| 5 |
<link rel="stylesheet" href="http://suika.fam.cx/www/style/html/spec"> |
| 6 |
<link rel="license" href="http://suika.fam.cx/c/gnu/fdl"> |
| 7 |
</head> |
| 8 |
<body class="has-abstract"> |
| 9 |
|
| 10 |
<div class="header"> |
| 11 |
<h1>Selectors Serialization Format for Testing (<abbr>SSFT</abbr>) |
| 12 |
Specification</h1> |
| 13 |
<h2>Working Draft <time datetime=2007-10-15>15 October 2007</time></h2> |
| 14 |
|
| 15 |
<dl class="versions-uri"> |
| 16 |
<dt>This Version</dt> |
| 17 |
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/selectors/ssft/ssft" |
| 18 |
>http://suika.fam.cx/www/markup/selectors/ssft/ssft</a>></code></dd> |
| 19 |
<dt>Latest Version</dt> |
| 20 |
<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> |
| 22 |
<!-- |
| 23 |
<dt>Latest Working Draft</dt> |
| 24 |
--> |
| 25 |
<!-- <dt>Previous Version</dt> --> |
| 26 |
<dt>Version History</dt> |
| 27 |
<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> |
| 28 |
</dl> |
| 29 |
<dl class="authors" id="author"> |
| 30 |
<dt>Author</dt> |
| 31 |
<dd><a href="http://suika.fam.cx/~wakaba/who?" rel="author" |
| 32 |
lang=ja>Wakaba</a> |
| 33 |
<code class="mail"><<a href="mailto:w@suika.fam.cx" rel="author" |
| 34 |
>w@suika.fam.cx</a>></code></dd> |
| 35 |
</dl> |
| 36 |
|
| 37 |
<p class="copyright" lang="en">© <time>2007</time> <a |
| 38 |
href="http://suika.fam.cx/~wakaba/who?" rel="author">Wakaba</a>. |
| 39 |
Permission is granted to copy, distribute and/or modify this document |
| 40 |
under the terms of the <a rel="license" |
| 41 |
href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>, |
| 42 |
Version 1.2 |
| 43 |
or any later version published by the <a |
| 44 |
href="http://www.fsf.org/">Free Software Foundation</a>; |
| 45 |
with no Invariant Sections, no Front$B!>(BCover Texts, and no Back$B!>(BCover |
| 46 |
Texts. A copy of the license is |
| 47 |
available at <code class="URI"><<a |
| 48 |
href="http://www.gnu.org/copyleft/fdl.html" |
| 49 |
rel="license">http://www.gnu.org/copyleft/fdl.html</a>></code>.</p> |
| 50 |
</div> |
| 51 |
|
| 52 |
<div id="abstract" class="section"> |
| 53 |
<h2>Abstract</h2> |
| 54 |
|
| 55 |
<div class="ed issue">...</div> |
| 56 |
|
| 57 |
</div> |
| 58 |
|
| 59 |
<div id="status" class="section"> |
| 60 |
<h2>Status of This Document</h2> |
| 61 |
|
| 62 |
<p class=section-info><em>This section describes the status of this document |
| 63 |
at the time of its publication. Other documents |
| 64 |
might supersede this document.</em></p> |
| 65 |
|
| 66 |
<p>This document is a working draft, produced as part |
| 67 |
of the <a href="http://suika.fam.cx/www/manakai-core/doc/web/">manakai</a> |
| 68 |
project. It might be updated, replaced, or obsoleted by |
| 69 |
other documents at any time. It is inappropriate to |
| 70 |
cite this document as other than <q>work in progress</q>.</p> |
| 71 |
|
| 72 |
<p>Comments on this document are welcome and |
| 73 |
may be sent to the <a href="#author">author</a>.</p> |
| 74 |
|
| 75 |
<p>Translations of thie document might be available. |
| 76 |
The English version of the document is the only |
| 77 |
normative version.</p> |
| 78 |
</div> |
| 79 |
|
| 80 |
<div id="introduction" class="section"> |
| 81 |
<h2>Introduction</h2> |
| 82 |
|
| 83 |
<p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p> |
| 84 |
|
| 85 |
<p>Selectors |
| 86 |
<cite class="bibref normative">[<a href="#ref-SELECTORS">SELECTORS</a>]</cite> |
| 87 |
are patterns that match against elements |
| 88 |
in a tree structure and are used in Web technologies, including |
| 89 |
<a href="http://www.w3.org/TR/CSS21"><abbr title="Cascading Style Sheets">CSS</abbr></a> |
| 90 |
<cite class="bibref informative">[<a href="#ref-CSS">CSS</a>]</cite>, |
| 91 |
<a href="http://whatwg.org/html5"><abbr title="Hypertext Markup Language">HTML</abbr>5</a> |
| 92 |
<cite class="bibref informative">[<a href="#ref-HTML5">HTML5</a>]</cite>, |
| 93 |
<a href="http://www.mozilla.org/projects/xbl/xbl2.html"><abbr title="XML Binding Language">XBL</abbr>2</a> |
| 94 |
<cite class="bibref informative">[<a href="#ref-XBL2">XBL2</a>]</cite>, and |
| 95 |
<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 |
| 96 |
<abbr>API</abbr></a> |
| 97 |
<cite class="bibref informative">[<a href="#ref-SAPI">SAPI</a>]</cite>.</p> |
| 98 |
|
| 99 |
<div class="issue ed">...</div> |
| 100 |
|
| 101 |
<p><a href="http://dev.w3.org/cvsweb/csswg/cssom/Overview.html">The |
| 102 |
<abbr title="Cascading Style Sheets Object Model">CSSOM</abbr> |
| 103 |
specification</a> |
| 104 |
<cite class="bibref informative">[<a href="#ref-CSSOM">CSSOM</a>]</cite> |
| 105 |
is trying to define an algorithm to |
| 106 |
<a href="http://dev.w3.org/cvsweb/~checkout~/csswg/cssom/Overview.html?rev=1.55&content-type=text/html;%20charset=utf-8#serializing0">serialize |
| 107 |
a group of selectors</a> for the purpose of <code>selectorText</code> |
| 108 |
attribute. However, the algorithm is incomplete |
| 109 |
<time datetime=2007-09-25>at the time of the writing</time>. |
| 110 |
Note that current Web browser implementations |
| 111 |
of the <code>selectorText</code> attribute are consistently broken |
| 112 |
in not escaping unsafe identifiers.</p> |
| 113 |
|
| 114 |
</div> |
| 115 |
|
| 116 |
<div class="section" id="terminology"> |
| 117 |
<h2>Terminology</h2> |
| 118 |
|
| 119 |
<p>The key words <q><em class="rfc2119">MUST</em></q>, |
| 120 |
<q><em class="rfc2119">MUST NOT</em></q>, |
| 121 |
<q><em class="rfc2119">SHOULD</em></q>, |
| 122 |
<q><em class="rfc2119">SHOULD NOT</em></q>, and |
| 123 |
<q><em class=rfc2119>MAY</em></q> in this |
| 124 |
document are to be interpreted as described in |
| 125 |
<a href="urn:ietf:rfc:2119"><abbr title="Request for Comments">RFC</abbr> |
| 126 |
2119</a> |
| 127 |
<cite class="bibref normative">[<a href="#ref-KEYWORDS">KEYWORDS</a>]</cite>.</p> |
| 128 |
|
| 129 |
<!-- Strictly speaking the paragraph below is not part of terminology. --> |
| 130 |
<p>All examples and notes in this specification are non$B!>(Bnormative, |
| 131 |
as are all sections explicitly marked non$B!>(Bnormative. Everything |
| 132 |
else in this specification is normative.</p> |
| 133 |
|
| 134 |
<p>For the purpose of this specification, pseudo$B!>(Belements are also |
| 135 |
referred to as <dfn title="simple selector" id=simple-selector>simple |
| 136 |
selectors</dfn> and are considered as part of the last sequence of |
| 137 |
simple selector in a selector.</p> |
| 138 |
</div> |
| 139 |
|
| 140 |
<div class="section" id="serializing"> |
| 141 |
<h2>Serializing Groups of Selectors</h2> |
| 142 |
|
| 143 |
<div class="issue ed"> |
| 144 |
<p><a href="http://suika.fam.cx/gate/cvs/*checkout*/markup/html/whatpm/Whatpm/CSS/SelectorsSerializer.pm">See the reference implementation</a> |
| 145 |
for now.</p> |
| 146 |
</div> |
| 147 |
|
| 148 |
<p>No <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
| 149 |
representation is defined for an invalid group of selectors.</p> |
| 150 |
|
| 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 --> |
| 156 |
|
| 157 |
<p>To |
| 158 |
<dfn id=algorithm-serialize-a-group-of-selectors title="serialize a group of selectors">serialize |
| 159 |
a group of selectors (<dfn id=var-gs><var>gs</var></dfn>)</dfn>:</p> |
| 160 |
<ol> |
| 161 |
<li>Let <dfn id=var-result><var>result</var></dfn> an empty string.</li> |
| 162 |
<li>For each selector (<dfn id=var-selector><var>selector</var></dfn>) in |
| 163 |
<var>gs</var>: |
| 164 |
<ol> |
| 165 |
<li>If <var>selector</var> is <em>not</em> the first selector |
| 166 |
in the group of selectors, then append a <code class=char>U+002C</code> |
| 167 |
<code class=charname>COMMA</code> (<code class=char>,</code>) followed by a |
| 168 |
<a href="#newline">newline</a> to <var>result</var>.</li> |
| 169 |
<li>Append four <code class=char>U+0020</code> |
| 170 |
<code class=charname>SPACE</code> characters to <var>result</var>.</li> |
| 171 |
<li>Process each sequence of simple selectors or |
| 172 |
combinator in <var>selector</var> by following algorithm: |
| 173 |
<dl class=switch> |
| 174 |
<dt>If it is a sequence of simle selector |
| 175 |
(<dfn id=var-sss><var>sss</var></dfn>)</dt> |
| 176 |
<dd class=ed>@@</dd> |
| 177 |
<dt>If it is a combinator (<dfn id=var-c><var>c</var></dfn>)</dt> |
| 178 |
<dd> |
| 179 |
<ol> |
| 180 |
<li>Append two <code class=char>U+0020</code> |
| 181 |
<code class=charname>SPACE</code> characters to <var>result</var>.</li> |
| 182 |
<li> |
| 183 |
<dl class=switch> |
| 184 |
<dt>If <var>c</var> is descendant combinator (white space)</dt> |
| 185 |
<dd>Append a <code class=char>U+0020</code> |
| 186 |
<code class=charname>SPACE</code> character to |
| 187 |
<var>result</var>.</dd> |
| 188 |
<dt>If <var>c</var> is child combinator |
| 189 |
(<code class=char>></code>)</dt> |
| 190 |
<dd>Append a <code class=char>U+003E</code> |
| 191 |
<code class=charname>GREATER-THAN SIGN</code> |
| 192 |
(<code class=char>></code>) character to <var>result</var>.</dd> |
| 193 |
<dt>If <var>c</var> is adjacent sibling combinator |
| 194 |
(<code class=char>+</code>)</dt> |
| 195 |
<dd>Append a <code class=char>U+002B</code> |
| 196 |
<code class=charname>PLUS SIGN</code> (<code class=char>+</code>) |
| 197 |
character to <var>result</var>.</dd> |
| 198 |
<dt>If <var>c</var> is general sibling combinator |
| 199 |
(<code class=char>~</code>)</dt> |
| 200 |
<dd>Append a <code class=char>U+007E</code> |
| 201 |
<code class=charname>TILDE</code> (<code class=char>~</code>) |
| 202 |
character to <var>result</var>.</dd> |
| 203 |
</dl> |
| 204 |
</li> |
| 205 |
<li>Append a <code class=char>U+0020</code> |
| 206 |
<code class=charname>SPACE</code> character to |
| 207 |
<var>result</var>.</li> |
| 208 |
</ol> |
| 209 |
</dd> |
| 210 |
</dl> |
| 211 |
</ol> |
| 212 |
</li> |
| 213 |
<li>Then, <var>result</var> is the |
| 214 |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
| 215 |
representation of <var>gs</var>.</li> |
| 216 |
</ol> |
| 217 |
|
| 218 |
<p>To |
| 219 |
<dfn id=algorithm-serialize-a-simple-selector title="serialize a simple selector">serialize |
| 220 |
a simple selector (<dfn><var id=var-ss>ss</var></dfn>)</dfn>:</p> |
| 221 |
<dl class=switch> |
| 222 |
<dt>If <var>ss</var> is a type or universal selector</dt> |
| 223 |
<dd> |
| 224 |
<ol> |
| 225 |
<li> |
| 226 |
<dl class=switch> |
| 227 |
<dt>If a namespace URI is specified (via namespace prefix, or |
| 228 |
by omitting namespace prefix where a default namespace is specified)</dt> |
| 229 |
<dd class="ed">@@</dd> |
| 230 |
<dt>If the null namespace is specified (by zero$B!>(Blength namespace |
| 231 |
prefix)</dt> |
| 232 |
<dd>Append a <code class=char>U+007C</code> |
| 233 |
<code class=charname>VERTICAL BAR</code> (<code class=char>|</code>) |
| 234 |
character to <var>result</var>.</dd> |
| 235 |
<dt>If no namespace is specified (by namespace prefix <code>*</code>, |
| 236 |
or by omitting namespace prefix where no default namespace is |
| 237 |
specified)</dt> |
| 238 |
<dd>Append a <code class=char>U+002A</code> |
| 239 |
<code class=charname>ASTERISK</code> (<code class=char>*</code>) |
| 240 |
character, followed by a <code class=char>U+007C</code> |
| 241 |
<code class=charname>VERTICAL BAR</code> (<code class=char>|</code>) |
| 242 |
character, to <var>result</var>.</dd> |
| 243 |
</dl> |
| 244 |
</li> |
| 245 |
<li>If <var>ss</var> is a type selector, append the |
| 246 |
<span class=ed>@@ normalized</span> local name to <var>result</var>.</li> |
| 247 |
<li>If <var>ss</var> is a universal selector, append |
| 248 |
a <code class=char>U+002A</code> <code class=charname>ASTERISK</code> |
| 249 |
(<code class=char>*</code>) character to <var>result</var>.</li> |
| 250 |
</ol> |
| 251 |
</dd> |
| 252 |
<dt>If <var>ss</var> is an attribute selector</dt> |
| 253 |
<dd class=ed>@@</dd> |
| 254 |
<dt>If <var>ss</var> is a class selector</dt> |
| 255 |
<dd>Append a <code class=char>U+002E</code> <code class=charname>FULL |
| 256 |
STOP</code> (<code class=char>.</code>) character, followed |
| 257 |
by <span class=ed>@@ normalized</span> class name, |
| 258 |
<var>result</var>.</dd> |
| 259 |
<dt>If <var>ss</var> is an <abbr>ID</abbr> selector</dt> |
| 260 |
<dd>Append a <code class=char>U+0023</code> <code class=charname>NUMBER |
| 261 |
SIGN</code> (<code class=char>#</code>) character, followed |
| 262 |
by <span class=ed>@@ normalized</span> <abbr>ID</abbr>, |
| 263 |
to <var>result</var>.</dd> |
| 264 |
<dt>If <var>ss</var> is a pseudo$B!>(Bclass selector</dt> |
| 265 |
<dd> |
| 266 |
<ol> |
| 267 |
<li>Append a <code class=char>U+003A</code> |
| 268 |
<code class=charname>COLON</code> (<code class=char>:</code>) character |
| 269 |
to <var>result</var>.</li> |
| 270 |
<li>Append the <span class=ed>@@ normalized</span> name of the |
| 271 |
pseudo$B!>(Bclass to <var>result</var>.</li> |
| 272 |
<li>Append any arguments as following: |
| 273 |
<dl class=switch> |
| 274 |
<dt>If the name of the pseudo$B!>(Bclass is <code>lang</code></dt> |
| 275 |
<dd> |
| 276 |
<ol> |
| 277 |
<li>Append a <code class=char>U+0028</code> <code class=charname>LEFT |
| 278 |
PARENTHESIS</code> (<code class=char>(</code>) character |
| 279 |
to <var>result</var>.</li> |
| 280 |
<li>Append <span class=ed>@@ normalized</span> |
| 281 |
language tag (the argument) to <var>result</var>.</li> |
| 282 |
<li>Append a <code class=char>U+0029</code> |
| 283 |
<code class=charname>RIGHT PARENTHESIS</code> |
| 284 |
(<code class=char>)</code>) character |
| 285 |
to <var>result</var>.</li> |
| 286 |
</ol> |
| 287 |
</dd> |
| 288 |
<dt>If the name of the pseudo$B!>(Bclass is |
| 289 |
<code>-manakai-contains</code></dt> |
| 290 |
<dd> |
| 291 |
<ol> |
| 292 |
<li>Append a <code class=char>U+0028</code> <code class=charname>LEFT |
| 293 |
PARENTHESIS</code> (<code class=char>(</code>) character |
| 294 |
to <var>result</var>.</li> |
| 295 |
<li>Append <span class=ed>@@ normalized</span> |
| 296 |
string (the argument) to <var>result</var>.</li> |
| 297 |
<li>Append a <code class=char>U+0029</code> |
| 298 |
<code class=charname>RIGHT PARENTHESIS</code> |
| 299 |
(<code class=char>)</code>) character |
| 300 |
to <var>result</var>.</li> |
| 301 |
</ol> |
| 302 |
</dd> |
| 303 |
<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 |
| 305 |
<code>nth-last-of-type</code></dt> |
| 306 |
<dd> |
| 307 |
<ol> |
| 308 |
<li>Append a <code class=char>U+0028</code> <code class=charname>LEFT |
| 309 |
PARENTHESIS</code> (<code class=char>(</code>) character |
| 310 |
to <var>result</var>.</li> |
| 311 |
<li>Append <span class=ed>@@ normalized</span> |
| 312 |
integer <var>a</var> to <var>result</var>. |
| 313 |
If the argument is a keyword <code>odd</code> or <code>even</code>, |
| 314 |
<var>a</var> is <code>2</code>. If <var>a</var> and |
| 315 |
<code>n</code> is omitted, <var>a</var> is assumed as |
| 316 |
<code>0</code>. Otherwise, if <var>a</var> is omitted, |
| 317 |
it is assumed as <code>1</code> (or <code>-1</code>, |
| 318 |
if there is a <code class=char>U+002D</code> |
| 319 |
<code class=charname>HYPHEN-MINUS</code> (<code class=char>-</code>) |
| 320 |
character).</li> |
| 321 |
<li>Append a <code class=char>U+006E</code> |
| 322 |
<code class=charname>LATIN SMALL LETTER N</code> |
| 323 |
(<code class=char>n</code>) character to <var>result</var>.</li> |
| 324 |
<li>Append <span class=ed>@@ normalized</span> |
| 325 |
integer <var>b</var> to <var>result</var>. |
| 326 |
It <em class=rfc2119>MUST</em> be preceded by a sign, |
| 327 |
either <code class=char>U+002B</code> <code class=charname>PLUS |
| 328 |
SIGN</code> (<code class=char>+</code>) or |
| 329 |
<code class=char>U+002D</code> |
| 330 |
<code class=charname>HYPHEN-MINUS</code> (<code class=char>-</code>) |
| 331 |
character. If the argument is a keyword <code>odd</code>, |
| 332 |
<var>b</var> is <code>1</code>. If the argument |
| 333 |
is a keyword <code>even</code>, <var>b</var> is |
| 334 |
<code>0</code>. If <var>b</var> is omitted, it is assumed as |
| 335 |
<code>0</code>. The sign of <code>0</code> |
| 336 |
<em class=rfc2119>MUST</em> be <code class=char>U+002B</code> |
| 337 |
<code class=charname>PLUS SIGN</code> |
| 338 |
(<code class=char>+</code>).</li> |
| 339 |
<li>Append a <code class=char>U+0029</code> |
| 340 |
<code class=charname>RIGHT PARENTHESIS</code> |
| 341 |
(<code class=char>)</code>) character |
| 342 |
to <var>result</var>.</li> |
| 343 |
</ol> |
| 344 |
</dd> |
| 345 |
<dt>If the name of the pseudo$B!>(Bclass is <code>not</code></dt> |
| 346 |
<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> |
| 378 |
</li> |
| 379 |
</ol> |
| 380 |
</dd> |
| 381 |
<dt>If <var>ss</var> is a pseudo$B!>(Belement</dt> |
| 382 |
<dd> |
| 383 |
<ol> |
| 384 |
<li>Append two <code class=char>U+003A</code> |
| 385 |
<code class=charname>COLON</code> characters (<code>::</code>) |
| 386 |
to <var>result</var>.</li> |
| 387 |
<li>Append the <span class=ed>@@ normalized</span> name of the |
| 388 |
pseudo$B!>(Belement to <var>result</var>.</li> |
| 389 |
<!-- For future version: append "(", arguments, ")", if any. --> |
| 390 |
</ol> |
| 391 |
</dd> |
| 392 |
</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> |
| 414 |
|
| 415 |
<div class="section" id="parsing"> |
| 416 |
<h2>Parsing |
| 417 |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
| 418 |
Groups of Selectors</h2> |
| 419 |
|
| 420 |
<p>Since <a href="#serializing">the serializing algorithm</a> is |
| 421 |
so designed that it always output a valid |
| 422 |
<a href="http://www.w3.org/TR/css3-selectors/#grouping">group of |
| 423 |
selectors</a>, no special parser for the |
| 424 |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
| 425 |
representation is necessary. Any conforming parser for |
| 426 |
<a href="http://www.w3.org/TR/css3-selectors/#grouping">groups of |
| 427 |
selectors</a> <em class=rfc2119>MAY</em> be used |
| 428 |
to parse <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
| 429 |
representations of groups of selectors.</p> |
| 430 |
</div> |
| 431 |
|
| 432 |
<div class="section" id="examples"> |
| 433 |
<h2>Examples</h2> |
| 434 |
|
| 435 |
<p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p> |
| 436 |
|
| 437 |
<div class="ed issue"> |
| 438 |
<p><a href="http://suika.fam.cx/gate/2007/css/parser-interface">Try demo</a>, |
| 439 |
by choosing <q>Selectors</q> radio button.</p> |
| 440 |
|
| 441 |
<div class="example figure block"> |
| 442 |
<div class="caption">...</div> |
| 443 |
|
| 444 |
<pre><code>...</code></pre> |
| 445 |
</div> |
| 446 |
|
| 447 |
</div> |
| 448 |
|
| 449 |
</div> |
| 450 |
|
| 451 |
<div id="references" class="section reference"> |
| 452 |
<h2>References</h2> |
| 453 |
|
| 454 |
<div id="normative-references" class="section normative reference"> |
| 455 |
<h3>Normative References</h3> |
| 456 |
|
| 457 |
<dl> |
| 458 |
<dt id="ref-KEYWORDS">KEYWORDS</dt> |
| 459 |
<dd><cite><a href="urn:ietf:rfc:2119">Key words for use in |
| 460 |
<abbr>RFCs</abbr> to Indicate Requirement Levels</a></cite>, |
| 461 |
<abbr title="Internet Engineering Task Force">IETF</abbr> |
| 462 |
<a href="urn:ietf:bcp:14"><abbr title="Best Current Practice">BCP</abbr> |
| 463 |
14</a>, <abbr title="Request for Comments">RFC</abbr> 2119, |
| 464 |
<time datetime=1997-03>March 1997</time>. |
| 465 |
This version of the specification is referenced</dd> |
| 466 |
<dt id=ref-SELECTORS>SELECTORS</dt> |
| 467 |
<dd><a href="http://www.w3.org/TR/2005/WD-css3-selectors-20051215"><cite>Selectors</cite></a>, |
| 468 |
<abbr title="World Wide Web Consortium">W3C</abbr> Working Draft, |
| 469 |
<time datetime=2005-12-15>15 December 2005</time>. Work in progress. |
| 470 |
<a href="http://www.w3.org/TR/css3-selectors">The latest version</a> |
| 471 |
of the specification is referenced.</dd> |
| 472 |
</dl> |
| 473 |
</div> |
| 474 |
|
| 475 |
<div id="informative-references" class="section informative reference"> |
| 476 |
<h3>Non$B!>(Bnormative References</h3> |
| 477 |
|
| 478 |
<dl> |
| 479 |
<dt id=ref-CSS>CSS</dt> |
| 480 |
<dd><cite><a href="http://www.w3.org/TR/2007/CR-CSS21-20070719">Cascading |
| 481 |
Style Sheets Level 2 Revision 1 (<abbr>CSS</abbr> 2.1) |
| 482 |
Specification</a></cite>, |
| 483 |
<abbr title="World Wide Web Consortium">W3C</abbr> Candidate |
| 484 |
Recommendation, <time datetime=2007-07-19>19 July 2007</time>. |
| 485 |
Work in progress. The latest version of the specification is |
| 486 |
available at |
| 487 |
<code class=URI><<a href="http://www.w3.org/TR/CSS21">http://www.w3.org/TR/CSS21</a>></code>.</dd> |
| 488 |
<dt id=ref-CSSOM>CSSOM</dt> |
| 489 |
<dd><cite><a href="http://dev.w3.org/cvsweb/~checkout~/csswg/cssom/Overview.html?rev=1.55&content-type=text/html;%20charset=utf-8">Cascading |
| 490 |
Style Sheets Object Model (<abbr>CSSOM</abbr>)</a></cite>, |
| 491 |
<abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft, |
| 492 |
<time datetime=2007-06-18>18 June 2007</time>. Work in progress. |
| 493 |
The latest Editor's Draft of the specification is available at |
| 494 |
<code class=URI><<a href="http://dev.w3.org/csswg/cssom/Overview.html">http://dev.w3.org/csswg/cssom/Overview.html</a>></code>.</dd> |
| 495 |
<dt id=ref-HTML5>HTML5</dt> |
| 496 |
<dd><cite><a href="http://whatwg.org/html5"><abbr>HTML</abbr> 5</a></cite>, |
| 497 |
<abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr> |
| 498 |
Working Draft. Work in progress.</dd> |
| 499 |
<dt id=ref-SAPI>SAPI</dt> |
| 500 |
<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>, |
| 501 |
<abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft, |
| 502 |
<time datetime=2007-08-29>29 August 2007</time>. Work in progress. |
| 503 |
The latest Editor's Draft of the specification is available at |
| 504 |
<code class=URI><<a href="http://dev.w3.org/2006/webapi/selectors-api/Overview.html">http://dev.w3.org/2006/webapi/selectors-api/Overview.html</a>></code>. |
| 505 |
The latest published version of the specification is available at |
| 506 |
<code class=URI><<a href="http://www.w3.org/TR/selectors-api/">http://www.w3.org/TR/selectors-api/</a>></code>.</dd> |
| 507 |
<dt id=XBL2>XBL2</dt> |
| 508 |
<dd><cite><a href="http://www.mozilla.org/projects/xbl/xbl2.html"><abbr>XBL</abbr> |
| 509 |
2.0</a></cite>, Mozilla.org, <time datetime=2007-03-15>15 Mar 2007</time>. |
| 510 |
Work in progress. The latest |
| 511 |
<abbr title="World Wide Web Consortium">W3C</abbr>$B!>(Bpublished |
| 512 |
version of the specification is available at |
| 513 |
<code class=URI><<a href="http://www.w3.org/TR/xbl/">http://www.w3.org/TR/xbl/</a>></code>.</dd> |
| 514 |
</dl> |
| 515 |
</div> |
| 516 |
|
| 517 |
</div> |
| 518 |
|
| 519 |
</body> |
| 520 |
</html> |