<?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>18340</bug_id>
          
          <creation_ts>2012-07-20 00:51:34 +0000</creation_ts>
          <short_desc>The root element&apos;s directionality should be a UA-specific value</short_desc>
          <delta_ts>2013-06-04 22:17:46 +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>WONTFIX</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>addison</cc>
    
    <cc>aharon.lists.lanin</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>ehsan</cc>
    
    <cc>fantasai.bugs</cc>
    
    <cc>ian</cc>
    
    <cc>ishida</cc>
    
    <cc>mike</cc>
    
    <cc>public-i18n-bidi</cc>
    
    <cc>smontagu</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71196</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-20 00:51:34 +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:
The root element&apos;s directionality should be a UA-specific value

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>71197</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-07-20 00:52:41 +0000</bug_when>
    <thetext>In particular, if dir is not set on the root, UAs currently allow user control (and in fact might have different per-locale defaults) for the directionality of the root.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71434</commentid>
    <comment_count>2</comment_count>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2012-07-25 06:40:02 +0000</bug_when>
    <thetext>The request makes no sense to me. Any given page is designed to be viewed on a particular direction. If viewed in the other direction, it is usually badly broken. It just makes no sense to view Hebrew text in LTR or English text in RTL. For example, please try:

data:text/html,&lt;html dir=ltr&gt;&lt;div&gt;Hello, world!&lt;/div&gt;&lt;input type=&quot;radio&quot;&gt;Left&amp;nbsp;&amp;nbsp;&lt;input type=&quot;radio&quot;&gt;Center&amp;nbsp;&amp;nbsp;&lt;input type=&quot;radio&quot;&gt;Right&lt;/div&gt;&lt;/html&gt;

and

data:text/html,&lt;html dir=rtl&gt;&lt;div&gt;Hello, world!&lt;/div&gt;&lt;input type=&quot;radio&quot;&gt;Left&amp;nbsp;&amp;nbsp;&lt;input type=&quot;radio&quot;&gt;Center&amp;nbsp;&amp;nbsp;&lt;input type=&quot;radio&quot;&gt;Right&lt;/div&gt;&lt;/html&gt;

99%+ of the pages on the internet do not specify a dir on their root element but will only appear as intended in LTR. A UA that displays them some other default will simply display them broken.

The concept of UA-specific default direction just makes no sense.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71459</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-07-25 17:01:21 +0000</bug_when>
    <thetext>I&apos;m just passing on what Simon told me: that apparently in some of our locales web pages overwhelmingly do not declare directionality and work best when rendered in RTL....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71463</commentid>
    <comment_count>4</comment_count>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2012-07-25 19:09:46 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; I&apos;m just passing on what Simon told me: that apparently in some of our locales
&gt; web pages overwhelmingly do not declare directionality and work best when
&gt; rendered in RTL....

I would certainly like to get more details. If these documents work best when rendered RTL, does that mean that current UAs all display then not-at-their-best, i.e. broken? And that UAs with the LTR default will still display them that way after the proposed change? Do we have examples of such documents?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71464</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-07-25 19:13:22 +0000</bug_when>
    <thetext>Firefox doesn&apos;t always default to LTR today, is the point.  It&apos;s a user preference.  I was told that some locales set it to RTL by default, though I&apos;m having a hard time finding evidence of this...  You really want to talk to Simon here; I&apos;m just the one with the bugzilla account.  :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71472</commentid>
    <comment_count>6</comment_count>
    <who name="Ehsan Akhgari [:ehsan]">ehsan</who>
    <bug_when>2012-07-25 21:55:03 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; Firefox doesn&apos;t always default to LTR today, is the point.  It&apos;s a user
&gt; preference.  I was told that some locales set it to RTL by default, though I&apos;m
&gt; having a hard time finding evidence of this...

I&apos;m pretty sure that we don&apos;t do this for content.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71473</commentid>
    <comment_count>7</comment_count>
    <who name="Ehsan Akhgari [:ehsan]">ehsan</who>
    <bug_when>2012-07-25 21:55:28 +0000</bug_when>
    <thetext>Also I&apos;m going to ask Simon what he meant here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75104</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-10-02 19:46:38 +0000</bug_when>
    <thetext>bz: Which locales are these? (I&apos;d like to test it but don&apos;t want to download six zillion builds until I find one like this...)

If we do end up having to do this, we should probably enumerate the doomed locales in the same way as we enumerate which locales should default to which encodings.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75105</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-10-02 19:47:07 +0000</bug_when>
    <thetext>bz: (also useful to know would be which sites are affected)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78801</commentid>
    <comment_count>10</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-11-26 04:45:58 +0000</bug_when>
    <thetext>Again, you want to talk to Simon Montagu, not me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82615</commentid>
    <comment_count>11</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-02-06 01:32:12 +0000</bug_when>
    <thetext>smontagu: Do you have any insights on the topic here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85064</commentid>
    <comment_count>12</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-03-27 22:33:12 +0000</bug_when>
    <thetext>My attempts at contacting Simon (both here, on IRC, and by e-mail) have failed.

Right now this bug is asking for a controversial change based on basically hearsay. Which isn&apos;t to say that I don&apos;t trust bz or Simon, quite the opposite in fact, but generally we rely on more than just a second-hand report of something to make a controversial change. I call it controversial because there is some disagreement about whether it should happen (q.v. comment 2).

