hixie: Introduce a new global attribute for localisers to tell whether or not content should be translated. (whatwg r6971)

hixie: Introduce a new global attribute for localisers to tell whether
or not content should be translated. (whatwg r6971)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.5565&r2=1.5566&f=h
http://html5.org/tools/web-apps-tracker?from=6970&to=6971

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.5565
retrieving revision 1.5566
diff -u -d -r1.5565 -r1.5566
--- Overview.html 6 Feb 2012 23:53:32 -0000 1.5565
+++ Overview.html 7 Feb 2012 00:22:59 -0000 1.5566
@@ -320,7 +320,7 @@
 
    <h1>HTML5</h1>
    <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2>
-   <h2 class="no-num no-toc" id="editor-s-draft-6-february-2012">Editor's Draft 6 February 2012</h2>
+   <h2 class="no-num no-toc" id="editor-s-draft-7-february-2012">Editor's Draft 7 February 2012</h2>
    <dl><dt>Latest Published Version:</dt>
     <dd><a href="http://www.w3.org/TR/html5/">http://www.w3.org/TR/html5/</a></dd>
     <dt>Latest Editor's Draft:</dt>
@@ -467,7 +467,7 @@
   Group</a> is the W3C working group responsible for this
   specification's progress along the W3C Recommendation
   track.
-  This specification is the 6 February 2012 Editor's Draft.
+  This specification is the 7 February 2012 Editor's Draft.
   </p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><p>Work on this specification is also done at the <a href="http://www.whatwg.org/">WHATWG</a>. The W3C HTML working group
   actively pursues convergence with the WHATWG, as required by the <a href="http://www.w3.org/2007/03/HTML-WG-charter">W3C HTML working
   group charter</a>.</p><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><p>This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5
@@ -600,12 +600,13 @@
        <li><a href="#the-id-attribute"><span class="secno">3.2.3.1 </span>The <code>id</code> attribute</a></li>
        <li><a href="#the-title-attribute"><span class="secno">3.2.3.2 </span>The <code>title</code> attribute</a></li>
        <li><a href="#the-lang-and-xml:lang-attributes"><span class="secno">3.2.3.3 </span>The <code title="attr-lang">lang</code> and <code title="attr-xml-lang">xml:lang</code> attributes</a></li>
-       <li><a href="#the-xml:base-attribute-xml-only"><span class="secno">3.2.3.4 </span>The <code>xml:base</code>
+       <li><a href="#the-translate-attribute"><span class="secno">3.2.3.4 </span>The <code title="attr-translate">translate</code> attribute</a></li>
+       <li><a href="#the-xml:base-attribute-xml-only"><span class="secno">3.2.3.5 </span>The <code>xml:base</code>
   attribute (XML only)</a></li>
-       <li><a href="#the-dir-attribute"><span class="secno">3.2.3.5 </span>The <code>dir</code> attribute</a></li>
-       <li><a href="#classes"><span class="secno">3.2.3.6 </span>The <code>class</code> attribute</a></li>
-       <li><a href="#the-style-attribute"><span class="secno">3.2.3.7 </span>The <code>style</code> attribute</a></li>
-       <li><a href="#embedding-custom-non-visible-data-with-the-data-attributes"><span class="secno">3.2.3.8 </span>Embedding custom non-visible data with the <code title="attr-data-*">data-*</code> attributes</a></ol></li>
+       <li><a href="#the-dir-attribute"><span class="secno">3.2.3.6 </span>The <code>dir</code> attribute</a></li>
+       <li><a href="#classes"><span class="secno">3.2.3.7 </span>The <code>class</code> attribute</a></li>
+       <li><a href="#the-style-attribute"><span class="secno">3.2.3.8 </span>The <code>style</code> attribute</a></li>
+       <li><a href="#embedding-custom-non-visible-data-with-the-data-attributes"><span class="secno">3.2.3.9 </span>Embedding custom non-visible data with the <code title="attr-data-*">data-*</code> attributes</a></ol></li>
      <li><a href="#element-definitions"><span class="secno">3.2.4 </span>Element definitions</a>
       <ol>
        <li><a href="#attributes"><span class="secno">3.2.4.1 </span>Attributes</a></ol></li>
@@ -9088,6 +9089,7 @@
   // <span>metadata attributes</span>
            attribute DOMString <a href="#dom-title" title="dom-title">title</a>;
            attribute DOMString <a href="#dom-lang" title="dom-lang">lang</a>;
+           attribute boolean <a href="#dom-translate" title="dom-translate">translate</a>;
            attribute DOMString <a href="#dom-dir" title="dom-dir">dir</a>;
            attribute <span>DOMString</span> <a href="#dom-classname" title="dom-className">className</a>;
   readonly attribute <a href="#domtokenlist">DOMTokenList</a> <a href="#dom-classlist" title="dom-classList">classList</a>;
@@ -9200,6 +9202,7 @@
    <li><code title="attr-style"><a href="#the-style-attribute">style</a></code></li>
    <li><code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code></li>
    <li><code title="attr-title"><a href="#the-title-attribute">title</a></code></li>
