Skip to content

Commit

Permalink
[g] (2) Define 'directionality' in terms of the dir='' attribute for …
Browse files Browse the repository at this point in the history
…cases where the 'direction' property has no computed value. (credit: db)

git-svn-id: http://svn.whatwg.org/webapps@2001 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 5, 2008
1 parent a68467c commit c73d038
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 84 deletions.
85 changes: 44 additions & 41 deletions index
Expand Up @@ -8000,17 +8000,27 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
<code title="">rtl</code> mapping to the state <em>rtl</em>. The attribute
has no defaults.

<p>If the attribute has the state <em>ltr</em>, the element's
directionality is left-to-right. If the attribute has the state
<em>rtl</em>, the element's directionality is right-to-left. Otherwise,
the element's directionality is the same as its parent element, or
<em>ltr</em> if there is no parent element.

<p>The processing of this attribute depends on the presentation layer. For
example, CSS 2.1 defines a mapping from this attribute to the CSS
'direction' and 'unicode-bidi' properties, and defines rendering in terms
of those properties.</p>
<!-- XXXDIR -->
<p>The processing of this attribute is primarily performed by the
presentation layer. For example, CSS 2.1 defines a mapping from this
attribute to the CSS 'direction' and 'unicode-bidi' properties, and
defines rendering in terms of those properties.

<p><dfn id=the-directionality>The directionality</dfn> of an element, which
is used in particular by the <code><a href="#canvas">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 being rendered, 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="#dir">dir</a></code>
attribute on the element. Otherwise, if the element's <code
title=attr-dir><a href="#dir">dir</a></code> attribute has the state
<em>ltr</em>, the element's directionality is 'ltr' (left-to-right); if
the attribute has the state <em>rtl</em>, the element's directionality is
'rtl' (right-to-left); and oherwise, the element's directionality is the
same as its parent element, or 'ltr' if there is no parent element.

<p>The <dfn id=dir0 title=dom-dir><code>dir</code></dfn> DOM attribute on
an element must <a href="#reflect">reflect</a> the <code title=attr-dir><a
Expand Down Expand Up @@ -22304,14 +22314,11 @@ notes on what would need to be defined for dashed lines:
<p>Form a hypothetical infinitely wide CSS line box containing a single
inline box containing the text <var title="">text</var>, with all the
properties at their initial values except the 'font' property of the
inline element set to <var title="">font</var> and the 'direction'
property of the inline element set to the 'direction' property of the
<code><a href="#canvas">canvas</a></code> element. <a
href="#refsCSS">[CSS]</a>
inline box set to <var title="">font</var> and the 'direction' property
of the inline box set to <a href="#the-directionality">the
directionality</a> of the <code><a href="#canvas">canvas</a></code>
element. <a href="#refsCSS">[CSS]</a>
</li>
<!-- XXXDIR somehow mention
somewhere that if you don't support CSS, dir="" still maps to
'direction' for the purposes of things like this. -->
<!-- if you insert a step here, make sure to adjust the next step's
final words -->

Expand Down Expand Up @@ -22339,13 +22346,13 @@ notes on what would need to be defined for dashed lines:

<dt> If <code title=dom-context-2d-textAlign><a
href="#textalign">textAlign</a></code> is <code title="">start</code>
and the 'direction'<!--XXXDIR--> property on the <code><a
href="#canvas">canvas</a></code> element has a computed value of 'ltr'
and <span>the directionality of the <code><a
href="#canvas">canvas</a></code> element is 'ltr'</span>

<dt> If <code title=dom-context-2d-textAlign><a
href="#textalign">textAlign</a></code> is <code title="">end</code> and
the 'direction'<!--XXXDIR--> property on the <code><a
href="#canvas">canvas</a></code> element has a computed value of 'rtl'
<span>the directionality of the <code><a
href="#canvas">canvas</a></code> element is 'rtl'</span>

<dd>Let the <var title="">anchor point</var>'s horizontal position be
the left edge of the inline box.
Expand All @@ -22355,13 +22362,13 @@ notes on what would need to be defined for dashed lines:

<dt> If <code title=dom-context-2d-textAlign><a
href="#textalign">textAlign</a></code> is <code title="">end</code> and
the 'direction'<!--XXXDIR--> property on the <code><a
href="#canvas">canvas</a></code> element has a computed value of 'ltr'
<span>the directionality of the <code><a
href="#canvas">canvas</a></code> element is 'ltr'</span>

<dt> If <code title=dom-context-2d-textAlign><a
href="#textalign">textAlign</a></code> is <code title="">start</code>
and the 'direction'<!--XXXDIR--> property on the <code><a
href="#canvas">canvas</a></code> element has a computed value of 'rtl'
and <span>the directionality of the <code><a
href="#canvas">canvas</a></code> element is 'rtl'</span>

