getComposedRange() review
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reviewing the getComposedRange() algorithm and the linked Selection API, DOM, and Web Components discussions. Resolve the empty-selection result and ShadowRoot matching questions, then determine how the proposed range duality affects getRangeAt(); the issue is done when these behaviors have an agreed specification.
Written by the indexing model from the issue text.
Description
If this is empty, return a new StaticRange whose start node and end node are null and whose start offset and end offset are 0.
Start/end node cannot be null. I think we use some kind of default instead, such as "the body element"?
While startNode is a node, startNode's root is a shadow root, and startNode is not a shadow-including inclusive ancestor of any of shadowRoots
It seems that if you pass in the ShadowRoot instance start node is part of, this wouldn't result in a match. Which if you made a selection inside that ShadowRoot instance doesn't seem to be what you want?
One thing I'm missing here still is https://github.com/WICG/webcomponents/issues/79#issuecomment-972726532. As we can no longer expose the true range directly we need to deal with that duality somehow, also for existing APIs such as getRangeAt(). That will require changes to both DOM and Selection.
- Dominant language
- HTML
- Stars
- 49
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from w3c/selection-api
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
w3c/selection-api#354 ·
-
Agenda+
Difficulty 3/5 1-2 days Newbie friendliness 48/100
w3c/selection-api#361 · 2 comments ·
-
w3c/selection-api#358 · 2 comments · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
w3c/selection-api#355 ·
-
the steps of Selection.extend() does not check whether the given offset is valid in the container Open
Difficulty 1/5 Under an hour Newbie friendliness 55/100
w3c/selection-api#353 · 1 comment ·
All issues in w3c/selection-api
Similar issues
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100