<?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>24278</bug_id>
          
          <creation_ts>2009-03-01 15:12:37 -0800</creation_ts>
          <short_desc>RTL Regression: Caret position is wrong when typing RTL text in a LTR text box or type LTR text in a RTL text box</short_desc>
          <delta_ts>2011-03-30 02:50:20 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Forms</component>
          <version>525.x (Safari 3.2)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>PlatformOnly</keywords>
          <priority>P2</priority>
          <bug_severity>Minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Xiaomei Ji">xji</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aharon</cc>
    
    <cc>jturcotte</cc>
    
    <cc>mitz</cc>
    
    <cc>playmobil</cc>
    
    <cc>progame+wk</cc>
    
    <cc>rniwa</cc>
    
    <cc>xji</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>111750</commentid>
    <comment_count>0</comment_count>
    <who name="Xiaomei Ji">xji</who>
    <bug_when>2009-03-01 15:12:37 -0800</bug_when>
    <thetext>This is a regression.
It works correctly in Sarafi 3.2, but not in nightly r41128.

Test case is attached.

Type a Hebrew (for example) word in the text box at the buttom of the test
page. 

The caret should stay left, as that&apos;s where the last typed letter is.
(FF and IE behaves like this).

In Safari, the caret moves to the right part of the word.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111751</commentid>
    <comment_count>1</comment_count>
      <attachid>28154</attachid>
    <who name="Xiaomei Ji">xji</who>
    <bug_when>2009-03-01 15:13:58 -0800</bug_when>
    <thetext>Created attachment 28154
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111752</commentid>
    <comment_count>2</comment_count>
    <who name="Xiaomei Ji">xji</who>
    <bug_when>2009-03-01 15:15:22 -0800</bug_when>
    <thetext>also in Chrome:
http://code.google.com/p/chromium/issues/detail?id=8172
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111757</commentid>
    <comment_count>3</comment_count>
    <who name="">mitz</who>
    <bug_when>2009-03-01 15:36:23 -0800</bug_when>
    <thetext>The behavior is correct for Mac OS X. Note that in Firefox, the position (and shape, see bug 22386) of the insertion point changes depending on the active keyboard layout, so that in the attached test case, if one types RTL characters using the Hebrew keyboard layout and then changes the keyboard layout to U.S., the insertion point moves to the right. In Mac OS X, the position to the right may be indicated by a split caret (see bug 3710), but that does not depend on the active keyboard layout.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111762</commentid>
    <comment_count>4</comment_count>
    <who name="Xiaomei Ji">xji</who>
    <bug_when>2009-03-01 16:22:30 -0800</bug_when>
    <thetext>*** Bug 24279 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111763</commentid>
    <comment_count>5</comment_count>
    <who name="Xiaomei Ji">xji</who>
    <bug_when>2009-03-01 16:24:45 -0800</bug_when>
    <thetext>(merged from bug 24279).

Also, Caret position is wrong when typing LTR text in a RTL text box.

Type a English word in a RTL text box. 

The caret should move to right, as that&apos;s where the last typed letter is.
(FF and IE behaves like this).

In Safari, the caret always stays at the very left.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111780</commentid>
    <comment_count>6</comment_count>
    <who name="Yair Yogev">progame+wk</who>
    <bug_when>2009-03-01 22:05:22 -0800</bug_when>
    <thetext>there is also this specific website:
http://guide.maccabi4u.co.il/SearchChapter.aspx?ChapterId=1
where when writing a Hebrew word in this RTL text box:
http://img24.imageshack.us/img24/8255/chromecaret2.jpg

the caret doesn&apos;t move to the left, although the word and the textbox is RTL

this is also a regression, older builds works fine with it
(it is only applicable to the text box shot in the screenshot)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111781</commentid>
    <comment_count>7</comment_count>
    <who name="">mitz</who>
    <bug_when>2009-03-01 22:10:49 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; there is also this specific website:
&gt; http://guide.maccabi4u.co.il/SearchChapter.aspx?ChapterId=1
&gt; where when writing a Hebrew word in this RTL text box:
&gt; http://img24.imageshack.us/img24/8255/chromecaret2.jpg
&gt; 
&gt; the caret doesn&apos;t move to the left, although the word and the textbox is RTL

The Web Inspector shows that that input element&apos;s &apos;direction&apos; property&apos;s value is &apos;ltr&apos;. &apos;text-align&apos; and &apos;direction&apos; are not the same thing.

&gt; 
&gt; this is also a regression, older builds works fine with it
&gt; (it is only applicable to the text box shot in the screenshot)
&gt; 

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111782</commentid>
    <comment_count>8</comment_count>
    <who name="Yair Yogev">progame+wk</who>
    <bug_when>2009-03-01 22:14:02 -0800</bug_when>
    <thetext>thanks,
i guess IE and FF identify it wrong</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124386</commentid>
    <comment_count>9</comment_count>
    <who name="Xiaomei Ji">xji</who>
    <bug_when>2009-06-04 15:14:56 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; The behavior is correct for Mac OS X. 