<dd>Let the <var title="">anchor point</var>'s horizontal position be
the right edge of the inline box.
Expand Down Expand Up @@ -22489,10 +22496,10 @@ been waiting now?)
<li><p>Form a <em class="big-issue">whatever CSS ends up calling
vertical line boxes and inline boxes</em> containing the text <var
title="">text</var>, with all the properties at their initial
values except the 'font' property of the inline element set to <var
values except the 'font' property of the inline box set to <var
title="">font</var> and the 'direction' property of the inline
element set to the 'direction' property of the <code>canvas</code>
element.</p></li><!- - XXXDIR - ->
box set to <span>the directionality<//span> of the <code>canvas</code>
element.</p></li>

<!- - if you insert a step here, make sure to adjust the next step's
final words - ->
Expand Down Expand Up @@ -22521,14 +22528,12 @@ been waiting now?)
title="">start</code></dt>
<dt> If <code
title="dom-context-2d-textAlign">textAlign</code> is <code
title="">left</code> and the 'direction'<!- -XXXDIR- -> property
on the <code>canvas</code> element has a computed value of
'ltr'</dt>
title="">left</code> and <span>the directionality<//span> of the
<code>canvas</code> element is 'ltr'</dt>
<dt> If <code
title="dom-context-2d-textAlign">textAlign</code> is <code
title="">right</code> and the 'direction'<!- -XXXDIR- -> property
on the <code>canvas</code> element has a computed value of
'rtl'</dt>
title="">right</code> and <span>the directionality<//span> of the
<code>canvas</code> element is 'rtl'</dt>

<dd>Let the <var title="">anchor point</var>'s vertical
position be the top edge of the <em class="big-issue">inline
Expand All @@ -22539,14 +22544,12 @@ been waiting now?)
title="">end</code></dt>
<dt> If <code
title="dom-context-2d-textAlign">textAlign</code> is <code
title="">right</code> and the 'direction'<!- -XXXDIR- -> property
on the <code>canvas</code> element has a computed value of
'ltr'</dt>
title="">right</code> and <span>the directionality<//span> of the
<code>canvas</code> element is 'ltr'</dt>
<dt> If <code
title="dom-context-2d-textAlign">textAlign</code> is <code
title="">left</code> and the 'direction'<!- -XXXDIR- -> property on
the <code>canvas</code> element has a computed value of
'rtl'</dt>
title="">left</code> and <span>the directionality<//span> of the
<code>canvas</code> element is 'rtl'</dt>

<dd>Let the <var title="">anchor point</var>'s vertical
position be the bottom edge of the <em class="big-issue">inline
Expand Down
86 changes: 43 additions & 43 deletions source
Expand Up @@ -5865,18 +5865,28 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
mapping to the state <em>rtl</em>. The attribute has no
defaults.</p>

<p>If the attribute has the state <em>ltr</em>, the element's
directionality is left-to-right. If the attribute has the state
<em>rtl</em>, the element's directionality is
right-to-left. Otherwise, the element's directionality is the same
as its parent element, or <em>ltr</em> if there is no parent
<p>The processing of this attribute is primarily performed by the
presentation layer. For example, CSS 2.1 defines a mapping from this
attribute to the CSS 'direction' and 'unicode-bidi' properties, and
defines rendering in terms of those properties.</p>

<p><dfn>The directionality</dfn> of an element, which is used in
particular by the <code>canvas</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 <span>the directionality</span> of the
element. Otherwise, if the element is being rendered, then <span>the
directionality</span> of the element is the directionality used by
the presentation layer, potentially determined from the value of the
<code title="attr-dir">dir</code> attribute on the
element. Otherwise, if the element's <code
title="attr-dir">dir</code> attribute has the state <em>ltr</em>,
the element's directionality is 'ltr' (left-to-right); if the
attribute has the state <em>rtl</em>, the element's directionality
is 'rtl' (right-to-left); and oherwise, the element's directionality
is the same as its parent element, or 'ltr' if there is no parent
element.</p>

<p>The processing of this attribute depends on the presentation
layer. For example, CSS 2.1 defines a mapping from this attribute to
the CSS 'direction' and 'unicode-bidi' properties, and defines
rendering in terms of those properties.</p><!-- XXXDIR -->

<p>The <dfn title="dom-dir"><code>dir</code></dfn> DOM attribute on
an element must <span>reflect</span> the <code
title="attr-dir">dir</code> content attribute of that element,
Expand Down Expand Up @@ -19519,12 +19529,10 @@ notes on what would need to be defined for dashed lines:
<li><p>Form a hypothetical infinitely wide CSS line box containing
a single inline box containing the text <var title="">text</var>,
with all the properties at their initial values except the 'font'
property of the inline element set to <var title="">font</var> and
the 'direction' property of the inline element set to the
'direction' property of the <code>canvas</code> element. <a
href="#refsCSS">[CSS]</a></p></li><!-- XXXDIR somehow mention
somewhere that if you don't support CSS, dir="" still maps to
'direction' for the purposes of things like this. -->
property of the inline box set to <var title="">font</var> and the
'direction' property of the inline box set to <span>the
directionality</span> of the <code>canvas</code> element. <a
href="#refsCSS">[CSS]</a></p></li>