+   <li><code title="attr-translate"><a href="#attr-translate">translate</a></code></li>
   </ul><div class="impl">
 
   <p>These attributes are only defined by this specification as
@@ -9448,12 +9451,68 @@
   must <a href="#reflect">reflect</a> the <code title="attr-lang"><a href="#attr-lang">lang</a></code>
   content attribute in no namespace.</p>
 
-  </div><h5 id="the-xml:base-attribute-xml-only"><span class="secno">3.2.3.4 </span>The <dfn title="attr-xml-base"><code>xml:base</code></dfn>
+  </div><h5 id="the-translate-attribute"><span class="secno">3.2.3.4 </span>The <code title="attr-translate"><a href="#attr-translate">translate</a></code> attribute</h5><p>The <dfn id="attr-translate" title="attr-translate"><code>translate</code></dfn>
+  attribute is an <a href="#enumerated-attribute">enumerated attribute</a> that is used to
+  specify whether an element's attribute values and the values of its
+  <code><a href="#text">Text</a></code> node children are to be translated when the page
+  is localized, or whether to leave them unchanged.<p>The attribute's keywords are the empty string, <code title="">yes</code>, and <code title="">no</code>. The empty string
+  and the <code title="">yes</code> keyword map to the <i>yes</i>
+  state. The <code title="">no</code> keyword maps to the <i>no</i>
+  state. In addition, there is a third state, the <i>inherit</i>
+  state, which is the <i>missing value default</i> (and the <i>invalid
+  value default</i>).<p>Each element has a <dfn id="translation-mode">translation mode</dfn>, which is in
+  either the <a href="#translate-enabled">translate-enabled</a> state or the
+  <a href="#no-translate">no-translate</a> state. If the element's <code title="attr-translate"><a href="#attr-translate">translate</a></code> attribute is in the
+  <i>yes</i> state, then the element's <a href="#translation-mode">translation mode</a>
+  is in the <a href="#translate-enabled">translate-enabled</a> state. Otherwise, if the
+  element's <code title="attr-translate"><a href="#attr-translate">translate</a></code> attribute is
+  in the <i>no</i> state, then the element's <a href="#translation-mode">translation
+  mode</a> is in the <a href="#no-translate">no-translate</a> state. Otherwise,
+  the element's code title="attr-translate"&gt;translate attribute
+  is in the <i>inherit</i> state; in that case, the element's
+  <a href="#translation-mode">translation mode</a> is in the same state as its parent
+  element, if any, or in the <a href="#translate-enabled">translate-enabled</a> state, if
+  the element is a <a href="#root-element">root element</a>.<p>When an element is in the <dfn id="translate-enabled">translate-enabled</dfn> state, the
+  element's attribute values and the values of its <code><a href="#text">Text</a></code>
+  node children are to be translated when the page is localized.<p>When an element is in the <dfn id="no-translate">no-translate</dfn> state, the
+  element's attribute values and the values of its <code><a href="#text">Text</a></code>
+  node children are to be left as-is when the page is localized, e.g.
+  because the element contains a person's name or a the name of a
+  computer program.<div class="impl">
+
+  <hr><p>The <dfn id="dom-translate" title="dom-translate"><code>translate</code></dfn> IDL
+  attribute must, on getting, return true if the element's
+  <a href="#translation-mode">translation mode</a> is <a href="#translate-enabled">translate-enabled</a>, and
+  false otherwise. On setting, it must set the content attribute's
+  value to "<code title="">yes</code>" if the new value is true, and
+  set the content attribute's value to "<code title="">no</code>
+  otherwise.</p>
+
+  </div><div class="example">
+
+   <p>In this example, everything in the document is to be translated
+   when the page is localised, except the sample keyboard input and
+   sample program output:</p>
+
+   <pre>&lt;!DOCTYPE HTML&gt;
+&lt;html&gt; &lt;!-- default on the root element is translate=yes --&gt;
+ &lt;head&gt;
+  &lt;title&gt;The Bee Game&lt;/title&gt; &lt;!-- implied translate=yes inherited from ancestors --&gt;
+ &lt;/head&gt;
+ &lt;body&gt;
+  &lt;p&gt;The Bee Game is a text adventure game in English.&lt;/p&gt;
+  &lt;p&gt;When the game launches, the first thing you should do is type
+  &lt;kbd <strong>translate=no</strong>&gt;eat honey&lt;/kbd&gt;. The game will respond with:&lt;/p&gt;
+  &lt;pre&gt;&lt;samp <strong>translate=no</strong>&gt;Yum yum! That was some good honey!&lt;/samp&gt;&lt;/pre&gt;
+ &lt;/body&gt;
+&lt;/html&gt;</pre>
+
+  </div><h5 id="the-xml:base-attribute-xml-only"><span class="secno">3.2.3.5 </span>The <dfn title="attr-xml-base"><code>xml:base</code></dfn>
   attribute (XML only)</h5><p>The <code title="attr-xml-base"><a href="#the-xml:base-attribute-xml-only">xml:base</a></code> attribute is
   defined in XML Base. <a href="#refsXMLBASE">[XMLBASE]</a><p>The <code title="attr-xml-base"><a href="#the-xml:base-attribute-xml-only">xml:base</a></code> attribute may be
   used on elements of <a href="#xml-documents">XML documents</a>. Authors must not
   use the <code title="attr-xml-base"><a href="#the-xml:base-attribute-xml-only">xml:base</a></code> attribute in
