140 |
</div> |
</div> |
141 |
|
|
142 |
<div class="section" id="serializing"> |
<div class="section" id="serializing"> |
143 |
<h2>Serializing in |
<h2>Serializing Selectors as |
144 |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
<abbr title="Selectors Serialization Format for Testing">SSFT</abbr> |
145 |
Representation</h2> |
Representation</h2> |
146 |
|
|
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> |