New issue
Advanced search Search tips

Issue 623270 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug
RTL



Sign in to add a comment

RTL content has a wrong caret position in dir=auto TEXTAREA with LTR placeholder value

Reported by shaul.kr...@gmail.com, Jun 25 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:44.0) Gecko/20100101 Firefox/47.0

Example URL:
https://jsfiddle.net/z6mxsq1f/4/

Steps to reproduce the problem:
1. Create textarea with LTR language placeholder string, and dir="auto" attribute.
2. Try to type RTL language characters in the textarea.

What is the expected behavior?
The cursor should be in the end of the RTL string (left side of the string).

What went wrong?
The cursor is in the start of the string (right side).

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? Yes 

Chrome version: 51.0.2704.103  Channel: stable
OS Version: 7 SP1 
Flash Version:
 

Comment 1 by joh...@chromium.org, Jun 27 2016

Components: -Blink Blink>TextSelection>Caret

Comment 2 by tkent@chromium.org, Jun 30 2016

Labels: Needs-Feedback
> 2. Try to type RTL language characters in the textarea.

Could you explain more about this step?  What do you mean by "try" concretely?
Is the "placeholder" attribute really necessary to reproduce the issue?

You don't have to type, you can see in my example, if you try to go to the end (press "end" button) of the textarea string the cursor is in the wrong place.

I took some screenshots to explain it:
https://imgur.com/a/oQrQZ

BTW, this bug not exist the other way around. If your place holder is in RTL language and the content is LTR, the cursor is in the correct position.
Project Member

Comment 4 by sheriffbot@chromium.org, Jul 1 2016

Labels: -Needs-Feedback Needs-Review
Owner: tkent@chromium.org
Thank you for providing more feedback. Adding requester "tkent@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 5 by tkent@chromium.org, Jul 3 2016

Components: -Blink>TextSelection>Caret Blink>Forms>Textarea
Labels: -OS-Windows -Pri-2 -Needs-Review rtl OS-All Pri-3
Owner: ----
Status: Available (was: Unconfirmed)
Summary: RTL content has a wrong caret position in dir=auto TEXTAREA with LTR placeholder value (was: When using dir="auto" in textarea with LTR placeholder and RTL content, cursor marker in wrong place)
Ah, I understand.  A placeholder attribute value affects the caret position though the placeholder is invisible!

Yes, the caret is still in LTR mode while the content is RTL, because of the LTR placeholder value.
Project Member

Comment 7 by bugdroid1@chromium.org, Jul 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/55f27bb5c4f4f99a2885dc67bd6e448a464505ed

commit 55f27bb5c4f4f99a2885dc67bd6e448a464505ed
Author: tkent <tkent@chromium.org>
Date: Wed Jul 13 07:29:15 2016

Placeholder content direction should not affect INPUT/TEXTAREA direction.

Skip -webkit-input-placeholder elements when we compute direction for dir=auto in
HTMLElement::directionality.

- Using <bdi> for placeholders doesn't work. We want to inherit placeholder direction
  from the parent element.
- Using unicode-bidi CSS property doesn't work. It doesn't affect dir=auto
  computation.

BUG= 623270 , 625739 

Review-Url: https://codereview.chromium.org/2145823003
Cr-Commit-Position: refs/heads/master@{#405069}

[add] https://crrev.com/55f27bb5c4f4f99a2885dc67bd6e448a464505ed/third_party/WebKit/LayoutTests/fast/forms/text/text-dir-auto-with-placeholder.html
[add] https://crrev.com/55f27bb5c4f4f99a2885dc67bd6e448a464505ed/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-dir-auto-with-placeholder.html
[modify] https://crrev.com/55f27bb5c4f4f99a2885dc67bd6e448a464505ed/third_party/WebKit/Source/core/html/HTMLElement.cpp

Project Member

Comment 8 by bugdroid1@chromium.org, Jul 13 2016

Labels: merge-merged-2795
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/55f27bb5c4f4f99a2885dc67bd6e448a464505ed

commit 55f27bb5c4f4f99a2885dc67bd6e448a464505ed
Author: tkent <tkent@chromium.org>
Date: Wed Jul 13 07:29:15 2016

Placeholder content direction should not affect INPUT/TEXTAREA direction.

Skip -webkit-input-placeholder elements when we compute direction for dir=auto in
HTMLElement::directionality.

- Using <bdi> for placeholders doesn't work. We want to inherit placeholder direction
  from the parent element.
- Using unicode-bidi CSS property doesn't work. It doesn't affect dir=auto
  computation.

BUG= 623270 , 625739 

Review-Url: https://codereview.chromium.org/2145823003
Cr-Commit-Position: refs/heads/master@{#405069}

[add] https://crrev.com/55f27bb5c4f4f99a2885dc67bd6e448a464505ed/third_party/WebKit/LayoutTests/fast/forms/text/text-dir-auto-with-placeholder.html
[add] https://crrev.com/55f27bb5c4f4f99a2885dc67bd6e448a464505ed/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-dir-auto-with-placeholder.html
[modify] https://crrev.com/55f27bb5c4f4f99a2885dc67bd6e448a464505ed/third_party/WebKit/Source/core/html/HTMLElement.cpp

Comment 9 by tkent@chromium.org, Jul 13 2016

Owner: tkent@chromium.org
Status: Fixed (was: Available)
I think this was fixed with the current Canary channel.  Clicking on the whitespace in the TEXTAREA puts the caret at the left side of the string.

Sign in to add a comment