<?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>62664</bug_id>
          
          <creation_ts>2011-06-14 14:45:37 -0700</creation_ts>
          <short_desc>webkit-box-direction: reverse tab order</short_desc>
          <delta_ts>2011-11-08 14:49:33 -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>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</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>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Greg Billock">gbillock</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aboxhall</cc>
    
    <cc>dglazkov</cc>
    
    <cc>estade</cc>
    
    <cc>hyatt</cc>
    
    <cc>ojan</cc>
    
    <cc>shanestephens</cc>
    
    <cc>tony</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>420739</commentid>
    <comment_count>0</comment_count>
      <attachid>97168</attachid>
    <who name="Greg Billock">gbillock</who>
    <bug_when>2011-06-14 14:45:37 -0700</bug_when>
    <thetext>Created attachment 97168
Reduction of -webkit-box-direction: reverse tab order bug

Using a reversed direction style such as:

.class {
  -webkit-box-direction: reverse;
}

the tab order of the elements in the box don&apos;t reverse. See attachment HTML for an example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420743</commentid>
    <comment_count>1</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-06-14 14:52:39 -0700</bug_when>
    <thetext>It looks like it was never implemented, although there&apos;s code to parse it.  RenderStyle.h also seems to be aware of it (EBoxDirection), but there&apos;s no code that uses it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>421741</commentid>
    <comment_count>2</comment_count>
    <who name="Alice Boxhall">aboxhall</who>
    <bug_when>2011-06-15 20:46:44 -0700</bug_when>
    <thetext>This appear to work on Chrome 13.0.782.20 dev (WebKit r87771) and WebKit Nightly r88920 -- at least, tabbing through hits the elements in the order suggested by the text.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>422001</commentid>
    <comment_count>3</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-06-16 09:45:10 -0700</bug_when>
    <thetext>Oh, sorry, I missed the use of boxDirection() in Render(Deprecated)FlexibleBox.cpp.

Greg, what order do you expect to tab through the buttons?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>422077</commentid>
    <comment_count>4</comment_count>
    <who name="Greg Billock">gbillock</who>
    <bug_when>2011-06-16 11:04:39 -0700</bug_when>
    <thetext>I&apos;d expect tab order to be reverse in the box-direction: reverse case. That is, for tab order to move from top to bottom and left to right. (Or rtl if that&apos;s set.)

That is, instead of going in appearance order, when the box is layout-reversed, tab order within that box would go in reverse appearance order as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>422081</commentid>
    <comment_count>5</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-06-16 11:09:29 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; I&apos;d expect tab order to be reverse in the box-direction: reverse case. That is, for tab order to move from top to bottom and left to right. (Or rtl if that&apos;s set.)
&gt; 
&gt; That is, instead of going in appearance order, when the box is layout-reversed, tab order within that box would go in reverse appearance order as well.

In your test case, you expect tabbing to hit the elements in the order suggested by the text?  That&apos;s the behavior that Alice and I are seeing.

Can you include your chrome and webkit version (in about:version)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>425948</commentid>
    <comment_count>6</comment_count>
    <who name="Shane Stephens">shanestephens</who>
    <bug_when>2011-06-22 21:52:21 -0700</bug_when>
    <thetext>Verified working in Chrome 12, Chrome 14 and WebKit nightly on OSX. I&apos;m going to close this bug - Greg if you can still repro, please reopen the bug and include your browser version and operating system.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>426233</commentid>
    <comment_count>7</comment_count>
    <who name="Greg Billock">gbillock</who>
    <bug_when>2011-06-23 09:43:47 -0700</bug_when>
    <thetext>I think I misunderstood your reply. What I&apos;d expect is that the tab order follows the visual layout, not the appearance in the HTML file. So if the layout is reversed, the tab order would reverse. What I see is that the tab order always follows the HTML appearance order, regardless of box-direction.

Assuming the use case for box-direction is to account for platform default mimicry and RTL type issues, I think tab order reversal is a good expectation here. Are there use cases where it is a poor expectation?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>426261</commentid>
    <comment_count>8</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-06-23 10:16:20 -0700</bug_when>
    <thetext>What&apos;s the tab order in IE10 platform preview and Firefox?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>426601</commentid>
    <comment_count>9</comment_count>
    <who name="Shane Stephens">shanestephens</who>
    <bug_when>2011-06-23 16:26:28 -0700</bug_when>
    <thetext>To be completely specific: on Chrome 12, Chrome 14 and WebKit nightly on OSX I observe that the tab order traverses all of the buttons in your reduction in number order - i.e. &quot;First&quot;, then &quot;Second&quot;, then &quot;Third&quot;, then &quot;Fourth&quot;, etc.

