<?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>10821</bug_id>
          
          <creation_ts>2010-09-29 12:58:34 +0000</creation_ts>
          <short_desc>i18n comment 17 : setting input and textarea element direction through browser UI should set the dir attribute and trigger oninput event</short_desc>
          <delta_ts>2011-01-22 20:35:56 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>pre-LC1 HTML5 spec (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</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>10809</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="i18n bidi group">public-i18n-bidi</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>adrianba</cc>
    
    <cc>aharon.lists.lanin</cc>
    
    <cc>annevk</cc>
    
    <cc>ap</cc>
    
    <cc>ayg</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>ehsan</cc>
    
    <cc>eric</cc>
    
    <cc>fantasai.bugs</cc>
    
    <cc>ian</cc>
    
    <cc>jonas</cc>
    
    <cc>lachlan.hunt</cc>
    
    <cc>mike</cc>
    
    <cc>mjs</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>public-i18n-bidi</cc>
    
    <cc>roc</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>39951</commentid>
    <comment_count>0</comment_count>
    <who name="i18n bidi group">public-i18n-bidi</who>
    <bug_when>2010-09-29 12:58:34 +0000</bug_when>
    <thetext>Comment from the i18n review of:
http://dev.w3.org/html5/spec/

Comment 17
At http://www.w3.org/International/reviews/html5-bidi/
Editorial/substantive: S
Tracked by: AL

Location in reviewed document:
undefined [http://dev.w3.org/html5/spec/spec.html#contents]

Comment:This is a part of the proposals made by the &quot;Additional Requirements for Bidi in HTML&quot; W3C First Public Working Draft. For a full description of the use cases, please see 
http://www.w3.org/International/docs/html-bidi-requirements/#set-direction [http://www.w3.org/International/docs/html-bidi-requirements/#set-direction]
. Here is the proposal made there:

The HTML specification should state that when the user agent user interface allows the user to set the direction of &lt;input&gt; and &lt;textarea&gt; elements, it will:

- Set the element&apos;s dir attribute value accordingly.

- Trigger the oninput event after the dir attribute has been set. Even though no actual input took place, the user changed the recommended interpretation of the input already collected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40812</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-10-07 21:34:43 +0000</bug_when>
    <thetext>Regarding the first issue, setting the &quot;dir&quot; attribute:

- Do any implementations do this?

- If not:
    - What problem does doing this solve?
    -  What do implementations currently do instead?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40831</commentid>
    <comment_count>2</comment_count>
    <who name="Ehsan Akhgari [:ehsan]">ehsan</who>
    <bug_when>2010-10-08 02:32:47 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Regarding the first issue, setting the &quot;dir&quot; attribute:
&gt; 
&gt; - Do any implementations do this?

Not yet, to the best of my knowledge.

&gt; - If not:
&gt;     - What problem does doing this solve?

See below please.

&gt;     -  What do implementations currently do instead?

Gecko sets the dir attribute on an internal DIV element which it uses to render the input/textarea contents.  This DIV element is not exposed to the web page DOM, and is entirely inaccessible to the page.

One problem, for example, is that if the page uses the dir attribute to switch the input/textarea direction, this will override what the page specify, and there will be no way for the web page to toggle the direction once the user uses the browser UI provided mechanism for switching text direction.

Another problem is that without the dir attribute set on the input/textarea element, the page does not have any way to determine the real direction of the element, and any script which relies on this knowledge will malfunction.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41045</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-10-12 09:47:35 +0000</bug_when>
    <thetext>What would you recommend in the case where a &lt;textarea&gt; has two paragraphs, and the user sets different directionality for each paragraph?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41231</commentid>
    <comment_count>4</comment_count>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2010-10-13 15:22:54 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; What would you recommend in the case where a &lt;textarea&gt; has two paragraphs, and
&gt; the user sets different directionality for each paragraph?

As currently proposed, the direction of the textarea of the whole would be set, and thus that of all its paragraphs, not an individual paragraph. Thus, we would not treat a textarea any differently from (a single-line) input.

It is not perfect, but I do not like adding control characters to the current paragraph, and there is nothing else.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41247</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-10-13 18:17:27 +0000</bug_when>
    <thetext>&gt; It is not perfect, but I do not like adding control characters to the current
&gt; paragraph

Why not?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41392</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-10-15 00:14:14 +0000</bug_when>
    <thetext>Whatever we do here it should probably work closely with the solution we come up with for telling the server what the direction was when the textarea or text field is submitted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41498</commentid>
    <comment_count>7</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2010-10-18 18:46:56 +0000</bug_when>
    <thetext>Control characters are evil -- in normal text editors they&apos;re hard to type, impossible to see, and hard to delete even if you can find them.  They should be necessary as infrequently as possible.

It would be useful to have a concrete example of a script that would like to know when the user changes textarea/input directionality.  I can&apos;t think of one offhand.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41505</commentid>
    <comment_count>8</comment_count>
    <who name="Ehsan Akhgari [:ehsan]">ehsan</who>
    <bug_when>2010-10-18 21:44:32 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; It would be useful to have a concrete example of a script that would like to
&gt; know when the user changes textarea/input directionality.  I can&apos;t think of one
&gt; offhand.

A very common use case would be a webmail email client, which wants to generate the correct HTML version for an email typed in a textarea element by the user, possibly in the opposite direction as the base direction of the webmail client&apos;s web page.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41525</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-10-19 06:34:30 +0000</bug_when>
    <thetext>Can&apos;t it just autodetect the direction like the bidi algorithm says to?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41580</commentid>
    <comment_count>10</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2010-10-19 16:44:57 +0000</bug_when>
    <thetext>No, because maybe the user explicitly set the direction in a way that contradicts the Unicode bidi rules.  For instance, if the overall page direction is LTR and I type something in a field in RTL, that will be displayed LTR as I type it, which is weird if there&apos;s punctuation at the beginning or end:

Logical: HEBREW!
Correct display: !WERBEH
Actual display: WERBEH!

Thus I might use a keyboard shortcut like Ctrl-Shift-X in Firefox to switch direction.  (Although that actually seems to do something other than simply set dir=&quot;rtl&quot; -- it looks more like it sets dir=&quot;rtl&quot; only for paragraphs containing an RTL character, or something.)  This is information that could be useful to scripts, e.g., so that when the value is later output it can be given the correct direction, a la bug 10809.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41621</commentid>
    <comment_count>11</comment_count>
    <who name="Ehsan Akhgari [:ehsan]">ehsan</who>
    <bug_when>2010-10-20 23:30:28 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; (Although that actually seems to do something other than simply set
&gt; dir=&quot;rtl&quot; -- it looks more like it sets dir=&quot;rtl&quot; only for paragraphs
&gt; containing an RTL character, or something.)

FWIW, that keyboard shortcut sets the dir attribute on an internal &lt;div&gt; element used to display the contents of &lt;input&gt; and &lt;textarea&gt; elements.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41743</commentid>
    <comment_count>12</comment_count>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2010-10-26 02:22:29 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Regarding the first issue, setting the &quot;dir&quot; attribute:
&gt; 
&gt; - Do any implementations do this?

Yes, IE, Chrome, and Safari do. By &quot;set the dir attribute&quot; I mean that both element.dir and element.getAttribute(&apos;dir&apos;) now return the new value, either &apos;ltr&apos; or &apos;rtl&apos;.

Firefox and Opera, however, do not reflect the change of direction in the DOM as far as I can tell; element.dir and element.getAttribute(&apos;dir&apos;) remain unchanged.

Attaching an HTML file that demonstrates this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41744</commentid>
    <comment_count>13</comment_count>
      <attachid>928</attachid>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2010-10-26 02:24:05 +0000</bug_when>
    <thetext>Created attachment 928
Check whether your browser sets an input&apos;s dir when you change its direction.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41745</commentid>
    <comment_count>14</comment_count>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2010-10-26 02:25:57 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; What would you recommend in the case where a &lt;textarea&gt; has two paragraphs, and
&gt; the user sets different directionality for each paragraph?

No browser supports such an action. In all, setting the direction on a textarea acts on the whole textarea, i.e. all the paragraphs in it, not just the one in which the cursor may have been.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42012</commentid>
    <comment_count>15</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-11-03 08:14:14 +0000</bug_when>
    <thetext>Assuming we fix 10809 (i.e. given an opt-in, we expose the direction in the submitted data, and possibly in the textarea value as well), what use cases relevant to this bug would remain unaddressed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42015</commentid>
    <comment_count>16</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-11-03 08:27:53 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Did Not Understand Request
Change Description: no spec change
Rationale: See comment 15. Awaiting clear problem description.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42035</commentid>
    <comment_count>17</comment_count>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2010-11-03 14:54:47 +0000</bug_when>
    <thetext>(In reply to comment #15)
&gt; Assuming we fix 10809 (i.e. given an opt-in, we expose the direction in the
&gt; submitted data, and possibly in the textarea value as well), what use cases
&gt; relevant to this bug would remain unaddressed?

Scripts might want to do a lot more than just report the direction chosen by the user to the server!

Use case: Google Forms. The product uses the direction of the form&apos;s title for the direction of the form overall, e.g. whether the form should be left- or right-aligned. The title&apos;s direction is auto-estimated in scripts handling keyboard events on the title input. Thus, as soon as the user types RTL text into (the initially LTR) title input, the form, as seen in the (partially WYSISWYG) form editor, flips to RTL. This is long before anything is submitted to the server and thus before submitdir would have any utility.

Unfortunately, if the user sets the title&apos;s direction explicitly using the browser-provided method for doing so, this is invisible to the app&apos;s scripts in Firefox, Opera and Safari, so the app paradoxically can&apos;t set the form&apos;s direction in this &quot;obvious&quot; case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42073</commentid>
    <comment_count>18</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-11-03 18:56:33 +0000</bug_when>
    <thetext>The proposed solution for bug 10809 would expose the direction to script (it&apos;d be the first character of the value), so that use case seems like it&apos;d be handled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42087</commentid>
    <comment_count>19</comment_count>
    <who name="">contributor</who>
    <bug_when>2010-11-03 23:14:20 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r5668.
Check-in comment: Added example of select directionality issue
http://html5.org/tools/web-apps-tracker?from=5667&amp;to=5668</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42088</commentid>
    <comment_count>20</comment_count>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2010-11-03 23:42:03 +0000</bug_when>
    <thetext>(In reply to comment #19)
&gt; Checked in as WHATWG revision r5668.
&gt; Check-in comment: Added example of select directionality issue
&gt; http://html5.org/tools/web-apps-tracker?from=5667&amp;to=5668

I think that comment was meant to go in bug 10819.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42091</commentid>
    <comment_count>21</comment_count>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2010-11-03 23:49:48 +0000</bug_when>
    <thetext>(In reply to comment #18)
&gt; The proposed solution for bug 10809 would expose the direction to script (it&apos;d
&gt; be the first character of the value), so that use case seems like it&apos;d be
&gt; handled.

1. As you can see in the comments on bug 10809, I strenuously object to that proposed solution (wrapping the value in bidi formatting characters when the user sets the direction on an input or textarea element that has the submitdir attribute) on the grounds that bidi formatting characters are evil in an abundant variety of ways. If this is how submitdir worked, I would be the first to recommend not to use it.

2. As I keep pointing out in comments on bug 10809, you can&apos;t get the user-set direction just by checking the first character of the value. If the first character is indeed LRE or RLE, you would then still have to scan right through the whole string to make sure that its balancing PDF is the last character of the string. And no, you can&apos;t just look at the first and last character of the string, because the last character might be a PDF, but might not be the balancing PDF of the leading formatting character. Example: &quot;[RLE]JOE[PDF] would like to congratulate [RLE]SUSAN[PDF]&quot;. I think about one in five web developers who attempt to do this will get it right, and that&apos;s being optimistic.

3. The proposed solution does not address the current lack of interoperability, where some browsers set the input&apos;s dir attribute, and some don&apos;t - unless you are also proposing adding to the specification that the user&apos;s setting the direction should not set the dir attribute (regardless of whether submitdir is on). Is this something you really want to do?

4. All browsers change the effective alignment of the input when the user sets its direction. This is important visual feedback, and users expect it. If you propose to specify that the user setting the direction should not set the dir attribute, what justification is there for changing the effective alignment?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42105</commentid>
    <comment_count>22</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-11-04 07:20:57 +0000</bug_when>
    <thetext>(In reply to comment #21)
&gt; 1. As you can see in the comments on bug 10809, I strenuously object to that
&gt; proposed solution (wrapping the value in bidi formatting characters when the
&gt; user sets the direction on an input or textarea element that has the submitdir
&gt; attribute) on the grounds that bidi formatting characters are evil in an
&gt; abundant variety of ways. If this is how submitdir worked, I would be the first
&gt; to recommend not to use it.

The details of the solution to bug 10809 aren&apos;t important here; the point is that the information would be exposed to script one way or another, so the use case described above is possible to do with that solution in place.


&gt; 2. As I keep pointing out in comments on bug 10809, you can&apos;t get the user-set
&gt; direction just by checking the first character of the value. If the first
&gt; character is indeed LRE or RLE, you would then still have to scan right through
&gt; the whole string to make sure that its balancing PDF is the last character of
&gt; the string.

That&apos;s a discussion for that bug.


&gt; 3. The proposed solution does not address the current lack of interoperability,
&gt; where some browsers set the input&apos;s dir attribute, and some don&apos;t - unless you
&gt; are also proposing adding to the specification that the user&apos;s setting the
&gt; direction should not set the dir attribute (regardless of whether submitdir is
&gt; on). Is this something you really want to do?

I don&apos;t understand what this is is referring to. What browsers affect the DOM? Can you attach a test case showing the interoperability problem? Is that the problem this bug is trying to fix? If this is a separate issue, please file a separate bug for it.


&gt; 4. All browsers change the effective alignment of the input when the user sets
&gt; its direction. This is important visual feedback, and users expect it. If you
&gt; propose to specify that the user setting the direction should not set the dir
&gt; attribute, what justification is there for changing the effective alignment?

This doesn&apos;t seem related to this bug, which is (as far as I can tell) about scripts being able to tell what direction the user has picked, when the user picks it.

In any case, why would you need any justification? It&apos;s a form control, the browser could display it with characters alternating alignment every two seconds and it would still be conforming to the HTML spec. That&apos;s a presentational matter. HTML is by design presentation-agnostic.


Anyway. It seems like simply making sure that the data that is submitted for bug 10809 is also available in the DOM, and that events are fired when it changes, would resolve this bug, right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42143</commentid>
    <comment_count>23</comment_count>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2010-11-04 22:11:06 +0000</bug_when>
    <thetext>(In reply to comment #22)
&gt; (In reply to comment #21)
&gt; &gt; 3. The proposed solution does not address the current lack of interoperability,
&gt; &gt; where some browsers set the input&apos;s dir attribute, and some don&apos;t - unless you
&gt; &gt; are also proposing adding to the specification that the user&apos;s setting the
&gt; &gt; direction should not set the dir attribute (regardless of whether submitdir is
&gt; &gt; on). Is this something you really want to do?
&gt; 
&gt; I don&apos;t understand what this is is referring to. What browsers affect the DOM?

Please see comment 12.

&gt; Can you attach a test case showing the interoperability problem?

I already did, at the same time that I added comment 12.

&gt; Anyway. It seems like simply making sure that the data that is submitted for
&gt; bug 10809 is also available in the DOM, and that events are fired when it
&gt; changes, would resolve this bug, right?

Ok, if you can find some way to shoot those two birds with one stone, and the stone does not happen to be formatting characters. :-)

And I think I&apos;ll leave the interoperability problem up to you, too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42158</commentid>
    <comment_count>24</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-11-05 01:16:29 +0000</bug_when>
    <thetext>Oops, I saw comment 2 saying no, and missed comment 12. Sorry about that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42164</commentid>
    <comment_count>25</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-11-05 07:25:44 +0000</bug_when>
    <thetext>Could browser vendors comment on whether they would be interested in changing behaviour here?

The question specifically is on whether when the user changes a text field from ltr to rtl (or vice versa), the user agent should mutate the DOM to set a dir=&quot;&quot; attribute on the &lt;input&gt; or &lt;textarea&gt; element to the selected direction.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42192</commentid>
    <comment_count>26</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-11-05 16:12:36 +0000</bug_when>
    <thetext>As mentioned in comment 12, WebKit implements the proposed behavior, and it seems reasonable to me. A script can detect direction for &lt;div contenteditable&gt; via DOM attributes (although not uniformly across browsers), so having such a way for input and contenteditable only makes sense.

Firing oninput would seem strange though (I don&apos;t see any difference with e.g. changing style to bold in contenteditable).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42195</commentid>
    <comment_count>27</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2010-11-05 16:26:22 +0000</bug_when>
    <thetext>Seems fine to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42234</commentid>
    <comment_count>28</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-11-08 08:03:38 +0000</bug_when>
    <thetext>Would anybody object to this being a new event? Or is it important that it be &apos;input&apos;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42238</commentid>
    <comment_count>29</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2010-11-08 08:30:28 +0000</bug_when>
    <thetext>Would mutation events or their replacement not cover this? (If a generic event such as &apos;input&apos; is sufficient, mutation events or their replacement should be too.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42239</commentid>
    <comment_count>30</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2010-11-08 08:50:11 +0000</bug_when>
    <thetext>(In reply to comment #29)
&gt; Would mutation events or their replacement not cover this? (If a generic event
&gt; such as &apos;input&apos; is sufficient, mutation events or their replacement should be
&gt; too.)

I think the idea of using &quot;input&quot; is so that generic form validation code or autocomplete code will re-run if the direction changed. It seems more likely and more effective to check for form control contents changing using the &quot;input&quot; event as opposed to mutation events. So if an event is going to be reused, &quot;input&quot; probably makes more sense. On the other hand, a new event may be ok as well, since many Web apps will not look at the dir attribute anyway.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42240</commentid>
    <comment_count>31</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2010-11-08 08:52:36 +0000</bug_when>
    <thetext>And just so I get this right, I guess for the contenteditable=&quot;&quot; scenario the logic is that the application will handle all the details?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42246</commentid>
    <comment_count>32</comment_count>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2010-11-08 10:58:17 +0000</bug_when>
    <thetext>(In reply to comment #30)
&gt; (In reply to comment #29)
&gt; I think the idea of using &quot;input&quot; is so that generic form validation code or
&gt; autocomplete code will re-run if the direction changed. It seems more likely
&gt; and more effective to check for form control contents changing using the
&gt; &quot;input&quot; event as opposed to mutation events. So if an event is going to be
&gt; reused, &quot;input&quot; probably makes more sense. On the other hand, a new event may
&gt; be ok as well, since many Web apps will not look at the dir attribute anyway.

This justification for using the &quot;input&quot; sounds good to me, although of course I would be ok with a new event too.

I would hate to have to rely on a mutation event. DOM2 mutation events have not been interoperably implemented, and are currently deprecated in DOM3. Specifically, DOMAttrModified has not been implemented in WebKit and it is generally unclear whether DomAttrModified is supposed to be triggered on attribute changes done via the browser UI, not via script. As for DOMSubtreeModified, while it is implemented in WebKit, it only seems to be triggered by the initial addition of the dir attribute, but not when its value changes. Furthermore, it has not been implemented in Opera.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42259</commentid>
    <comment_count>33</comment_count>
    <who name="Aharon Lanin">aharon.lists.lanin</who>
    <bug_when>2010-11-08 11:47:31 +0000</bug_when>
    <thetext>If we really think that a new event for this purpose is viable, doesn&apos;t this affect the DOM3 events spec? If so, it needs to be proposed there immediately, so let&apos;s please come to a decision on this ASAP.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42265</commentid>
    <comment_count>34</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2010-11-08 12:03:34 +0000</bug_when>
    <thetext>New events can be introduced outside of DOM Level 3 Events. (And that happens quite often.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42370</commentid>
    <comment_count>35</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-11-10 17:30:18 +0000</bug_when>
    <thetext>Using &apos;input&apos; to trigger the revalidation code makes sense. I&apos;ll use that.

So in summary, the change here is to require that dir=&quot;&quot; on the element get mutated when the user uses a UI that changes the writing direction of a text field, and that the &apos;input&apos; event be fired (async) when that happens.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42399</commentid>
    <comment_count>36</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-11-11 00:45:41 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given in bug 10809 comment 48.
Rationale: Concurred with reporter&apos;s comments.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>928</attachid>
            <date>2010-10-26 02:24:05 +0000</date>
            <delta_ts>2010-10-26 02:24:05 +0000</delta_ts>
            <desc>Check whether your browser sets an input&apos;s dir when you change its direction.</desc>
            <filename>setdir.html</filename>
            <type>text/html</type>
            <size>787</size>
            <attacher name="Aharon Lanin">aharon.lists.lanin</attacher>
            
              <data encoding="base64">PGh0bWw+DQo8aGVhZD48dGl0bGU+RWZmZWN0IG9mIHNldHRpbmcgZGlyZWN0aW9uIG9uIERPTTwv
dGl0bGU+PC9oZWFkPg0KPGJvZHkgb25sb2FkPSJzZXRGb2N1cygpIj4NCiAgPHA+VG8gY2hhbmdl
IHRoZSBpbnB1dCdzIGRpcmVjdGlvbjo8L3A+DQogIDx1bD4NCiAgICA8bGk+SUUsIENocm9tZSAm
IE9wZXJhOiBDdHJsIC0gUmlnaHQgU2hpZnQ8L2xpPg0KICAgIDxsaT5GaXJlZm94OiBDdHJsIC0g
U2hpZnQgWDwvbGk+DQogICAgPGxpPlNhZmFyaTogcmlnaHQtY2xpY2ssICJTZXQgcGFyYWdyYXBo
IGRpcmVjdGlvbiI8L2xpPg0KICA8L3VsPg0KICA8cD5BZnRlciBjaGFuZ2luZyB0aGUgaW5wdXQn
cyBkaXJlY3Rpb24sIGNsaWNrIG9uICdDaGVjayBkaXJlY3Rpb24nLjwvcD4NCiAgPGlucHV0IGlk
PXggdHlwZT10ZXh0Lz4NCiAgPGlucHV0IHR5cGU9YnV0dG9uIHZhbHVlPSJDaGVjayBkaXJlY3Rp
b24iIG9uY2xpY2s9ImNoZWNrRGlyZWN0aW9uKCkiIC8+DQogIDxzY3JpcHQ+DQogICAgdmFyIHgg
PSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgneCcpOw0KICAgIGZ1bmN0aW9uIHNldEZvY3VzKCkg
ew0KICAgICAgeC5mb2N1cygpOw0KICAgIH0NCiAgICBmdW5jdGlvbiBjaGVja0RpcmVjdGlvbigp
IHsNCiAgICAgIGFsZXJ0KCd4LmRpcjogIicgKyB4LmRpciArDQogICAgICAgICAgJyI7IHguZ2V0
QXR0cmlidXRlKFwnZGlyXCcpOiAiJyArDQogICAgICAgICAgeC5nZXRBdHRyaWJ1dGUoJ2Rpcicp
ICsgJyInKTsNCiAgICB9DQogIDwvc2NyaXB0Pg0KPC9ib2R5Pg0KPC9odG1sPg==
</data>

          </attachment>
      

    </bug>

</bugzilla>