using TextEditor  in Mac OS X 10.5.6,
when typing Hebrew in left aligned text, the caret stays left.
when typing English character in right aligned text, the caret stays right.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124397</commentid>
    <comment_count>10</comment_count>
    <who name="">mitz</who>
    <bug_when>2009-06-04 16:03:43 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; (In reply to comment #3)
&gt; &gt; The behavior is correct for Mac OS X. 
&gt; 
&gt; using TextEditor  in Mac OS X 10.5.6,
&gt; when typing Hebrew in left aligned text, the caret stays left.
&gt; when typing English character in right aligned text, the caret stays right.

TextEdit uses “natural writing direction” by default. If you want to mimic the test case, you should choose Left to Right writing direction from the context menu in TextEdit
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>200870</commentid>
    <comment_count>11</comment_count>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2010-03-17 11:11:50 -0700</bug_when>
    <thetext>I can reproduce the &quot;RTL string in LTR text box&quot; case in QtWebKit, Chrome and Safari on Windows.

I can reproduce the &quot;LTR string in RTL text box&quot; only in QtWebKit or in Safari if I explicitely set the text box to RTL in its context menu.
The default direction (for example on google.com.lb) seems to switch the text box to LTR if the string starts with latin characters.

The biggest annoyance is that you don&apos;t see what you type when you type text larger than the text box.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>200889</commentid>
    <comment_count>12</comment_count>
      <attachid>50929</attachid>
    <who name="Yair Yogev">progame+wk</who>
    <bug_when>2010-03-17 11:46:53 -0700</bug_when>
    <thetext>Created attachment 50929
new test case

This test case allows testing &quot;LTR string in RTL text box&quot; as well as &quot;RTL string in LTR text box&quot;.
It also shows how you can&apos;t see what you type after filling the visible space because the caret is in the wrong position.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>213431</commentid>
    <comment_count>13</comment_count>
    <who name="Yair Yogev">progame+wk</who>
    <bug_when>2010-04-16 14:32:17 -0700</bug_when>
    <thetext>a fix here will affect Bug 33503 btw</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>376154</commentid>
    <comment_count>14</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-03-30 02:50:20 -0700</bug_when>
    <thetext>It seems like this is an inherent problem to the way WebKit maps visual positions to logical positions since we have exactly one visual position for each logical position.  Unless we use Firefox-like hints, we can&apos;t resolve this bug without regressions LTR in LTR / RTL in RTL cases.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>28154</attachid>
            <date>2009-03-01 15:13:58 -0800</date>
            <delta_ts>2009-03-01 15:13:58 -0800</delta_ts>
            <desc>test case</desc>
            <filename>8172.html</filename>
            <type>text/html</type>
            <size>59</size>
            <attacher name="Xiaomei Ji">xji</attacher>
            
              <data encoding="base64">PGh0bWw+DQo8dGV4dGFyZWEgcm93cz0iMiIgY29scz0iMjAiPg0KPC90ZXh0YXJlYT4NCjwvaHRt
bD4=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>50929</attachid>
            <date>2010-03-17 11:46:53 -0700</date>
            <delta_ts>2010-03-17 11:46:53 -0700</delta_ts>
            <desc>new test case</desc>
            <filename>testcase24278.htm</filename>
            <type>text/html</type>
            <size>543</size>
            <attacher name="Yair Yogev">progame+wk</attacher>
            
              <data encoding="base64">PEhUTUw+PEhFQUQ+PE1FVEEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0
L2h0bWw7IGNoYXJzZXQ9VVRGLTgiPiAKPFNUWUxFPgoKPC9TVFlMRT4KPC9IRUFEPjxCT0RZPgp3
cml0ZSBzb21lIExUUiB0ZXh0IGhlcmUgKEVuZ2xpc2ggd291bGQgYmUgZmluZS4uLik8YnI+CjxU
RVhUQVJFQSBkaXI9InJ0bCI+CjwvVEVYVEFSRUE+PHA+CmFuZCBoZXJlOjxicj4KICA8aW5wdXQg
ZGlyPSJydGwiPjxicj4KKG5vdGUgaG93IHlvdSBjYW4ndCBzZWUgd2hhdCB5b3UgdHlwZSBpbiB0
aGUgc2Vjb25kIGJveCBhZnRlciBmaWxsaW5nIHRoZSB2aXNpYmxlIHNwYWNlKQo8cD4Kd3JpdGUg
c29tZSBSVEwgdGV4dCBoZXJlOiAoSGVicmV3XEFyYWJpYy4uLik8YnI+CjxURVhUQVJFQT4KPC9U
RVhUQVJFQT48cD4KYW5kIGhlcmU6PGJyPgo8aW5wdXQ+PGJyPgoobm90ZSBob3cgeW91IGNhbid0
IHNlZSB3aGF0IHlvdSB0eXBlIGluIHRoZSBzZWNvbmQgYm94IGFmdGVyIGZpbGxpbmcgdGhlIHZp
c2libGUgc3BhY2UpCgoKIDwvQk9EWT48L0hUTUw+
</data>

          </attachment>
      

    </bug>

</bugzilla>