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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>70373</bug_id>
          
          <creation_ts>2011-10-18 15:46:20 -0700</creation_ts>
          <short_desc>Putting a dir attribute on a bdi element makes it lose isolation</short_desc>
          <delta_ts>2011-11-28 11:22:26 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>63903</dependson>
          <blocked>50910</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Aharon (Vladimir) Lanin">aharon</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aharon</cc>
    
    <cc>amir.aharoni</cc>
    
    <cc>eric</cc>
    
    <cc>leviw</cc>
    
    <cc>playmobil</cc>
    
    <cc>rniwa</cc>
    
    <cc>shanestephens</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>486367</commentid>
    <comment_count>0</comment_count>
    <who name="Aharon (Vladimir) Lanin">aharon</who>
    <bug_when>2011-10-18 15:46:20 -0700</bug_when>
    <thetext>This is true whether you say dir=ltr, dir=rtl, or even dir=auto (even though dir=auto is in fact supposed to imply isolation on any element - see https://bugs.webkit.org/show_bug.cgi?id=63903). Please note that &lt;bdi dir=&quot;ltr|rtl&quot;&gt; is very useful - IMO, it should replace &lt;span dir=&quot;ltr|rtl&quot;&gt; as the usual way of indicating an inline direction change: isolation extremely rarely hurts, and is often quite necessary. This is bad enough, but given that &lt;bdi&gt; currently does not have dir=auto by default (https://bugs.webkit.org/show_bug.cgi?id=68773), &lt;bdi&gt; is currently completely broken.

The bug is due to the current default stylesheet, which says that specifying a dir attribute sets unicode-bidi to embed. This is incorrect in HTML5, i.e. http://dev.w3.org/html5/spec/Overview.html#bidirectional-text, which says that the default stylesheet should go like this:

:dir(ltr) { direction: ltr; }
:dir(rtl) { direction: rtl; }
[dir] { unicode-bidi: embed; }
bdi, bdi[dir], output, output[dir], [dir=auto i] { unicode-bidi: isolate; }
bdo, bdo[dir] { unicode-bidi: bidi-override; }
bdo[dir=auto i] { unicode-bidi: bidi-override isolate; }
textarea[dir=auto i], pre[dir=auto i] { unicode-bidi: plaintext; }

Implementing this trivial fix would also fix https://bugs.webkit.org/show_bug.cgi?id=63903.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>489999</commentid>
    <comment_count>1</comment_count>
    <who name="Aharon (Vladimir) Lanin">aharon</who>
    <bug_when>2011-10-25 06:29:38 -0700</bug_when>
    <thetext>It would have been better if I had left out the first two lines I quoted from the HTML5 spec re the default stylesheet. They set direction, and not unicode-bidi, and are irrelevant to the bug. Furthermore, they make use of the :dir() pseudo-class, which has not been implemented yet (as far as I know); I am guessing that the direction property currently gets set by means other than the default stylesheet. In any case, the relevant lines from the HTML5 spec are:

[dir] { unicode-bidi: embed; }
bdi, bdi[dir], output, output[dir], [dir=auto i] { unicode-bidi: isolate; }
bdo, bdo[dir] { unicode-bidi: bidi-override; }
bdo[dir=auto i] { unicode-bidi: bidi-override isolate; }
textarea[dir=auto i], pre[dir=auto i] { unicode-bidi: plaintext; }

I expect that some of these, e.g. the last one, are already in the default stylesheet. The rest need to go in, and the order is important.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>509998</commentid>
    <comment_count>2</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-11-28 11:21:57 -0800</bug_when>
    <thetext>Fixed in http://trac.webkit.org/changeset/101268.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>