Is that the order you expect to see?  Or do you expect to see &quot;First&quot;, then &quot;Fourth&quot;, then &quot;Third&quot;, then &quot;Second&quot;?

FWIW the specification leaves it up to the platform to define tab order in the absence of a author-provided tabindex value (see http://dev.w3.org/html5/spec/Overview.html#sequential-focus-navigation-and-the-tabindex-attribute), so either behavior could be judged correct :)

If you think that number order is correct but you&apos;re seeing the reverse somewhere, please provide your browser version and OS so we can try to repro.

If you think that number order is incorrect, probably the best thing to do is send an email to webkit-dev explaining why the alternative is better, and we&apos;ll wait for the outcome of that discussion before changing the current coded behavior. On the other hand, if your specification-fu is better than mine and you&apos;ve found some indication that number order is incorrect, then reopen this bug and provide a link to the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>428395</commentid>
    <comment_count>10</comment_count>
    <who name="Greg Billock">gbillock</who>
    <bug_when>2011-06-27 15:44:17 -0700</bug_when>
    <thetext>Yes, I&apos;d expect tab order to be &quot;First&quot; &quot;Fourth&quot; &quot;Third&quot; &quot;Second&quot; &quot;Fifth&quot; &quot;Eighth&quot; &quot;Seventh&quot; &quot;Sixth&quot; &quot;Ninth&quot;. (Seen in Chrome 13 and head and I suspect all other webkit-based browsers.)

That is, I&apos;d expect the tab order to reflect the display order rather than HTML order. That said, I agree with you that the spec leaves this open and it isn&apos;t immediately obvious what to do. On the other hand, tabindex is fraught and usually better left alone, and my intuition here is informed by the context: the box-direction isn&apos;t impacting the tab ordering as it seems it should. Which is to say, my intuition is that if the layout reverses because of this markup, then the browser-picked tab ordering ought to reverse as well (absent any tabindex, which ought to dominate).

I&apos;ll email webkit-dev as you suggest. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>497715</commentid>
    <comment_count>11</comment_count>
    <who name="Evan Stade">estade</who>
    <bug_when>2011-11-07 21:19:58 -0800</bug_when>
    <thetext>ping on this. It&apos;s causing pain in chrome:// pages.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>498135</commentid>
    <comment_count>12</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-11-08 09:22:21 -0800</bug_when>
    <thetext>(In reply to comment #11)
&gt; ping on this. It&apos;s causing pain in chrome:// pages.

I think this is working as intended.  Other CSS properties that change the visual layout don&apos;t change the tab order (e.g., if I use a float or position: absolute).

We could maybe change this for new flexbox, but that feels like a hack since it would only apply to new flexbox.  I.e., we should try to come up with a good CSS solution for tab ordering that applies to all elements instead of just flexbox.

Can you use tabindex or javascript instead?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>498269</commentid>
    <comment_count>13</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-11-08 11:08:32 -0800</bug_when>
    <thetext>The suggested generic solution to this problem: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-November/033775.html.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>498447</commentid>
    <comment_count>14</comment_count>
    <who name="Evan Stade">estade</who>
    <bug_when>2011-11-08 14:49:33 -0800</bug_when>
    <thetext>when using -webkit-box-direction: reverse, the author&apos;s intended tab order would be to match the visual appearance approximately 99.8% of the time. It defeats the purpose of having -webkit-box-direction if it doesn&apos;t work properly, indeed for chrome://settings we have used javascript to hack around this and we don&apos;t use the property at all. However doing this for every reversible set of widgets on every chrome:// page (or more generically, on every page on the web) is unwieldy and, in practice, just doesn&apos;t happen because this problem is likely to go unnoticed.

Ojan&apos;s generic solution is nice (also reminiscent of the latest xkcd), but again, it&apos;s a lot of extra work when you consider it&apos;s something you want every single time. However his suggestion would likely solve the tangential problem that it&apos;s impossible to make a hierarchy of divs unfocusable by changing the tabindex of its root.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>97168</attachid>
            <date>2011-06-14 14:45:37 -0700</date>
            <delta_ts>2011-06-14 14:45:37 -0700</delta_ts>
            <desc>Reduction of -webkit-box-direction: reverse tab order bug</desc>
            <filename>wkbd.html</filename>
            <type>text/html</type>
            <size>1351</size>
            <attacher name="Greg Billock">gbillock</attacher>
            
              <data encoding="base64">PGh0bWw+CiAgPGhlYWQ+CiAgICA8dGl0bGU+d2Via2l0LWJveC1kaXJlY3Rpb24gcmV2ZXJzZSB0
YWIgb3JkZXI8L3RpdGxlPgogICAgPHN0eWxlPgogICAgICBkaXYgewogICAgICAgIGRpc3BsYXk6
IC13ZWJraXQtYm94OwogICAgICAgIHBhZGRpbmc6IDJweDsKICAgICAgICBib3JkZXI6IDFweCBz
b2xpZCBncmF5OwogICAgICAgIG1hcmdpbjogMXB4OwogICAgICAgIHdpZHRoOiA1MCU7CiAgICAg
ICAgYmFja2dyb3VuZC1jb2xvcjogI2VlZWVlZTsKICAgICAgfQogICAgICAub3V0ZXIgewogICAg
ICAgIC13ZWJraXQtYm94LW9yaWVudDogdmVydGljYWw7CiAgICAgIH0KICAgICAgLnR3byB7CiAg
ICAgICAgLXdlYmtpdC1ib3gtZGlyZWN0aW9uOiByZXZlcnNlOwogICAgICAgIC13ZWJraXQtYm94
LW9yaWVudDogdmVydGljYWw7CiAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogeWVsbG93OwogICAg
ICB9CiAgICAgIC5mb3VyIHsKICAgICAgICAtd2Via2l0LWJveC1kaXJlY3Rpb246IHJldmVyc2U7
CiAgICAgICAgLXdlYmtpdC1ib3gtb3JpZW50OiBob3Jpem9udGFsOwogICAgICAgIGJhY2tncm91
bmQtY29sb3I6IHllbGxvdzsKICAgICAgfQogICAgICBidXR0b24gewogICAgICAgIGRpc3BsYXk6
IGJsb2NrOwogICAgICB9CiAgICA8L3N0eWxlPgogICAgPGJvZHk+CiAgICAgIDxoMT53ZWJraXQt
Ym94LWRpcmVjdGlvbjogcmV2ZXJzZSB0YWIgb3JkZXIgdGVzdDwvaDE+CiAgICAgIDxkaXYgY2xh
c3M9Im91dGVyIj4KICAgICAgICA8ZGl2IGNsYXNzPSJvbmUiPjxidXR0b24gaWQ9Im9uZSI+Rmly
c3Q8L2J1dHRvbj48L2Rpdj4KICAgICAgICA8ZGl2IGNsYXNzPSJ0d28iPgogICAgICAgICAgPGJ1
dHRvbiBpZD0idHdvIj5TZWNvbmQ8L2J1dHRvbj4KICAgICAgICAgIDxidXR0b24gaWQ9InRocmVl
Ij5UaGlyZDwvYnV0dG9uPgogICAgICAgICAgPGJ1dHRvbiBpZD0iZm91ciI+Rm91cnRoPC9idXR0
b24+CiAgICAgICAgPC9kaXY+CiAgICAgICAgPGRpdiBjbGFzcz0idGhyZWUiPjxidXR0b24gaWQ9
ImZpdmUiPkZpZnRoPC9idXR0b24+PC9kaXY+CiAgICAgICAgPGRpdiBjbGFzcz0iZm91ciI+CiAg
ICAgICAgICA8YnV0dG9uIGlkPSJ0d28iPlNpeHRoPC9idXR0b24+CiAgICAgICAgICA8YnV0dG9u
IGlkPSJ0aHJlZSI+U2V2ZW50aDwvYnV0dG9uPgogICAgICAgICAgPGJ1dHRvbiBpZD0iZm91ciI+
RWlndGg8L2J1dHRvbj4KICAgICAgICA8L2Rpdj4KICAgICAgICA8ZGl2IGNsYXNzPSJmaXZlIj4K
ICAgICAgICAgIDxidXR0b24gaWQ9Im5pbmUiPk5pbnRoPC9idXR0b24+PC9kaXY+CiAgICAgICAg
PC9kaXY+CiAgICAgIDwvZGl2PgogICAgPC9ib2R5Pgo8L2h0bWw+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>