140 |
</div> |
</div> |
141 |
|
|
142 |
<div class="section" id="serializing"> |
<div class="section" id="serializing"> |
143 |
<h2>Serializing Groups of Selectors</h2> |
<h2>Serializing Selectors as |
144 |
|
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
145 |
|
Representation</h2> |
146 |
|
|
147 |
<div class="issue ed"> |
<div class="issue ed"> |
148 |
<p><a href="http://suika.fam.cx/gate/cvs/*checkout*/markup/html/whatpm/Whatpm/CSS/SelectorsSerializer.pm">See the reference implementation</a> |
<p><a href="http://suika.fam.cx/gate/cvs/*checkout*/markup/html/whatpm/Whatpm/CSS/SelectorsSerializer.pm">See the reference implementation</a> |
149 |
for now.</p> |
for now.</p> |
150 |
</div> |
</div> |
151 |
|
|
152 |
|
<div class=section id=serializing-groups-of-selectors> |
153 |
|
<h3>Serializing Groups of Selectors</h3> |
154 |
|
|
155 |
<p>No <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
<p>No <abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
156 |
representation is defined for an invalid group of selectors.</p> |
representation is defined for an invalid group of selectors.</p> |
157 |
|
|
229 |
representation of <var>gs</var>.</li> |
representation of <var>gs</var>.</li> |
230 |
</ol> |
</ol> |
231 |
|
|
232 |
|
</div> |
233 |
|
|
234 |
|
<div class=section id=serializing-simple-selectors> |
235 |
|
<h3>Serializing Simple Selectors</h3> |
236 |
|
|
237 |
<p>To |
<p>To |
238 |
<dfn id=algorithm-serialize-a-simple-selector title="serialize a simple selector">serialize |
<dfn id=algorithm-serialize-a-simple-selector title="serialize a simple selector">serialize |
239 |
a simple selector (<dfn><var id=var-ss>ss</var></dfn>)</dfn>:</p> |
a simple selector (<dfn><var id=var-ss>ss</var></dfn>)</dfn>:</p> |
456 |
</dd> |
</dd> |
457 |
</dl> |
</dl> |
458 |
|
|
459 |
|
</div> |
460 |
|
|
461 |
|
<div class=section id=serializing-tokens> |
462 |
|
<h3>Serializing Tokens</h3> |
463 |
|
|
464 |
<p>To <dfn id=algorithm-normalize-an-ident title="normalize an IDENT">normalize |
<p>To <dfn id=algorithm-normalize-an-ident title="normalize an IDENT">normalize |
465 |
an <code>IDENT</code> (<dfn id=var-n><var>n</var></dfn>)</dfn>:</p> |
an <code>IDENT</code> (<dfn id=var-n><var>n</var></dfn>)</dfn>:</p> |
466 |
<ol> |
<ol> |
519 |
<p>To <dfn id=algorithm-normalize-a-string title="normalize a STRING">normalize |
<p>To <dfn id=algorithm-normalize-a-string title="normalize a STRING">normalize |
520 |
a <code>STRING</code> (<dfn id=var-s><var>s</var></dfn>)</dfn>:</p> |
a <code>STRING</code> (<dfn id=var-s><var>s</var></dfn>)</dfn>:</p> |
521 |
<ol> |
<ol> |
522 |
<li>Replace the escape sequences (<code>\</code> and following |
<li><p>Replace the escape sequences (<code>\</code> and following |
523 |
characters) in <var>s</var> by characters represented by them |
characters) in <var>s</var> by characters represented by them |
524 |
(or an empty string if <code>\</code> is immediately followed by |
(or an empty string if <code>\</code> is immediately followed by |
525 |
newline character(s)) respectively.</li> |
newline character(s)) respectively.</p></li> |
526 |
<li>Remove the quotation characters in <var>s</var> |
<li><p>Remove the quotation characters in <var>s</var> |
527 |
if <var>s</var> is a <code>STRING</code>.</li> |
if <var>s</var> is a <code>STRING</code>.</p> |
528 |
<li>If there is any character that is <em>not</em> one of |
|
529 |
|
<div class="note memo"> |
530 |
|
<p>The input <var>s</var> to this algorithm may be an |
531 |
|
<code>IDENT</code>.</p> |
532 |
|
</div></li> |
533 |
|
<li><p>If there is any character that is <em>not</em> one of |
534 |
<code class=char>U+0020</code> <code class=charname>SPACE</code>, |
<code class=char>U+0020</code> <code class=charname>SPACE</code>, |
535 |
<code class=char>U+0021</code> <code class=charname>EXCLAMATION MARK</code> |
<code class=char>U+0021</code> <code class=charname>EXCLAMATION MARK</code> |
536 |
(<code class=char>!</code>), <code class=char>U+0023</code> |
(<code class=char>!</code>), <code class=char>U+0023</code> |
544 |
hexadecimal representation of the character. If the character |
hexadecimal representation of the character. If the character |
545 |
is outside the range of <code>[<code class=char>U+0000</code>, |
is outside the range of <code>[<code class=char>U+0000</code>, |
546 |
<code class=char>U+10FFFF</code>]</code>, <var>HHHHHH</var> |
<code class=char>U+10FFFF</code>]</code>, <var>HHHHHH</var> |
547 |
<em class=rfc2119>MUST</em> be <code>FFFFFF</code>.</li> |
<em class=rfc2119>MUST</em> be <code>FFFFFF</code>.</p></li> |
548 |
<li>Insert a <code class=char>U+0022</code> <code class=charname>QUOTATION |
<li><p>Insert a <code class=char>U+0022</code> <code class=charname>QUOTATION |
549 |
MARK</code> (<code class=char>"</code>) at the beginning of <var>s</var>.</li> |
MARK</code> (<code class=char>"</code>) at the beginning of |
550 |
<li>Insert a <code class=char>U+0022</code> <code class=charname>QUOTATION |
<var>s</var>.</p></li> |
551 |
MARK</code> (<code class=char>"</code>) at the end of <var>s</var>.</li> |
<li><p>Insert a <code class=char>U+0022</code> <code class=charname>QUOTATION |
552 |
<li>Then, <var>s</var> is the result of the algorithm.</li> |
MARK</code> (<code class=char>"</code>) at the end of <var>s</var>.</p></li> |
553 |
|
<li><p>Then, <var>s</var> is the result of the algorithm.</p></li> |
554 |
</ol> |
</ol> |
555 |
|
|
556 |
<p>A <dfn id=newline title=newline>newline</dfn> |
<p>A <dfn id=newline title=newline>newline</dfn> |
577 |
</div> |
</div> |
578 |
|
|
579 |
</div> |
</div> |
580 |
|
|
581 |
|
</div> |
582 |
|
|
583 |
<div class="section" id="parsing"> |
<div class="section" id="parsing"> |
584 |
<h2>Parsing |
<h2>Parsing |