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 22 September 2007</h2> |
<h2>Working Draft 25 September 2007</h2> |
14 |
|
|
15 |
<dl class="versions-uri"> |
<dl class="versions-uri"> |
16 |
<dt>This Version</dt> |
<dt>This Version</dt> |
77 |
<div id="introduction" class="section"> |
<div id="introduction" class="section"> |
78 |
<h2>Introduction</h2> |
<h2>Introduction</h2> |
79 |
|
|
80 |
|
<p>This section is <em>informative</em>.</p> |
81 |
|
|
82 |
<div class="issue ed">...</div> |
<div class="issue ed">...</div> |
83 |
|
|
84 |
|
<p><a href="http://dev.w3.org/cvsweb/csswg/cssom/Overview.html">The |
85 |
|
<abbr title="Cascading Style Sheets Object Model">CSSOM</abbr> |
86 |
|
specification</a> |
87 |
|
<cite class="bibref informative">[<a href="#bib-CSSOM">CSSOM</a>]</cite> |
88 |
|
is trying to define an algorithm to |
89 |
|
<a href="http://dev.w3.org/cvsweb/~checkout~/csswg/cssom/Overview.html?rev=1.55&content-type=text/html;%20charset=utf-8#serializing0">serialize |
90 |
|
a group of selectors</a> for the purpose of <code>selectorText</code> |
91 |
|
attribute. However, the algorithm is incomplete |
92 |
|
at the time of the writing. Note that current Web browser implementations |
93 |
|
of the <code>selectorText</code> attribute are consistently broken |
94 |
|
in not escaping unsafe identifiers.</p> |
95 |
|
|
96 |
</div> |
</div> |
97 |
|
|
98 |
<div class="section" id="terminology"> |
<div class="section" id="terminology"> |
116 |
for now.</p> |
for now.</p> |
117 |
</div> |
</div> |
118 |
|
|
119 |
|
<p><dfn id=newline>Newline</dfn> is <code class=char>U+000A</code> |
120 |
|
<code class=charname>LINE FEED</code> <span class=ed>or |
121 |
|
U+000D U+000A or U+000A ??</span>.</p> |
122 |
|
|
123 |
|
<!-- TODO: link terms to Selectors --> |
124 |
|
|
125 |
|
<ol> |
126 |
|
<li>Let <var>result</var> an empty string.</li> |
127 |
|
<li>For each selector (<var>selector</var>) in the group of selectors: |
128 |
|
<ol> |
129 |
|
<li>If <var>selector</var> is <em>not</em> the first selector |
130 |
|
in the group of selectors, then append a <code class=char>U+002C</code> |
131 |
|
<code class=charname>COMMA</code> followed by a |
132 |
|
<a href="#newline">newline</a> to <var>result</var>.</li> |
133 |
|
<li>Append four <code class=char>U+0020</code> |
134 |
|
<code class=charname>SPACE</code> characters to <var>result</var>.</li> |
135 |
|
<li>Process each sequence of simple selectors or |
136 |
|
combinator in <var>selector</var> by following algorithm: |
137 |
|
<dl class=switch> |
138 |
|
<dt>If it is a sequence of simle selector (<var>sss</var>)</dt> |
139 |
|
<dd class=ed>@@</dd> |
140 |
|
<dt>If it is a combinator (<var>c</var>)</dt> |
141 |
|
<dd> |
142 |
|
<ol> |
143 |
|
<li>Append two <code class=char>U+0020</code> |
144 |
|
<code class=charname>SPACE</code> characters to <var>result</var>.</li> |
145 |
|
<li> |
146 |
|
<dl class=switch> |
147 |
|
<dt>If <var>c</var> is descendant combinator (white space)</dt> |
148 |
|
<dd>Append a <code class=char>U+0020</code> |
149 |
|
<code class=charname>SPACE</code> character to |
150 |
|
<var>result</var>.</dd> |
151 |
|
<dt>If <var>c</var> is child combinator |
152 |
|
(<code class=char>></code>)</dt> |
153 |
|
<dd>Append a <code class=char>U+003E</code> |
154 |
|
<code class=charname>GREATER-THAN SIGN</code> character to |
155 |
|
<var>result</var>.</dd> |
156 |
|
<dt>If <var>c</var> is adjacent sibling combinator |
157 |
|
(<code class=char>+</code>)</dt> |
158 |
|
<dd>Append a <code class=char>U+0020</code> |
159 |
|
<code class=charname>SPACE</code> character to |
160 |
|
<var>result</var>.</dd> |
161 |
|
<dt>If <var>c</var> is general sibling combinator |
162 |
|
(<code class=char>~</code>)</dt> |
163 |
|
<dd>Append a <code class=char>U+007E</code> |
164 |
|
<code class=charname>TILDE</code> character to |
165 |
|
<var>result</var>.</dd> |
166 |
|
</dl> |
167 |
|
</li> |
168 |
|
<li>Append a <code class=char>U+0020</code> |
169 |
|
<code class=charname>SPACE</code> character to |
170 |
|
<var>result</var>.</li> |
171 |
|
</ol> |
172 |
|
</dd> |
173 |
|
</dl> |
174 |
|
</ol> |
175 |
|
</li> |
176 |
|
<li>Then, <var>result</var> is the |
177 |
|
<abbr title="Selectors Serialization Format for Testing">SFFT</abbr> |
178 |
|
representation of the group of selectors.</li> |
179 |
|
</ol> |
180 |
|
|
181 |
</div> |
</div> |
182 |
|
|
183 |
<div class="section" id="parsing"> |
<div class="section" id="parsing"> |
188 |
<p>Since <a href="#serializing">the serializing algorithm</a> is |
<p>Since <a href="#serializing">the serializing algorithm</a> is |
189 |
so designed that it always output a valid |
so designed that it always output a valid |
190 |
<a href="http://www.w3.org/TR/css3-selectors/#grouping">group of |
<a href="http://www.w3.org/TR/css3-selectors/#grouping">group of |
191 |
selectors</a>, no special parser for the <abbr>SFFT</abbr> |
selectors</a>, no special parser for |
192 |
|
<abbr title="Selectors Serialization Format for Testing">SFFT</abbr> |
193 |
is necessary. Any conforming |
is necessary. Any conforming |
194 |
<a href="http://www.w3.org/TR/css3-selectors/#grouping">group of |
<a href="http://www.w3.org/TR/css3-selectors/#grouping">group of |
195 |
selectors</a> parser <em class=rfc2119>MAY</em> be used |
selectors</a> parser <em class=rfc2119>MAY</em> be used |
224 |
|
|
225 |
<dl> |
<dl> |
226 |
<dt id="ref-KEYWORDS">KEYWORDS</dt> |
<dt id="ref-KEYWORDS">KEYWORDS</dt> |
227 |
<dd class="ed">RFC 2119. The exact version of the specification |
<dd><cite><a href="urn:ietf:rfc:2119">Key words for use in |
228 |
is referenced.</dd> |
<abbr>RFCs</abbr> to Indicate Requirement Levels</a></cite>, |
229 |
|
<abbr title="Internet Engineering Task Force">IETF</abbr> |
230 |
|
<a href="urn:ietf:bcp:14"><abbr title="Best Current Practice">BCP</abbr> |
231 |
|
14</a>, <abbr title="Request for Comments">RFC</abbr> 2119, March 1997. |
232 |
|
This version of the specification is referenced</dd> |
233 |
<dt id=ref-SELECTORS>SELECTORS</dt> |
<dt id=ref-SELECTORS>SELECTORS</dt> |
234 |
<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>, |
235 |
<abbr title="World Wide Web Consortium">W3C</abbr> Working Draft, |
<abbr title="World Wide Web Consortium">W3C</abbr> Working Draft, |
243 |
<h3>Informative References</h3> |
<h3>Informative References</h3> |
244 |
|
|
245 |
<dl> |
<dl> |
246 |
<dt id=ref-CSSOM</dt>CSSOM</dt> |
<dt id=ref-CSSOM>CSSOM</dt> |
247 |
<dd class=ed>CSSOM specification, W3C ED, work in progress.</dd> |
<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 |
248 |
|
Style Sheets Object Model (<abbr>CSSOM</abbr>)</a></cite>, |
249 |
|
<abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft, |
250 |
|
18 June 2007. Work in progress. The latest Editor's Draft |
251 |
|
of the specification is available at |
252 |
|
<code class=uri><<a href="http://dev.w3.org/csswg/cssom/Overview.html">http://dev.w3.org/csswg/cssom/Overview.html</a>></code>.</dd> |
253 |
</dl> |
</dl> |
254 |
</div> |
</div> |
255 |
|
|