Before I can make a call one way or the other, we either need to study what popular user agents do in the main RTL locales. By &quot;popular&quot; I mean that they have a double-digit market share in those locales specifically.

The two big RTL scripts I know about are Arabic and Hebrew.

Arabic&apos;s largest country seems to be Egypt. IE, Firefox, and Chrome have significant market share in those countries.

Hebrew&apos;s largest country seems to be Israel. The same browsers are popular there.

To test for default directionality, I would use this demo file:
   http://damowmow.com/playground/demos/bidi/002.html

To perform a test, one would need to install an OS native to the Israel or Egypt locales without changing its default settings, and one would then need to download and install a browser for that OS without changing its settings, and finally one would need to visit that URL and determine if the box, list item bullet, and punctuation appear on the right or left of the page.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85123</commentid>
    <comment_count>13</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-03-28 20:09:35 +0000</bug_when>
    <thetext>I got screenshots of Safari and Chrome on a Hebrew-language Mac OS X, and they seem to default that page to ltr. Still investigating...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85773</commentid>
    <comment_count>14</comment_count>
    <who name="Simon Montagu">smontagu</who>
    <bug_when>2013-04-09 06:21:08 +0000</bug_when>
    <thetext>Sorry to have taken so long to comment here.

I don&apos;t know of any localization of Firefox that uses the option to change the default document direction, although the possibility does exist in theory.

I think comment 3 goes beyond what I said about this, especially the part about &quot;overwhelmingly&quot;.

At the other extreme, I think the &quot;99%+ of the pages on the internet&quot; in comment 2 is a great exaggeration. I see pages almost every day that don&apos;t use the dir attribute properly and I need to switch the document direction to read them comfortably, for example http://www.soulandgone.com/

Am I right in thinking that the controversial part here is the configurable default, and having UI to change the document direction on the fly is not controversial?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85825</commentid>
    <comment_count>15</comment_count>
    <who name="Simon Montagu">smontagu</who>
    <bug_when>2013-04-09 19:49:03 +0000</bug_when>
    <thetext>IE on a Hebrew version of Windows XP seems to display http://damowmow.com/playground/demos/bidi/002.html left-to-right. (I can&apos;t be sure which, if any, settings have been modified on the computer I tested on).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85860</commentid>
    <comment_count>16</comment_count>
    <who name="Richard Ishida">ishida</who>
    <bug_when>2013-04-10 11:53:13 +0000</bug_when>
    <thetext>(In reply to comment #14)
&gt; I see pages almost every day that don&apos;t
&gt; use the dir attribute properly and I need to switch the document direction
&gt; to read them comfortably, for example http://www.soulandgone.com/

Either I&apos;m missing something here, or that&apos;s not a good example at all.  

The soulandgone page is clearly a page that is designed to be LTR by default, with some embedded Hebrew text. It&apos;s true that the author has omitted to use dir on the Hebrew text, so things like punctuation are incorrectly aligned, but changing the default direction of the page to RTL will break all the Latin text (which is by far the majority of the text on the page) as well as probably messing up the page layout. 

If a browser automatically switches the default direction of the root of a page to RTL any time it contains some embedded Hebrew text, then it would create chaos.

At most, what might be useful for this page is a feature that detects RTL elements based on content and applies a dir to them - but I&apos;m not sure how easy or reliable such a feature could be.

This author must surely know that the Hebrew looks wierd, but apparently hasn&apos;t bothered to do anything about it (the fix isn&apos;t rocket science) - I&apos;m not sure we should force that upon them.

I think the best solution for this bug is to make it easier for people to find educational stuff that tells them how to do bidi text correctly (such as http://www.w3.org/International/tutorials/new-bidi-xhtml/Overview-inline.en.php).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85952</commentid>
    <comment_count>17</comment_count>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2013-04-11 17:24:33 +0000</bug_when>
    <thetext>I agree with Richard about soulandgone.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85955</commentid>
    <comment_count>18</comment_count>
    <who name="Addison Phillips">addison</who>
    <bug_when>2013-04-11 18:22:10 +0000</bug_when>
    <thetext>I was actioned by the I18N WG [1] with replying to this bug and saying: we think that allowing the root element&apos;s directionality to be UA specific is a very Bad Idea. This would cause Web pages to display differently depending on UA or on the UA&apos;s current runtime locale, particularly the (more common) left-to-right pages that do no declare directionality anywhere. Having a default direction is a much better user experience and authors have a well-documented feature for right-to-left content.


[1] http://www.w3.org/2013/04/11-i18n-minutes.html#item05
[2] I18N-ACTION-207</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86645</commentid>
    <comment_count>19</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-24 00:06:07 +0000</bug_when>
    <thetext>Thanks for all the comments above.

If all browsers default to ltr (and that seems to be the case — I&apos;m not aware of any browser in any locale that defaults to rtl in cases where the page doesn&apos;t specify the directionality), then I really don&apos;t think it makes sense for a UA to be able to default to rtl.

As far as UI goes, a browser is naturally allowed to offer UI that causes the UA to subsequently violate the specifications; whether this be an &quot;inspect element&quot; debugging UI that allows the user to specify dir=rtl on the root element or whether it&apos;s a button in a toolbar that does the same thing, is outside the scope of the spec.

Which is to say, I think this should be WONTFIX based on the above info.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>