New issue
Advanced search Search tips

Issue 605418 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

Incorrect cursor positioning/display beside contenteditable=false island at bidi boundary

Reported by dive...@gmail.com, Apr 21 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/48.0.2564.82 Chrome/48.0.2564.82 Safari/537.36

Example URL:
data:text/html,<h1 style="padding:0.5em" dir=rtl contenteditable>ABC<span contenteditable=false>XYZ</span>&#x05D0;&#x05D1;&#x05D2;</h1><script>document.body.firstChild.focus();s=window.getSelection();console.log(s.focusNode,s.focusOffset)</script>

Steps to reproduce the problem:
1. With the console visible, open the data URI above
2. Note that the focus position shown in the console is at the logical start of the text (at offset zero of the 'ABC' text node).
3. Note, however, that the cursor appears at the end of the paragraph (to the right of the 'Z'). It does not blink.

What is the expected behavior?
EITHER the position is { node: "ABC", offset: 0 } and the cursor displays to the left of the 'A',
OR the position is { node: h1, offset: 0 } and the cursor displays to the right of the 'Z'.
The cursor blinks normally.

What went wrong?
I guess that the cursor is displayed as if the position were { node: h1, offset: 0 }, but then Chromium's position normalization moves the cursor into the supposedly adjacent text node, i.e. to { node: "ABC", offset: 0 } . But because of bidirectionality, these positions are not actually equivalent -- they render in totally different places.

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: 48.0.2564.82  Channel: n/a
OS Version: 
Flash Version:
 

Comment 1 by dive...@gmail.com, Apr 21 2016

See also https://bugs.chromium.org/p/chromium/issues/detail?id=605433 - the non-bidi case when the contenteditable=false island is logically at the end of the paragraph.

Comment 2 by yosin@chromium.org, Apr 21 2016

Components: -Blink Blink>TextSelection>Caret
Status: Available (was: Unconfirmed)

Comment 3 by dive...@gmail.com, Apr 21 2016

See also https://bugs.chromium.org/p/chromium/issues/detail?id=605445 (Missing bidi visual cursor position at the end of the example document above).

Comment 4 by tkent@chromium.org, Oct 12 2016

Components: Blink>Editing>Selection

Comment 5 by tkent@chromium.org, Oct 12 2016

Components: -Blink>TextSelection>Caret

Comment 6 by yosin@chromium.org, Oct 4 2017

Labels: Pri-3
Project Member

Comment 7 by sheriffbot@chromium.org, Oct 4

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)
The behaviour in Chromium 69 is exactly as described above.

Sign in to add a comment