html5/spec Overview.html,1.4538,1.4539

Update of /sources/public/html5/spec
In directory hutz:/tmp/cvs-serv24330

Modified Files:
	Overview.html 
Log Message:
Revamp how dir='' is implemented; add dir=auto; update to recent CSS developments. (whatwg r5672)

Index: Overview.html
===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.4538
retrieving revision 1.4539
diff -u -d -r1.4538 -r1.4539
--- Overview.html	5 Nov 2010 20:10:56 -0000	1.4538
+++ Overview.html	9 Nov 2010 00:58:06 -0000	1.4539
@@ -8451,35 +8451,119 @@
   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
   element's text directionality. The attribute is an <a href="#enumerated-attribute">enumerated
-  attribute</a> with the keyword <code title="">ltr</code> mapping
-  to the state <i>ltr</i>, and the keyword <code title="">rtl</code>
-  mapping to the state <i>rtl</i>. The attribute has no <i>invalid
-  value default</i> and no <i>missing value default</i>.<div class="impl">
+  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>
 
-  <p>The processing of this attribute is primarily performed by the
-  presentation layer. For example, the rendering section in this
-  specification defines a mapping from this attribute to the CSS
-  'direction' and 'unicode-bidi' properties, and CSS defines rendering
-  in terms of those properties.</p>
+   <dd>
 
-  </div><p><dfn id="the-directionality">The directionality</dfn> of an element, which is used in
-  particular by the <code><a href="#the-canvas-element">canvas</a></code> element's text rendering API,
-  is either 'ltr' or 'rtl'. If the user agent supports CSS and the
-  'direction' property on this element has a computed value of either
-  'ltr' or 'rtl', then that is <a href="#the-directionality">the directionality</a> of the
-  element. Otherwise, if the element is <a href="#being-rendered">being rendered</a>,
-  then <a href="#the-directionality">the directionality</a> of the element is the
-  directionality used by the presentation layer, potentially
-  determined from the value of the <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code>
-  attribute on the element. Otherwise, if the element's <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute has the state <i>ltr</i>, the
-  element's directionality is 'ltr' (left-to-right); if the attribute
-  has the state <i>rtl</i>, the element's directionality is 'rtl'
-  (right-to-left); and otherwise, the element's directionality is the
-  same as its parent element, or 'ltr' if there is no parent
-  element.<hr><dl class="domintro"><dt><var title="">document</var> . <code title="dom-dir"><a href="#dom-dir">dir</a></code> [ = <var title="">value</var> ]</dt>
+    <p>Indicates that the contents of the element are explicitly
+    directionally embedded left-to-right text.</p>
+
+   </dd>
+
+   <dt>The <dfn id="attr-dir-rtl" title="attr-dir-rtl"><code>rtl</code></dfn> keyword, which maps to the <dfn id="attr-dir-rtl-state" title="attr-dir-rtl-state">rtl</dfn> state</dt>
+
+   <dd>
+
+    <p>Indicates that the contents of the element are explicitly
+    directionally embedded right-to-left text.</p>
+
+   </dd>
+
+   <dt>The <dfn id="attr-dir-auto" title="attr-dir-auto"><code>auto</code></dfn> keyword, which maps to the <dfn id="attr-dir-auto-state" title="attr-dir-auto-state">auto</dfn> state</dt>
+
+   <dd>
+
+    <p>Indicates that the contents of the element are explicitly
+    embedded text, but that the direction is to be determined
+    programmatically using the contents of the element (as described
+    below).</p>
+
+    <p class="note">The heuristic used by this state is very crude (it
+    just looks at the first character with a strong directionality, in
+    a manner analogous to the Paragraph Level determination in the
+    bidirectional algorithm). Authors are urged to only use this value
+    as a last resort when the direction of the text is truly unknown
+    and no better server-side heuristic can be applied.</p>
+
+   </dd>
+
+  </dl><p>The attribute has no <i>invalid value default</i> and no
+  <i>missing value default</i>.<p><dfn id="the-directionality">The directionality</dfn> of an element is either '<dfn id="concept-ltr" title="concept-ltr">ltr</dfn>' or '<dfn id="concept-rtl" title="concept-rtl">rtl</dfn>', and is determined as per the first
+  appropriate set of steps from the following list:<dl class="switch"><dt>If the element's <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute is
+   in the <a href="#attr-dir-ltr-state" title="attr-dir-ltr-state">ltr</a> state</dt>
+
+   <dd><p><a href="#the-directionality">The directionality</a> of the element is '<a href="#concept-ltr" title="concept-ltr">ltr</a>'.</dd>
+
+
+   <dt>If the element's <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute is
+   in the <a href="#attr-dir-rtl-state" title="attr-dir-rtl-state">rtl</a> state</dt>
+
+   <dd><p><a href="#the-directionality">The directionality</a> of the element is '<a href="#concept-rtl" title="concept-rtl">rtl</a>'.</dd>
+
+
+   <dt>If the element's <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute is
+   in the <a href="#attr-dir-auto-state" title="attr-dir-auto-state">auto</a> state</dt>
+
+   <dt>If the element is a <code><a href="#the-bdi-element">bdi</a></code> element and the <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute is not in a defined state
+   (i.e. it is not present or has an invalid value)</dt>
+
+   <dd>
+
+    <p>Find the first character in <a href="#tree-order">tree order</a> that
+    matches the following criteria:</p>
+
+    <ul><li><p>The character is from a <a href="#text-node">text node</a> that is a
+     descendant of the element whose <a href="#the-directionality" title="the
+     directionality">directionality</a> is being
+     determined.</li>
+
+     <li><p>The character is of bidirectional character type L, AL,
+     or R. <a href="#refsBIDI">[BIDI]</a></li>
+
+     <li>
+
+      <p>The character is not in a text node that has an ancestor
+      element that is a descendant of the element whose <a href="#the-directionality" title="the directionality">directionality</a> is being
+      determined and that is either:</p>
+
+      <ul class="brief"><li>A <code><a href="#script">script</a></code> element.
+       <li>A <code><a href="#the-style-element">style</a></code> element.
+       <li>An element with a <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute in a defined state.
+      </ul></li>
+
+    </ul><p>If such a character is found and it is of bidirectional
+    character type AL or R, <a href="#the-directionality">the directionality</a> of the
+    element is '<a href="#concept-rtl" title="concept-rtl">rtl</a>'.</p>
+
+    <p>Otherwise, <a href="#the-directionality">the directionality</a> of the element is
+    '<a href="#concept-ltr" title="concept-ltr">ltr</a>'.</p>
+
+   </dd>
+
+
+
+   <dt>If the element is a <a href="#root-element">root element</a> and the <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute is not in a defined state
+   (i.e. it is not present or has an invalid value)</dt>
+
+   <dd><p><a href="#the-directionality">The directionality</a> of the element is '<a href="#concept-ltr" title="concept-ltr">ltr</a>'.</dd>
+
+
+   <dt>If the element has a parent element and the <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute is not in a defined state
+   (i.e. it is not present or has an invalid value)</dt>
+
+   <dd><p><a href="#the-directionality">The directionality</a> of the element is the same
+   as the element's parent element's <a href="#the-directionality" title="the
+   directionality">directionality</a>.</dd>
+
+
+  </dl><p>The effect of this attribute is primarily on the presentation
+  layer. For example, the rendering section in this specification
+  defines a mapping from this attribute to the CSS 'direction' and
+  'unicode-bidi' properties, and CSS defines rendering in terms of
+  those properties.<hr><dl class="domintro"><dt><var title="">document</var> . <code title="dom-dir"><a href="#dom-dir">dir</a></code> [ = <var title="">value</var> ]</dt>
    <dd>
     <p>Returns <a href="#the-html-element">the <code>html</code> element</a>'s <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute's value, if any.</p>
