Skip to content

Commit

Permalink
[cgiowt] (1) Make the charset sniffer more accurately match the parser.
Browse files Browse the repository at this point in the history
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=11411

git-svn-id: http://svn.whatwg.org/webapps@5764 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 11, 2011
1 parent 2e59b4c commit 3fd32bc
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 38 deletions.
26 changes: 14 additions & 12 deletions complete.html
Expand Up @@ -76505,7 +76505,7 @@ <h5 id=determining-the-character-encoding><span class=secno>12.2.2.1 </span>Dete

<li><p>Let <var title="">got pragma</var> be false.</li>

<li><p>Let <var title="">mode</var> be null.</li>
<li><p>Let <var title="">need pragma</var> be null.</li>

<li><p>Let <var title="">charset</var> be the null value
(which, for the purposes of this algorithm, is distinct from
Expand All @@ -76518,6 +76518,9 @@ <h5 id=determining-the-character-encoding><span class=secno>12.2.2.1 </span>Dete
<li><p>If the attribute's name is already in <var title="">attribute list</var>, then return to the step
labeled <i>attributes</i>.</p>

<li><p>Add the attribute's name to <var title="">attribute
list</var>.</p>

<li>

<p>Run the appropriate step from the following list, if one
Expand All @@ -76528,29 +76531,28 @@ <h5 id=determining-the-character-encoding><span class=secno>12.2.2.1 </span>Dete
<dd><p>If the attribute's value is "<code title="">content-type</code>", then set <var title="">got
pragma</var> to true.</dd>

<dt>If the attribute's name is "<code title="">charset</code>"</dt>

<dd><p>If <var title="">charset</var> is still set to null,
let <var title="">charset</var> be the encoding
corresponding to the attribute's value, and set <var title="">mode</var> to "charset".</dd>

<dt>If the attribute's name is "<code title="">content</code>"</dt>

<dd><p>Apply the <a href=#algorithm-for-extracting-an-encoding-from-a-content-type>algorithm for extracting an encoding
from a Content-Type</a>, giving the attribute's value as
the string to parse. If an encoding is returned, and if
<var title="">charset</var> is still set to null, let <var title="">charset</var> be the encoding returned, and set
<var title="">mode</var> to "pragma".</dd>
<var title="">need pragma</var> to true.</dd>

<dt>If the attribute's name is "<code title="">charset</code>"</dt>

<dd><p>Let <var title="">charset</var> be the encoding
corresponding to the attribute's value, and set <var title="">need pragma</var> to false.</dd>

</dl></li>

<li><p>Return to the step labeled <i>attributes</i>.</li>

<li><p><i>Processing</i>: If <var title="">mode</var> is
null, then jump to the second step of the overall "two step"
algorithm.</li>
<li><p><i>Processing</i>: If <var title="">need pragma</var>
is null, then jump to the second step of the overall "two
step" algorithm.</li>

<li><p>If <var title="">mode</var> is "pragma" but <var title="">got pragma</var> is false, then jump to the second
<li><p>If <var title="">mode</var> is true but <var title="">got pragma</var> is false, then jump to the second
step of the overall "two step" algorithm.</li>

<li><p>If <var title="">charset</var> is a UTF-16 encoding,
Expand Down
26 changes: 14 additions & 12 deletions index
Expand Up @@ -72479,7 +72479,7 @@ interface <dfn id=messageport>MessagePort</dfn> {

<li><p>Let <var title="">got pragma</var> be false.</li>

<li><p>Let <var title="">mode</var> be null.</li>
<li><p>Let <var title="">need pragma</var> be null.</li>

<li><p>Let <var title="">charset</var> be the null value
(which, for the purposes of this algorithm, is distinct from
Expand All @@ -72492,6 +72492,9 @@ interface <dfn id=messageport>MessagePort</dfn> {
<li><p>If the attribute's name is already in <var title="">attribute list</var>, then return to the step
labeled <i>attributes</i>.</p>

<li><p>Add the attribute's name to <var title="">attribute
list</var>.</p>

<li>

<p>Run the appropriate step from the following list, if one
Expand All @@ -72502,29 +72505,28 @@ interface <dfn id=messageport>MessagePort</dfn> {
<dd><p>If the attribute's value is "<code title="">content-type</code>", then set <var title="">got
pragma</var> to true.</dd>

<dt>If the attribute's name is "<code title="">charset</code>"</dt>

<dd><p>If <var title="">charset</var> is still set to null,
let <var title="">charset</var> be the encoding
corresponding to the attribute's value, and set <var title="">mode</var> to "charset".</dd>

<dt>If the attribute's name is "<code title="">content</code>"</dt>

<dd><p>Apply the <a href=#algorithm-for-extracting-an-encoding-from-a-content-type>algorithm for extracting an encoding
from a Content-Type</a>, giving the attribute's value as
the string to parse. If an encoding is returned, and if
<var title="">charset</var> is still set to null, let <var title="">charset</var> be the encoding returned, and set
<var title="">mode</var> to "pragma".</dd>
<var title="">need pragma</var> to true.</dd>

<dt>If the attribute's name is "<code title="">charset</code>"</dt>

<dd><p>Let <var title="">charset</var> be the encoding
corresponding to the attribute's value, and set <var title="">need pragma</var> to false.</dd>

</dl></li>

<li><p>Return to the step labeled <i>attributes</i>.</li>

<li><p><i>Processing</i>: If <var title="">mode</var> is
null, then jump to the second step of the overall "two step"
algorithm.</li>
<li><p><i>Processing</i>: If <var title="">need pragma</var>
is null, then jump to the second step of the overall "two
step" algorithm.</li>

<li><p>If <var title="">mode</var> is "pragma" but <var title="">got pragma</var> is false, then jump to the second
<li><p>If <var title="">mode</var> is true but <var title="">got pragma</var> is false, then jump to the second
step of the overall "two step" algorithm.</li>

<li><p>If <var title="">charset</var> is a UTF-16 encoding,
Expand Down
30 changes: 16 additions & 14 deletions source
Expand Up @@ -86597,7 +86597,7 @@ interface <span>WindowLocalStorage</span> {

<li><p>Let <var title="">got pragma</var> be false.</p></li>

<li><p>Let <var title="">mode</var> be null.</p></li>
<li><p>Let <var title="">need pragma</var> be null.</p></li>

<li><p>Let <var title="">charset</var> be the null value
(which, for the purposes of this algorithm, is distinct from
Expand All @@ -86612,6 +86612,9 @@ interface <span>WindowLocalStorage</span> {
title="">attribute list</var>, then return to the step
labeled <i>attributes</i>.</p>

<li><p>Add the attribute's name to <var title="">attribute
list</var>.</p>

<li>

<p>Run the appropriate step from the following list, if one
Expand All @@ -86626,14 +86629,6 @@ interface <span>WindowLocalStorage</span> {
title="">content-type</code>", then set <var title="">got
pragma</var> to true.</p></dd>

<dt>If the attribute's name is "<code
title="">charset</code>"</dt>

<dd><p>If <var title="">charset</var> is still set to null,
let <var title="">charset</var> be the encoding
corresponding to the attribute's value, and set <var
title="">mode</var> to "charset".</p></dd>

<dt>If the attribute's name is "<code
title="">content</code>"</dt>

Expand All @@ -86642,19 +86637,26 @@ interface <span>WindowLocalStorage</span> {
the string to parse. If an encoding is returned, and if
<var title="">charset</var> is still set to null, let <var
title="">charset</var> be the encoding returned, and set
<var title="">mode</var> to "pragma".</p></dd>
<var title="">need pragma</var> to true.</p></dd>

<dt>If the attribute's name is "<code
title="">charset</code>"</dt>

<dd><p>Let <var title="">charset</var> be the encoding
corresponding to the attribute's value, and set <var
title="">need pragma</var> to false.</p></dd>

</dl>

</li>

<li><p>Return to the step labeled <i>attributes</i>.</p></li>

<li><p><i>Processing</i>: If <var title="">mode</var> is
null, then jump to the second step of the overall "two step"
algorithm.</p></li>
<li><p><i>Processing</i>: If <var title="">need pragma</var>
is null, then jump to the second step of the overall "two
step" algorithm.</p></li>

<li><p>If <var title="">mode</var> is "pragma" but <var
<li><p>If <var title="">mode</var> is true but <var
title="">got pragma</var> is false, then jump to the second
step of the overall "two step" algorithm.</p></li>

Expand Down

0 comments on commit 3fd32bc

Please sign in to comment.