New issue
Advanced search Search tips

Issue 759723 link

Starred by 3 users

Issue metadata

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



Sign in to add a comment

selecting one image out of several contiguous images selects all images in a contenteditable div

Reported by je...@edagames.com, Aug 28 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/604.1 (KHTML, like Gecko) Version/11.0 Safari/604.1 Debian/9.0 (3.22.7-1) Epiphany/3.22.7

Steps to reproduce the problem:
In a div with two img nodes that have contenteditable="false" attributes, (and no text nodes between them), use getSelection() and range.selectNode(lastImage).
Then toggle div.setAttribute('contenteditable', "true" | "false")

What is the expected behavior?
Only the last image is selected.

What went wrong?
The two images are selected.
If one adds a whitespace between the two images, the wrong behavior stops.

Did this work before? Yes 57

Does this work in other browsers? N/A

Chrome version: 58, 59, 60, 61  Channel: stable
OS Version: 7, 10
Flash Version: 

Tested on linux, windows, from chrome 52 to chrome 61.
 
chromeIssue.html
935 bytes View Download

Comment 1 by yosin@chromium.org, Aug 29 2017

Components: -Blink>Editing Blink>Editing>Selection
Labels: -Pri-2 Pri-3
Status: Available (was: Unconfirmed)
It seems this is a bug of handling contenteditable=false.

contenteditable=false should not affect selection.

Suggestions about sample:
 - We should use "user-select:none" instead of "contenteditable=false" to control
 selectability.
 - "contenteditable" affects children of element instead of element itself. Since,
 IMG elements don't have child node, note: child nodes of IMG are ignored,
"contenteditable" is meaningless.
 - Since Blink uses GC for memory management, using temporary Range slows down DOM
modification and eats more memory.



Comment 2 by je...@edagames.com, Sep 1 2017

> We should use "user-select:none" instead of "contenteditable=false" to control
> selectability.

I'm not sure img[contenteditable="false"] purpose is to disable selectability. It might also play a role in disabling image resizing controls in contentEditable areas.

Comment 3 by je...@edagames.com, Sep 1 2017

Also, setting #test img { user-select:none; } in the sample doesn't improve the situation - it just hides it. Selection is still wrong, as one can see by trying to drag the second image: sometimes it drags the first image too.
Project Member

Comment 4 by sheriffbot@chromium.org, Sep 3

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