-    <p>Can be set, to either "<code title="">ltr</code>" or "<code title="">rtl</code>", to replace <a href="#the-html-element">the <code>html</code> element</a>'s <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute's value.</p>
+    <p>Can be set, to either "<code title="">ltr</code>", "<code title="">rtl</code>", or "<code title="">auto</code>" to replace <a href="#the-html-element">the <code>html</code> element</a>'s <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute's value.</p>
     <p>If there is no <a href="#the-html-element" title="the html element"><code>html</code> element</a>, returns the empty string and ignores new values.</p>
    </dd>
 
@@ -17255,12 +17339,15 @@
    <dd><a href="#phrasing-content">Phrasing content</a>.</dd>
    <dt>Content attributes:</dt>
    <dd><a href="#global-attributes">Global attributes</a></dd>
-   <!--XXX <dd>Also, the <code title="attr-dir">dir</code> global attribute has special semantics on this element.</dd>-->
+   <dd>Also, the <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> global attribute has special semantics on this element.</dd>
    <dt>DOM interface:</dt>
    <dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
   </dl><p>The <code><a href="#the-bdi-element">bdi</a></code> element <a href="#represents">represents</a> a span of
   text that is to be isolated from its surroundings for the purposes
-  of bidirectional text formatting. <a href="#refsBIDI">[BIDI]</a></p><!-- XXX once we have dir=auto, this element should default to dir=auto --><div class="impl">
+  of bidirectional text formatting. <a href="#refsBIDI">[BIDI]</a><p class="note">The <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> global
+  attribute defaults to <code title="attr-dir-auto"><a href="#attr-dir-auto">auto</a></code> on
+  this element (it never inherits from the parent element like with
+  other elements).<div class="impl">
 
   <p>For the purposes of the bidirectional algorithm, the user agent
   must act as if the contents of the element were a self-contained
