New issue
Advanced search Search tips

Issue 625174 link

Starred by 2 users

Issue metadata

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

Blocked on:
issue 669811



Sign in to add a comment

Selection not rendered if endpoint is between contenteditables

Reported by stef.bus...@gmail.com, Jul 1 2016

Issue description

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

Example URL:
http://codepen.io/Bwrrp/pen/dXWmBp

Steps to reproduce the problem:
1. Go to http://codepen.io/Bwrrp/pen/dXWmBp
2. Click anywhere in the preview to select the div around "Inside selection" and "Lorem ipsum…" and cycle through different combinations of contenteditable="true" or contenteditable="false" on the three marked divs. An orange border indicates the contenteditable value "false", blue indicates "true".
3. See the selection disappear when the inner divs have opposite editability compared to the outer div.

What is the expected behavior?
Expected selection to render correctly in all combinations used in the codepen.

What went wrong?
When the start point of the selection is located between two elements with contenteditable value opposite to the surrounding element, the selection is not rendered as selection highlight, but as a normal cursor at its end point. Accessing the selection through the window.getSelection() API reveals it is not actually collapsed. This is illustrated in the codepen by displaying the HTML for the first selected element.

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: 53.0.2783.2  Channel: dev
OS Version: 
Flash Version: Shockwave Flash 22.0 r0

As a work-around, uncomment the div class="workaround". It seems that introducing an element without the contenteditable attribute next to the start point of the selection allows the selection to be visible in all combinations.

The selection renders as expected in all combinations in Firefox and Edge. This seems to trigger a different bug in Safari, as it silently refuses to set the selection in some combinations or even selects the workaround div instead.
 

Comment 1 by b...@chromium.org, Jul 1 2016

Components: -Blink Blink>Editing

Comment 2 by yosin@chromium.org, Jul 4 2016

Components: -Blink>Editing Blink>TextSelection
Labels: -OS-Linux OS-All

Comment 3 by yosin@chromium.org, Jul 13 2016

Owner: yosin@chromium.org
Status: Assigned (was: Unconfirmed)
Due by visible position canonicalization

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

Components: -Blink>TextSelection Blink>Editing>Selection

Comment 5 by yosin@chromium.org, Nov 30 2016

Blockedon: 669811

Comment 6 by yosin@chromium.org, Dec 2 2016

Status: Available (was: Assigned)

Comment 7 by yosin@chromium.org, Dec 2 2016

Owner: ----

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

Labels: Pri-3
Project Member

Comment 9 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)

Sign in to add a comment