HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2712[Gecko] [Webkit] Allow Emacs-style mode lines on the first line of a cache manifest file. (credit: ap)2009-01-27 23:22
@@ -41840,25 +41840,25 @@ style/default.css</pre>
   encoded using UTF-8. Data in application cache manifests is
   line-based. Newlines must be represented by U+000A LINE FEED (LF)
   characters, U+000D CARRIAGE RETURN (CR) characters, or U+000D
   CARRIAGE RETURN (CR) U+000A LINE FEED (LF) pairs.</p>
 
   <p class="note">This is a willful double violation of RFC2046. <a
   href="#refsRFC2046">[RFC2046]</a></p>
 
   <p>The first line of an application cache manifest must consist of
   the string "CACHE", a single U+0020 SPACE character, the string
-  "MANIFEST", and zero or more U+0020 SPACE and U+0009 CHARACTER
-  TABULATION (tab) characters.  The first line may optionally be
-  preceded by a U+FEFF BYTE ORDER MARK (BOM) character. If any other
-  text is found on the first line, the user agent will ignore the
-  entire file.</p>
+  "MANIFEST", and either a U+0020 SPACE character, a U+0009 CHARACTER
+  TABULATION (tab) character, a U+000A LINE FEED (LF) character, or a
+  U+000D CARRIAGE RETURN (CR) character. The first line may optionally
+  be preceded by a U+FEFF BYTE ORDER MARK (BOM) character. If any
+  other text is found on the first line, it is ignored.</p>
 
   <p>Subsequent lines, if any, must all be one of the following:</p>
 
   <dl>
    <dt>A blank line
    <dd>
     <p>Blank lines must consist of zero or more U+0020 SPACE and
     U+0009 CHARACTER TABULATION (tab) characters only.</p>
 
    <dt>A comment
@@ -42002,41 +42002,43 @@ style/default.css</pre>
    ORDER MARK (BOM) character, then advance <var
    title="">position</var> to the next character.</p></li>
 
    <li><p>If the characters starting from <var title="">position</var>
    are "CACHE", followed by a U+0020 SPACE character, followed by
    "MANIFEST", then advance <var title="">position</var> to the next
    character after those. Otherwise, this isn't a cache manifest;
    abort this algorithm with a failure while checking for the magic
    signature.</p></li>
 
-   <li><p><span>Collect a sequence of characters</span> that are
-   U+0020 SPACE or U+0009 CHARACTER TABULATION (tab)
-   characters.</p></li>
-
-   <li><p>If <var title="">position</var> is not past the end of <var
-   title="">input</var> and the character at <var
-   title="">position</var> is neither a U+000A LINE FEED (LF)
-   characters nor a U+000D CARRIAGE RETURN (CR) character, then this
-   isn't a cache manifest; abort this algorithm with a failure while
-   checking for the magic signature.</p></li>
+   <li><p>If the character at <var title="">position</var> is neither
+   a U+0020 SPACE character, a U+0009 CHARACTER TABULATION (tab)
+   character, U+000A LINE FEED (LF) character, nor a U+000D CARRIAGE
+   RETURN (CR) character, then this isn't a cache manifest; abort this
+   algorithm with a failure while checking for the magic
+   signature.</p></li>
 
    <li><p>This is a cache manifest. The algorithm cannot fail beyond
    this point (though bogus lines can get ignored).</p></li>
 
+   <li><p><span>Collect a sequence of characters</span> that are
+   <em>not</em> U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR)
+   characters, and ignore those characters. (Extra text on the first
+   line, after the signature, is ignored.)</p></li>
+
    <li><p>Let <var title="">mode</var> be "explicit".</p></li>
 
    <li><p><em>Start of line</em>: If <var title="">position</var> is
    past the end of <var title="">input</var>, then jump to the last
    step. Otherwise, <span>collect a sequence of characters</span> that
    are U+000A LINE FEED (LF), U+000D CARRIAGE RETURN (CR), U+0020
    SPACE, or U+0009 CHARACTER TABULATION (tab) characters.</p></li>
+   <!-- strips leading spaces, ignores space-only lines, ignores blank lines -->
 
    <li><p>Now, <span>collect a sequence of characters</span> that are
    <em>not</em> U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR)
    characters, and let the result be <var
    title="">line</var>.</p></li>
 
    <li><p>Drop any trailing U+0020 SPACE and U+0009 CHARACTER
    TABULATION (tab) characters at the end of <var
    title="">line</var>.</p></li>
 

|