<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>18339</bug_id>
          
          <creation_ts>2012-07-20 00:44:53 +0000</creation_ts>
          <short_desc>When the parent element is not an HTML element, what directionality is inherited?</short_desc>
          <delta_ts>2012-10-31 23:28:47 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#the-dir-attribute</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>aharon.lists.lanin</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>fantasai.bugs</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-i18n-bidi</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71194</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-20 00:44:53 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html
Multipage: http://www.whatwg.org/C#the-dir-attribute
Complete: http://www.whatwg.org/c#the-dir-attribute

Comment:
When the parent element is not an HTML element, the directionality of the
child should default to LTR

Posted from: 66.207.208.98 by bzbarsky@mit.edu
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/17.0 Firefox/17.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71195</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-07-20 00:45:28 +0000</bug_when>
    <thetext>Unless, of course, the spec defines directionality as a binary thing on all elements, not just HTML elements.  In which case it might be good to explicitly call that out.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71435</commentid>
    <comment_count>2</comment_count>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2012-07-25 06:47:01 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Unless, of course, the spec defines directionality as a binary thing on all
&gt; elements, not just HTML elements.  In which case it might be good to explicitly
&gt; call that out.

I think directionality should work the same regardless of whether an element is defined in HTML or not. Making it do something different (e.g. defaulting to LTR for the element or its children) would break existing pages. Even if there were no existing RTL pages using non-HTML elements (which there certainly are), I do not see any utility in making the directionality of non-HTML elements work differently.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71460</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-07-25 17:02:11 +0000</bug_when>
    <thetext>I would be fine with that, personally, as comment 1 says.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72749</commentid>
    <comment_count>4</comment_count>
    <who name="fantasai">fantasai.bugs</who>
    <bug_when>2012-08-25 01:13:34 +0000</bug_when>
    <thetext>So the bug here isn&apos;t &quot;When the parent element is not an HTML element, the directionality of the child should default to LTR.&quot;, it&apos;s &quot;HTML doesn&apos;t define what happens when the parent of an element is not an HTML element&quot;.

An element can have
  - LTR directionality
  - RTL directionality
  - no directionality
http://www.w3.org/TR/selectors4/#the-dir-pseudo

There are various possibilities, here are the three I can think of:

  - All elements, whether they are HTML or not, have a directionality.

  - Non-HTML elements do not have a directionality, but directionality
    inherits through them. (This would be represented by two binary
    states: whether the element is LTR or RTL, and whether the element
    has a directionality or no.)

  - As bz proposed, HTML children of elements without a directionality
    inherit LTR.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72819</commentid>
    <comment_count>5</comment_count>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2012-08-27 15:11:44 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; An element can have
&gt;   - LTR directionality
&gt;   - RTL directionality
&gt;   - no directionality
&gt; http://www.w3.org/TR/selectors4/#the-dir-pseudo

I do not see where the link above or the current HTML5 spec say that an element can have no directionality. As far as I understand, it is always either LTR or RTL.

&gt; 
&gt; There are various possibilities, here are the three I can think of:
&gt; 
&gt;   - All elements, whether they are HTML or not, have a directionality.

And, presumably, it is inherited from the parent if not set through an explicit dir attribute. This seems like the obvious approach to me.

&gt; 
&gt;   - Non-HTML elements do not have a directionality, but directionality
&gt;     inherits through them. (This would be represented by two binary
&gt;     states: whether the element is LTR or RTL, and whether the element
&gt;     has a directionality or no.)

What would be the utility of having such a fine distinction?

&gt; 
&gt;   - As bz proposed, HTML children of elements without a directionality
&gt;     inherit LTR.

But this would break current RTL pages that use non-HTML elements. And it would mean that, by default, the children would have LTR directionality but RTL direction (when the grandfather is RTL). Seems like a big mess to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72820</commentid>
    <comment_count>6</comment_count>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2012-08-27 15:49:26 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt;   - As bz proposed, HTML children of elements without a directionality
&gt; &gt;     inherit LTR.
&gt; 
&gt; But this would break current RTL pages that use non-HTML elements. And it would
&gt; mean that, by default, the children would have LTR directionality but RTL
&gt; direction (when the grandfather is RTL). Seems like a big mess to me.


Sorry, the connector should have been &quot;Or&quot;, not &quot;And&quot;. That is, let&apos;s say that we decide that the span in

&lt;div dir=&quot;rtl&quot;&gt;&lt;foo&gt;&lt;span&gt;...&lt;/span&gt;&lt;/foo&gt;&lt;/div&gt;

should have LTR directionality. If, in the absence of custom CSS rules, it simultaneously gets direction:rtl, we have a mess, and if it has direction:ltr, we have a lack of backward compatibility.

And I still do not understand the rationale for this proposal.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77613</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-10-31 23:28:35 +0000</bug_when>
    <thetext>As far as I can tell, this was already defined. However, I&apos;ve tried to make it clearer. Let me know if it&apos;s still ambiguous or if I missed the point here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77614</commentid>
    <comment_count>8</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-10-31 23:28:47 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7495.
Check-in comment: Clarify that &apos;directionality&apos; applies to all elements.
http://html5.org/tools/web-apps-tracker?from=7494&amp;to=7495</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>