Cannot select elements across shadow boundaries.
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
People
(Reporter: emilio, Assigned: sefeng)
References
(Depends on 5 open bugs, Blocks 3 open bugs)
Details
Attachments
(1 file)
273 bytes,
text/html
|
Details |
STR: * Go to https://wpt.fyi/css/cssom/interfaces.html * Try selecting content from the warning message that says: > Data below are intended for web platform implementers and do not contain useful metrics for evaluation or comparison of web platform features. Also note that tested Edge and Safari are not pre-release versions (#109, #110). and moving it into the results table. Expected: * I can select text across shadow DOM boundaries. Actual: * The selection is chomped to the table contents inside the Shadow Root.
Reporter | ||
Updated•6 years ago
|
Comment 1•6 years ago
|
||
This is a spec issue too. As far as I know, Gecko works like Webkit, since that is per current spec.
Updated•6 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 2•1 year ago
|
||
I am going to spend some time in the shadow dom cross boundary selecton proposal and see what we can do.
Assignee | ||
Comment 3•1 year ago
|
||
Looks like STR is outdated, so I attached a new testcase.
Updated•1 year ago
|
Comment 5•2 months ago
|
||
Is this still being worked on? Otherwise consider unassigning it.
Updated•2 months ago
|
Comment 7•2 months ago
|
||
Any gut feeling yet how complex fixing this is? Any context here is appreciated.
Assignee | ||
Comment 8•2 months ago
|
||
Implementing the spec to return the ranges that have the correct start and end nodes is easy, though making the actual selection work (ie. the blue selection background) is hard.
Mostly due the selection code has the assumption that no shadow DOM is involved. For example ContentIterator doesn't iterate elements in shadow DOM, range gets confused for its common ancestor. Lots of assertions had the same assumption so it's hard to fix them. Slotted contents makes the entire thing more complicated.
Plus the same code has been used not only by selection but also editor stuff, which adds another level of complexity.
So far I've implemented the spec and made the visual selection works for some fairly complex shadow trees. I am fixing test failures related to editor and slotted contents. Fixed lots of them already, but still have a decent number of failures to go.
Hope this provides some context :)
Comment 9•2 months ago
|
||
Hope this provides some context :)
It did, thanks.
Btw., be aware that the clipboard-code might need refinement too.
Description
•