@@ -41166,6 +41253,27 @@
 
    </dd>
 
+
+   <dt><dfn id="selector-ltr" title="selector-ltr"><code>:ltr</code></dfn></dt>
+
+   <dd>
+
+    <p>The <code title="selector-ltr"><a href="#selector-ltr">:ltr</a></code> pseudo-class must
+    match all elements whose <a href="#the-directionality" title="the
+    directionality">directionality</a> is '<a href="#concept-ltr" title="concept-ltr">ltr</a>'.</p>
+
+   </dd>
+
+   <dt><dfn id="selector-rtl" title="selector-rtl"><code>:rtl</code></dfn></dt>
+
+   <dd>
+
+    <p>The <code title="selector-rtl"><a href="#selector-rtl">:rtl</a></code> pseudo-class must
+    match all elements whose <a href="#the-directionality" title="the
+    directionality">directionality</a> is '<a href="#concept-rtl" title="concept-rtl">rtl</a>'.</p>
+
+   </dd>
+
   </dl><p class="note">Another section of this specification defines the
   <i><a href="#target-element">target element</a></i> used with the <code title="selector-target">:target</code> pseudo-class.</p>
 
@@ -62297,15 +62405,6 @@
   expected to render parentheses around the text of <code><a href="#the-rt-element">rt</a></code>
   elements in the absence of <code><a href="#the-rp-element">rp</a></code> elements.</p>
 
-  <p>The <code><a href="#the-br-element">br</a></code> element is expected to render as if its
-  contents were a single U+000A LINE FEED (LF) character and its
-  'white-space' property was 'pre'. User agents are expected to
-  support the 'clear' property on inline elements (in order to render
-  <code><a href="#the-br-element">br</a></code> elements with <code title="attr-br-clear"><a href="#attr-br-clear">clear</a></code> attributes) in the manner
-  described in the non-normative note to this effect in CSS2.1.</p>
-  <!-- section 9.5.2 of CSS2.1 -->
-  <!-- br { content: '\A'; } /* waiting for 'content' to apply to elements */ -->
-
   <p>The user agent is expected to hide <code><a href="#the-noscript-element">noscript</a></code> elements
   for whom <a href="#concept-n-script" title="concept-n-script">scripting is enabled</a>,
   irrespective of CSS rules.</p>
@@ -62868,6 +62967,8 @@
 q:before { content: open-quote; }
 q:after { content: close-quote; }
 
+br { content: '\A'; white-space: pre; }
+
 nobr { white-space: nowrap; }
 listing, plaintext, pre, xmp { white-space: pre; }
 textarea { white-space: pre-wrap; }
@@ -62907,16 +63008,21 @@
 table { border-style: outset; }
 td, th { border-style: inset; }
 
-output { unicode-bidi: isolate; }
+:ltr { direction: ltr; }
+:rtl { direction: rtl; }
+[dir] { unicode-bidi: embed; }
+bdo, bdo[dir] { unicode-bidi: bidi-override; }
+bdi, output { unicode-bidi: isolate; }
+textarea[dir=auto], pre[dir=auto] { unicode-bidi: plaintext; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */</pre>
 
-[dir=ltr] { direction: ltr; unicode-bidi: embed; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
-[dir=rtl] { direction: rtl; unicode-bidi: embed; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
-bdo[dir=ltr], bdo[dir=rtl] { unicode-bidi: bidi-override; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
-bdi { unicode-bidi: isolate; }</pre>
+  <p>Rules setting the 'quotes' property appropriately for the locales
+  and languages understood by the user are expected to be present.</p>
 
-  <p>In addition, rules setting the 'quotes' property appropriately
-  for the locales and languages understood by the user are expected to
-  be present.</p>
+  <p>User agents are expected to
+  support the 'clear' property on inline elements (in order to render
+  <code><a href="#the-br-element">br</a></code> elements with <code title="attr-br-clear"><a href="#attr-br-clear">clear</a></code> attributes) in the manner
+  described in the non-normative note to this effect in CSS2.1.</p>
+  <!-- section 9.5.2 of CSS2.1 -->
 
   <hr><p id="decohints">The following rules are also expected to apply, as
   <a href="#presentational-hints">presentational hints</a>:</p>

Received on Tuesday, 9 November 2010 00:58:13 UTC