HTML Standard Tracker


File a bug

SVNBugCommentTime (UTC)
600more work on the sniffing algorithm2007-02-16 22:45
@@ -26729,24 +26729,53 @@ function receiver(e) {
         after the second 0x2D byte that was found. (The two 0x2D bytes
         cannot be the same as the those in the '<!--' sequence.) If
         no such byte is found before the <var title="">n</var>th byte,
         abort this "two step" algorithm.</p>
        <dt>A sequence of bytes starting with: 0x3C, 0x4D or 0x6D, 0xe5 or 0x65, 0x54 or 0x74, 0x41 or 0x61, and finally one of 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x20 (case-insensitive ASCII '&lt;meta' followed by a space)</dt>
-        <p class="big-issue">try to find charset attribute or content
-        attribute with charset parameter, <span
-        title="concept-skip-attributes-when-sniffing">skip other
-        attributes</span></p>
+        <ol>
+         <li><p>Advance the <var title="">position</var> pointer so
+         that it points at the next 0x09, 0x0A, 0x0B, 0x0C, 0x0D, or
+         0x20 byte (the one in sequence of characters matched
+         above).</p></li>
+         <li><p><span title="concept-get-attributes-when-sniffing">Get
+         an attribute</span> and its value. If no attribute was
+         sniffed, then skip this inner set of steps, and jump to the
+         second step in the overall "two step" algorithm.</p></li>
+         <li><p>Examine the attribute's name:</p>
+          <dl class="switch">
+           <dt>If it is 'charset'</dt>
+           <dd><p class="big-issue">use this as the character
+           encoding</p></dd>
+           <dt>If it is 'content'</dt>
+           <dd><p class="big-issue">skip up to after the first ';',
+           then <span title="concept-get-attributes-when-sniffing">get
+           an attribute; if it is 'charset' then use its value as the
+           charset.</span></p></dd>
+          </dl>
+         </li>
+         <li><p>Return to step 1 in these inner steps.</p></li>
        <dt>A sequence of bytes starting with a 0x3C byte (ASCII '&lt;'), optionally a 0x2F byte (ASCII '/'), and finally a byte in the range 0x41-0x5A or 0x61-0x7A (an ASCII letter)</dt>
         <p class="big-issue">skip start or end tag, and <span
         title="concept-skip-attributes-when-sniffing">skip any
@@ -26768,21 +26797,21 @@ function receiver(e) {
      <li>Move <var title="">position</var> so it points at the next
      byte in the input stream, and return to the first step of this
      "two step" algorithm.</li>
     <p>When the above "two step" algorithm says to <dfn
-    title="concept-skip-attributes-when-sniffing">skip an
+    title="concept-get-attributes-when-sniffing">get an
     attribute</dfn>, it means doing this:</p>
      <li class="big-issue">skip the attribute</li>