Implement Selection.getComposedRange() and Selection.direction
Categories
(Core :: DOM: Core & HTML, enhancement, P3)
Tracking
()
People
(Reporter: smaug, Assigned: sefeng)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-needed, parity-safari)
http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-the-documentorshadowroot-mixin https://w3c.github.io/selection-api/#extensions-to-document-interface Webkit doesn't seem to have this yet https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/DocumentOrShadowRoot.idl#L30 but Blink does have. The selection handling in Shadow DOM is a bit unclear.
Comment 1•6 years ago
|
||
My understanding is that we could leave it after our 1st ship, mark P3 for now. Feel free to correct me if I'm wrong.
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Comment 2•5 years ago
|
||
Here's WebKit's bug: https://bugs.webkit.org/show_bug.cgi?id=163921
The current consensus is to add getComposedRange
on Selection interface:
https://github.com/w3c/webcomponents/issues/79
Comment 3•4 years ago
|
||
Updating title as such.
Updated•2 years ago
|
Assignee | ||
Updated•1 year ago
|
Comment 4•11 months ago
•
|
||
The Safari 17 beta now has this, as implemented in https://bugs.webkit.org/show_bug.cgi?id=163921
Updated•11 months ago
|
Reporter | ||
Comment 5•11 months ago
•
|
||
The specification isn't quite ready yet, so I don't know what they have shipped in their beta. The specification was discussed during the web components f2f, see for example https://github.com/w3c/selection-api/issues/161#issuecomment-1517552762
Comment 6•9 months ago
|
||
Hi! One of the authors of CKEditor here.
To be completely honest – whatever is shipped, even if it's not fully compatible with the non-existent standard, is better than the current state. And Firefox is the last browser that still hasn't shipped something.
Without that, we cannot implement shadow DOM support in CKEditor 5. And this issue is regularly brought up by our community: https://github.com/ckeditor/ckeditor5/issues/3891
Comment 7•2 months ago
|
||
It looks that one of the patches in bug 1867058 already implements this new API. Should we close this as duplicate?
Assignee | ||
Comment 8•2 months ago
|
||
I may be able to land the patches for this first, without other shadow dom selection stuff. Let me try that
Assignee | ||
Updated•2 months ago
|
Reporter | ||
Comment 9•2 months ago
•
|
||
But we couldn't enable this before actual selection handling and copy-paste and stuff works with shadow DOM.
Assignee | ||
Comment 10•2 months ago
|
||
Yeah, probably not useful at all for landing getComposedRange() by itself...because without bug 1867058, one can't use setBaseAndExtent to set cross boundary selections. So the value of what getComposedRange provides on its own is questionable.
bug 1867058 is not that far from landing. I'll work towards landing that instead of landing getComposedRange() on its own.
I am going to take Hsinyi's suggestion as making this a duplicate
Description
•