-  <a href="#html-documents">HTML documents</a>.<h5 id="the-dir-attribute"><span class="secno">3.2.3.5 </span>The <dfn title="attr-dir"><code>dir</code></dfn> attribute</h5><p>The <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute specifies the
+  <a href="#html-documents">HTML documents</a>.<h5 id="the-dir-attribute"><span class="secno">3.2.3.6 </span>The <dfn title="attr-dir"><code>dir</code></dfn> attribute</h5><p>The <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute specifies the
   element's text directionality. The attribute is an <a href="#enumerated-attribute">enumerated
   attribute</a> with the following keywords and states:<dl><dt>The <dfn id="attr-dir-ltr" title="attr-dir-ltr"><code>ltr</code></dfn> keyword, which maps to the <dfn id="attr-dir-ltr-state" title="attr-dir-ltr-state">ltr</dfn> state</dt>
 
@@ -9635,7 +9694,7 @@
    Arabic character, which causes the "right?" to be to the left of
    the Arabic text.</p>
 
-  </div><h5 id="classes"><span class="secno">3.2.3.6 </span>The <dfn title="attr-class"><code>class</code></dfn> attribute</h5><p>Every <a href="#html-elements" title="HTML elements">HTML element</a> may have a
+  </div><h5 id="classes"><span class="secno">3.2.3.7 </span>The <dfn title="attr-class"><code>class</code></dfn> attribute</h5><p>Every <a href="#html-elements" title="HTML elements">HTML element</a> may have a
   <code title="attr-class"><a href="#classes">class</a></code> attribute specified.<p>The attribute, if specified, must have a value that is a
   <a href="#set-of-space-separated-tokens">set of space-separated tokens</a> representing the various
   classes that the element belongs to.<div class="impl">
@@ -9658,7 +9717,7 @@
   <dfn id="dom-classlist" title="dom-classList"><code>classList</code></dfn> IDL
   attributes must both <a href="#reflect">reflect</a> the <code title="attr-class"><a href="#classes">class</a></code> content attribute.</p>
 
-  </div><h5 id="the-style-attribute"><span class="secno">3.2.3.7 </span>The <dfn title="attr-style"><code>style</code></dfn> attribute</h5><p>All <a href="#html-elements">HTML elements</a> may have the <code title="attr-style"><a href="#the-style-attribute">style</a></code> content attribute set. This is a
+  </div><h5 id="the-style-attribute"><span class="secno">3.2.3.8 </span>The <dfn title="attr-style"><code>style</code></dfn> attribute</h5><p>All <a href="#html-elements">HTML elements</a> may have the <code title="attr-style"><a href="#the-style-attribute">style</a></code> content attribute set. This is a
   <span>CSS styling attribute</span> as defined by the CSS Styling
   Attribute Syntax specification. <a href="#refsCSSATTR">[CSSATTR]</a><div class="impl">
 
@@ -9697,7 +9756,7 @@
 transparent"&gt;green&lt;/span&gt; and my eyes are &lt;span style="color: blue;
 background: transparent"&gt;blue&lt;/span&gt;.&lt;/p&gt;</pre>
 
-  </div><h5 id="embedding-custom-non-visible-data-with-the-data-attributes"><span class="secno">3.2.3.8 </span><dfn>Embedding custom non-visible data</dfn> with the <code title="attr-data-*"><a href="#attr-data">data-*</a></code> attributes</h5><p>A <dfn id="custom-data-attribute">custom data attribute</dfn> is an attribute in no
+  </div><h5 id="embedding-custom-non-visible-data-with-the-data-attributes"><span class="secno">3.2.3.9 </span><dfn>Embedding custom non-visible data</dfn> with the <code title="attr-data-*"><a href="#attr-data">data-*</a></code> attributes</h5><p>A <dfn id="custom-data-attribute">custom data attribute</dfn> is an attribute in no
   namespace whose name starts with the string "<dfn id="attr-data" title="attr-data-*"><code>data-</code></dfn>", has at least one
   character after the hyphen, is <a href="#xml-compatible">XML-compatible</a>, and
   contains no characters in the range U+0041 to U+005A (LATIN CAPITAL
@@ -72927,6 +72986,10 @@
           <code title="attr-style-title"><a href="#attr-style-title">style</a></code>
      <td> Alternative style sheet set name
      <td> <a href="#attribute-text">Text</a>
+    <tr><th> <code title="">translate</code>
+     <td> <a href="#attr-translate" title="attr-translate">HTML elements</a>
+     <td> Whether the element is to be translated when the page is localized
+     <td> "<code title="">yes</code>"; "<code title="">no</code>"
     <tr><th> <code title="">type</code>
      <td> <code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">a</a></code>;
           <code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">area</a></code>;

Received on Tuesday, 7 February 2012 00:27:04 UTC