<!-- if you insert a step here, make sure to adjust the next step's
final words -->
Expand Down Expand Up @@ -19554,14 +19562,12 @@ notes on what would need to be defined for dashed lines:
title="">left</code></dt>
<dt> If <code
title="dom-context-2d-textAlign">textAlign</code> is <code
title="">start</code> and the 'direction'<!--XXXDIR--> property
on the <code>canvas</code> element has a computed value of
'ltr'</dt>
title="">start</code> and <span>the directionality<//span> of the
<code>canvas</code> element is 'ltr'</dt>
<dt> If <code
title="dom-context-2d-textAlign">textAlign</code> is <code
title="">end</code> and the 'direction'<!--XXXDIR--> property
on the <code>canvas</code> element has a computed value of
'rtl'</dt>
title="">end</code> and <span>the directionality<//span> of the
<code>canvas</code> element is 'rtl'</dt>

<dd>Let the <var title="">anchor point</var>'s horizontal
position be the left edge of the inline box.</dd>
Expand All @@ -19572,14 +19578,12 @@ notes on what would need to be defined for dashed lines:
title="">right</code></dt>
<dt> If <code
title="dom-context-2d-textAlign">textAlign</code> is <code
title="">end</code> and the 'direction'<!--XXXDIR--> property
on the <code>canvas</code> element has a computed value of
'ltr'</dt>
title="">end</code> and <span>the directionality<//span> of the
<code>canvas</code> element is 'ltr'</dt>
<dt> If <code
title="dom-context-2d-textAlign">textAlign</code> is <code
title="">start</code> and the 'direction'<!--XXXDIR--> property
on the <code>canvas</code> element has a computed value of
'rtl'</dt>
title="">start</code> and <span>the directionality<//span> of the
<code>canvas</code> element is 'rtl'</dt>

<dd>Let the <var title="">anchor point</var>'s horizontal
position be the right edge of the inline box.</dd>
Expand Down Expand Up @@ -19723,10 +19727,10 @@ been waiting now?)
<li><p>Form a <em class="big-issue">whatever CSS ends up calling
vertical line boxes and inline boxes</em> containing the text <var
title="">text</var>, with all the properties at their initial
values except the 'font' property of the inline element set to <var
values except the 'font' property of the inline box set to <var
title="">font</var> and the 'direction' property of the inline
element set to the 'direction' property of the <code>canvas</code>
element.</p></li><!- - XXXDIR - ->
box set to <span>the directionality<//span> of the <code>canvas</code>
element.</p></li>

<!- - if you insert a step here, make sure to adjust the next step's
final words - ->
Expand Down Expand Up @@ -19755,14 +19759,12 @@ been waiting now?)
title="">start</code></dt>
<dt> If <code
title="dom-context-2d-textAlign">textAlign</code> is <code
title="">left</code> and the 'direction'<!- -XXXDIR- -> property
on the <code>canvas</code> element has a computed value of
'ltr'</dt>
title="">left</code> and <span>the directionality<//span> of the
<code>canvas</code> element is 'ltr'</dt>
<dt> If <code
title="dom-context-2d-textAlign">textAlign</code> is <code
title="">right</code> and the 'direction'<!- -XXXDIR- -> property
on the <code>canvas</code> element has a computed value of
'rtl'</dt>
title="">right</code> and <span>the directionality<//span> of the
<code>canvas</code> element is 'rtl'</dt>

<dd>Let the <var title="">anchor point</var>'s vertical
position be the top edge of the <em class="big-issue">inline
Expand All @@ -19773,14 +19775,12 @@ been waiting now?)
title="">end</code></dt>
<dt> If <code
title="dom-context-2d-textAlign">textAlign</code> is <code
title="">right</code> and the 'direction'<!- -XXXDIR- -> property
on the <code>canvas</code> element has a computed value of
'ltr'</dt>
title="">right</code> and <span>the directionality<//span> of the
<code>canvas</code> element is 'ltr'</dt>
<dt> If <code
title="dom-context-2d-textAlign">textAlign</code> is <code
title="">left</code> and the 'direction'<!- -XXXDIR- -> property on
the <code>canvas</code> element has a computed value of
'rtl'</dt>
title="">left</code> and <span>the directionality<//span> of the
<code>canvas</code> element is 'rtl'</dt>

<dd>Let the <var title="">anchor point</var>'s vertical
position be the bottom edge of the <em class="big-issue">inline
Expand Down

0 comments on commit c73d038

Please sign in to comment.