Closed Bug 1430308 Opened 6 years ago Closed 2 months ago

Implement Selection.getComposedRange() and Selection.direction

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1867058

People

(Reporter: smaug, Assigned: sefeng)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-needed, parity-safari)

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.
Priority: -- → P3
Blocks: shadowdom
No longer blocks: shadowdom-initial-release

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

Updating title as such.

Summary: Implement ShadowRoot.getSelection() → Implement Selection.getComposedRange()
Severity: normal → S3
Assignee: nobody → sefeng

The Safari 17 beta now has this, as implemented in https://bugs.webkit.org/show_bug.cgi?id=163921

Keywords: parity-safari

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

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

It looks that one of the patches in bug 1867058 already implements this new API. Should we close this as duplicate?

Flags: needinfo?(sefeng)

I may be able to land the patches for this first, without other shadow dom selection stuff. Let me try that

Flags: needinfo?(sefeng)
Summary: Implement Selection.getComposedRange() → Implement Selection.getComposedRange() and Selection.direction

But we couldn't enable this before actual selection handling and copy-paste and stuff works with shadow DOM.

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

Status: NEW → RESOLVED
Closed: 2 months ago
Duplicate of bug: 1867058
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.