Selection publicly exposes internal anonymous nodes
Categories
(Core :: DOM: Selection, defect, P3)
Tracking
()
People
(Reporter: saschanaz, Unassigned)
References
Details
Attachments
(2 files, 3 obsolete files)
Selecting elements like <details>
and <input type=date>
exposes internal nodes via anchorNode
and focusNode
.
- Open the attachment
- Try selecting <details> or <input>. It's easier if you start dragging from or finish at the outside of the elements.
- Call
getSelection()
from devtools console
Expected: No Restricted nodes
Actual: It happens
Reporter | ||
Comment 1•4 years ago
|
||
Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
Reporter | ||
Comment 2•4 years ago
|
||
Reporter | ||
Comment 3•4 years ago
|
||
Updated•4 years ago
|
Comment 5•4 years ago
|
||
Backed out for mochitest failure on test_queryCaretRect.html
Backout link: https://hg.mozilla.org/integration/autoland/rev/8ac94f155185a1ec04d55dcda8bbe538eb1accbd
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=318460532&repo=autoland&lineNumber=5757
Updated•4 years ago
|
Reporter | ||
Comment 6•4 years ago
|
||
Both selectionStart/End and anchorOffset/focusOffset depend on same Selection::GetAnchorFocusRange().
Depends on D93258
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 8•4 years ago
|
||
Work item: do what Masayuki suggested https://phabricator.services.mozilla.com/D93258#3030710
Comment 9•4 years ago
|
||
bugherder |
Reporter | ||
Comment 12•4 years ago
|
||
I tested some Shadow DOM and it seems my current patch doesn't cover such case. It still exposes shadow nodes while Blink does not.
Mirko, is Blink behavior in some spec or is our behavior okay?
Reporter | ||
Comment 13•4 years ago
|
||
Ah okay, it's not.
Reporter | ||
Comment 14•4 years ago
|
||
A new case to cover: Selecting text inside ::before
by find-in-page exposes internal Restricted node. ("Example 1" in https://w3c.github.io/tr-design/src/readme.html)
Comment 15•3 years ago
|
||
The leave-open keyword is there and there is no activity for 6 months.
:saschanaz, maybe it's time to close this bug?
Reporter | ||
Comment 16•3 years ago
|
||
The issue is still valid, but not the keyword:
Reporter | ||
Comment 17•3 years ago
|
||
Reporter | ||
Comment 18•3 years ago
|
||
Hmm, I wonder I could just return adjusted range objects from Selection methods and cache them to fulfill the same object requirement.
Updated•3 years ago
|
Reporter | ||
Comment 19•3 years ago
|
||
Not working on this and no plan to return anytime soon...
Description
•