Skip to content
Permalink
Browse files
[] (0) more work on the sniffing algorithm
git-svn-id: http://svn.whatwg.org/webapps@600 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 16, 2007
1 parent 48c4a33 commit 597994d
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 13 deletions.
46 index
@@ -29007,18 +29007,48 @@ function receiver(e) {
a space)

<dd>
<p class=big-issue>try to find charset attribute or content attribute
with charset parameter, <a href="#skip-an"
title=concept-skip-attributes-when-sniffing>skip other
attributes</a></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).

<li>
<p><a href="#get-an" title=concept-get-attributes-when-sniffing>Get
an attribute</a> 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.

<li>
<p>Examine the attribute's name:</p>

<dl class=switch>
<dt>If it is 'charset'

<dd>
<p class=big-issue>use this as the character encoding

<dt>If it is 'content'

<dd>
<p class=big-issue>skip up to after the first ';', then <a
href="#get-an" title=concept-get-attributes-when-sniffing>get an
attribute; if it is 'charset' then use its value as the
charset.</a>
</dl>

<li>
<p>Return to step 1 in these inner steps.
</ol>

<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)

<dd>
<p class=big-issue>skip start or end tag, and <a href="#skip-an"
title=concept-skip-attributes-when-sniffing>skip any attributes</a></p>
<p class=big-issue>skip start or end tag, and <span
title=concept-skip-attributes-when-sniffing>skip any
attributes</span></p>

<dt>A sequence of bytes starting with: 0x3C 0x2D (ASCII '&lt;!')

@@ -29038,8 +29068,8 @@ function receiver(e) {
algorithm.
</ol>

<p>When the above "two step" algorithm says to <dfn id=skip-an
title=concept-skip-attributes-when-sniffing>skip an attribute</dfn>, it
<p>When the above "two step" algorithm says to <dfn id=get-an
title=concept-get-attributes-when-sniffing>get an attribute</dfn>, it
means doing this:</p>

<ol>
39 source
@@ -26736,10 +26736,39 @@ function receiver(e) {
<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>
<dd>

<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>

</dd>

@@ -26775,7 +26804,7 @@ function receiver(e) {
</ol>

<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>

<ol>

0 comments on commit 597994d

Please sign in to comment.