Skip to content
Permalink
Browse files
[giow] (2) Update to better match UAs.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=9628

git-svn-id: http://svn.whatwg.org/webapps@5546 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 29, 2010
1 parent bb16d5b commit 174920cf4991ec21485b933353117c8facc7e210
Showing 3 changed files with 31 additions and 16 deletions.
@@ -6520,16 +6520,20 @@ <h4 id=content-type-sniffing><span class=secno>2.7.3 </span>Determining the type
Content-Type</dfn>, given a string <var title="">s</var>, is as
follows. It either returns an encoding or nothing.</p>

<ol><li><p>Find the first seven characters in <var title="">s</var>
that are an <a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for the word
"<code title="">charset</code>". If no such match is found, return
nothing.</li>
<ol><!-- http://www.hixie.ch/tests/adhoc/html/parsing/encoding/all.html --><li><p>Let <var title="">position</var> be a pointed into <var title="">s</var>, initially pointing at the start of the
string.</li>

<li><p><i>Loop</i>: Find the first seven characters in <var title="">s</var> after <var title="">position</var> that are an
<a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for the word "<code title="">charset</code>". If no such match is found, return nothing
and abort these steps.</li>

<li><p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020
characters that immediately follow the word "<code title="">charset</code>" (there might not be any).</li>

<li><p>If the next character is not a U+003D EQUALS SIGN ('='),
return nothing and abort these steps.</li>
then move <var title="">position</var> to point just before that
next character, and jump back to the step labeled
<i>loop</i>.</li>

<li><p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020
characters that immediately follow the equals sign (there might not
14 index
@@ -6497,16 +6497,20 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
Content-Type</dfn>, given a string <var title="">s</var>, is as
follows. It either returns an encoding or nothing.</p>

<ol><li><p>Find the first seven characters in <var title="">s</var>
that are an <a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for the word
"<code title="">charset</code>". If no such match is found, return
nothing.</li>
<ol><!-- http://www.hixie.ch/tests/adhoc/html/parsing/encoding/all.html --><li><p>Let <var title="">position</var> be a pointed into <var title="">s</var>, initially pointing at the start of the
string.</li>

<li><p><i>Loop</i>: Find the first seven characters in <var title="">s</var> after <var title="">position</var> that are an
<a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for the word "<code title="">charset</code>". If no such match is found, return nothing
and abort these steps.</li>

<li><p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020
characters that immediately follow the word "<code title="">charset</code>" (there might not be any).</li>

<li><p>If the next character is not a U+003D EQUALS SIGN ('='),
return nothing and abort these steps.</li>
then move <var title="">position</var> to point just before that
next character, and jump back to the step labeled
<i>loop</i>.</li>

<li><p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020
characters that immediately follow the equals sign (there might not
19 source
@@ -6168,19 +6168,26 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
Content-Type</dfn>, given a string <var title="">s</var>, is as
follows. It either returns an encoding or nothing.</p>

<ol>
<ol> <!-- http://www.hixie.ch/tests/adhoc/html/parsing/encoding/all.html -->

<li><p>Find the first seven characters in <var title="">s</var>
that are an <span>ASCII case-insensitive</span> match for the word
"<code title="">charset</code>". If no such match is found, return
nothing.</p></li>
<li><p>Let <var title="">position</var> be a pointed into <var
title="">s</var>, initially pointing at the start of the
string.</p></li>

<li><p><i>Loop</i>: Find the first seven characters in <var
title="">s</var> after <var title="">position</var> that are an
<span>ASCII case-insensitive</span> match for the word "<code
title="">charset</code>". If no such match is found, return nothing
and abort these steps.</p></li>

<li><p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020
characters that immediately follow the word "<code
title="">charset</code>" (there might not be any).</p></li>

<li><p>If the next character is not a U+003D EQUALS SIGN ('='),
return nothing and abort these steps.</p></li>
then move <var title="">position</var> to point just before that
next character, and jump back to the step labeled
<i>loop</i>.</p></li>

<li><p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020
characters that immediately follow the equals sign (there might not

0 comments on commit 174920c

Please sign in to comment.