`user-select: none` element in contenteditable is excluded from copy-to-clipboard
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, defect, P3)
Tracking
()
People
(Reporter: saschanaz, Unassigned)
References
Details
Attachments
(1 file)
147 bytes,
text/html
|
Details |
- Try selecting the whole line.
- Copy-paste to somewhere else.
Expected: No selection for "noselect" span element
Actual: It's selected but omitted in clipboard, causing confusion
This also causes a web-visible behavior difference: getSelection().rangeCount
becomes 2 without contenteditable
but 1 with contenteditable
.
Comment 1•4 years ago
|
||
I seem to recall it's intentional that user-select: none
is ignored inside a contenteditable node - otherwise you wouldn't be able to edit it. Omitting it when it's copied to the clipboard seems like a bug though. I think the serialization/clipboard code has its own handling of user-select: none
which we should probably nuke and just use the Ranges instead. (It was a long time ago that I hacked on Selection though, so I could be wrong.)
Comment 2•4 years ago
|
||
(In reply to Mats Palmgren (:mats) from comment #1)
I seem to recall it's intentional that
user-select: none
is ignored inside a contenteditable node - otherwise you wouldn't be able to edit it. Omitting it when it's copied to the clipboard seems like a bug though. I think the serialization/clipboard code has its own handling ofuser-select: none
which we should probably nuke and just use the Ranges instead. (It was a long time ago that I hacked on Selection though, so I could be wrong.)
Yes, the serialization-code skips content with unselectable frames.
Given what Mats wrote above, it seems nsIFrame::IsSelectable
should return true
when the frame corresponds to a node which is contenteditable
.
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Updated•3 years ago
|
Description
•