HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2057Define the Content-Language pragma, since apparently ~1% of sites use it in some way or another.2008-08-12 10:02
@@ -5807,43 +5807,53 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
   elements of <span>HTML documents</span>.  Authors must not use the
   <code title="attr-lang">lang</code> attribute in <span>XML
   documents</span>.</p>
 
   <p>The <code title="attr-xml-lang">xml:lang</code> attribute may be
   used on elements of <span>XML documents</span>.  Authors must not
   use the <code title="attr-xml-lang">xml:lang</code> attribute in
   <span>HTML documents</span>.</p> <!-- technically this is redundant
   with the XML spec -->
 
+  <hr>
+
   <p>To determine the language of a node, user agents must look at the
   nearest ancestor element (including the element itself if the node
   is an element) that has an <code
   title="attr-xml-lang">xml:lang</code> attribute set or is an <span
   title="HTML elements">HTML element</span> and has a <code
   title="attr-lang">lang</code> attribute set. That attribute
-  specifies the language of the node. If that attribute's value is not
-  a recognised language code, then it must be treated as an unknown
-  language (as if the value was the empty string).</p>
+  specifies the language of the node.</p>
 
   <p>If both the <code title="attr-xml-lang">xml:lang</code> attribute
   and the <code title="attr-lang">lang</code> attribute are set on an
   element, user agents must use the <code
   title="attr-xml-lang">xml:lang</code> attribute, and the <code
   title="attr-lang">lang</code> attribute must be <span
   title="ignore">ignored</span> for the purposes of determining the
   element's language.</p>
 
   <p>If no explicit language is given for the <span>root
-  element</span>, then language information from a higher-level
-  protocol (such as HTTP), if any, must be used as the final
-  fallback language. In the absence of any language information, the
-  default value is unknown (the empty string).</p>
+  element</span>, but there is a <span>document-wide default
+  language</span> set, then that is the language of the node.</p>
+
+  <p>If there is no <span>document-wide default language</span>, then
+  language information from a higher-level protocol (such as HTTP), if
+  any, must be used as the final fallback language. In the absence of
+  any language information, the default value is unknown (the empty
+  string).</p>
+
+  <p>If the resulting value is not a recognised language code, then it
+  must be treated as an unknown language (as if the value was the
+  empty string).</p>
+
+  <hr>
 
   <p>User agents may use the element's language to determine proper
   processing or rendering (e.g. in the selection of appropriate
   fonts or pronunciations, or for dictionary selection). <!--User
   agents must not use the element's language to determine text
   directionality. (commented out because text directionality is a
   rendering-level concern.)--></p>
 
   <p>The <dfn title="dom-lang"><code>lang</code></dfn> DOM attribute
   must <span>reflect</span> the <code title="attr-lang">lang</code>
@@ -8162,33 +8172,32 @@ Consider: data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ d
   directive.</p>
 
   <p>The <code
   title="attr-meta-http-equiv">http-equiv</code> attribute
   is an <span>enumerated attribute</span>. The following table lists
   the keywords defined for this attribute. The states given in the
   first cell of the rows with keywords give the states to which
   those keywords map.<!-- Some of the keywords are non-conforming, as
   noted in the last column.--></p>
 
+<!-- things that are neither conforming nor do anything are commented out -->
   <table>
    <thead>
     <tr>
      <th>State
      <th>Keywords
 <!--     <th>Notes-->
    <tbody>
-<!-- things that are neither conforming nor do anything are commented out
     <tr>
-     <td><span title="attr-meta-http-equiv-content-language">Content-Language</span>
+     <td><span title="attr-meta-http-equiv-content-language">Content Language</span>
      <td><code title="">Content-Language</code>
-     <td>Non-conforming [ XXX but maybe we should make this an alternative to <html lang="">? ]
--->
+<!--     <td>Non-conforming -->
     <tr>
      <td><span title="attr-meta-http-equiv-content-type">Encoding declaration</span>
      <td><code title="">Content-Type</code>
 <!--     <td>Non-conforming -->
 <!--
     <tr>
      <td><span title="attr-meta-http-equiv-content-script-type">Content-Script-Type</span>
      <td><code title="">Content-Script-Type</code>
      <td>Non-conforming
     <tr>
@@ -8247,20 +8256,72 @@ people expect to have work and what is necessary.
 -->
 
   <p>When a <code>meta</code> element is inserted into the document,
   if its <code title="attr-meta-http-equiv">http-equiv</code>
   attribute is present and represents one of the above states, then
   the user agent must run the algorithm appropriate for that state, as
   described in the following list:</p>
 
   <dl>
 
+   <dt><dfn title="attr-meta-http-equiv-content-language">Content language</dfn>
+
+   <dd>
+
+    <p>This pragma sets the <dfn>document-wide default
+    language</dfn>. Until the pragma is successfully processed, there
+    is no <span>document-wide default language</span>.</p>
+
+    <ol>
+
+     <li><p>If another <code>meta</code> element in the <span
+     title="attr-meta-http-equiv-content-language">Content Language
+     state</span> has already been successfully processed (i.e. when
+     it was inserted the user agent processed it and reached the last
+     step of this list of steps), then abort these steps.</p></li>
+
+     <li><p>If the <code>meta</code> element has no <code
+     title="attr-meta-content">content</code> attribute, or if that
+     attribute's value is the empty string, then abort these
+     steps.</p></li>
+
+     <li><p>Let <var title="">input</var> be the value of the
+     element's <code title="attr-meta-content">content</code>
+     attribute.</p></li>
+
+     <li><p>Let <var title="">position</var> point at the first
+     character of <var title="">input</var>.</p></li>
+
+     <li><p><span>Skip whitespace</span>.</p></li>
+
+     <li><p><span title="collect a sequence of characters">Collect a
+     sequence of characters</span> that are neither <span title="space
+     character">space characters</span> nor a U+002C COMMA character
+     (",").</p></li>
+
+     <li><p>Let the <span>document-wide default language</span> be the
+     string that resulted from the previous step.</p></li>
+
+    </ol>
+
+    <p>For <code>meta</code> elements in the <span
+    title="attr-meta-http-equiv-content-language">Content Language
+    state</span>, the <code title="attr-meta-content">content</code>
+    attribute must have a value consisting of a valid RFC 3066
+    language code. <a href="#refsRFC3066">[RFC3066]</a></p>
+
+    <p class="note">This pragma not exactly equivalent to the HTTP
+    <code>Content-Language</code> header, for instance it only
+    supports one language. <a href="#refsRFC2616">[RFC2616]</a></p>
+
+   </dd>
+
    <dt><dfn title="attr-meta-http-equiv-content-type">Encoding declaration state</dfn>
 
    <dd>
 
     <p>The <span title="attr-meta-http-equiv-content-type">Encoding
     declaration state's</span> user agent requirements are all handled
     by the parsing section of the specification. The state is just an
     alternative form of setting the <code
     title="meta-charset">charset</code> attribute: it is a
     <span>character encoding declaration</span>.</p>

|