collapse and setBaseAndExtent methods contain redundant checks of offset
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- html
- Domain
- documentation
Research direction
Read the linked specification sections for Selection.collapse() and Selection.setBaseAndExtent(). Compare their explicit IndexSizeError steps with the later newRange creation and with other Selection API operations, then remove the redundant steps if the specification wording supports it.
Written by the indexing model from the issue text.
Description
In the specification of the collapse method there is a step that says that the method must throw IndexSizeError if offset is longer than the node’s length. This check is also done as part of creating newRange in subsequent steps. So the IndexSizeError exception will be thrown in either case. However, because the specification explicitly calls for doing this before checking the node’s root, this difference is observable in obscure cases.
I suggest we remove the explicit IndexSizeError step. Better for consistency with other operations in the Selection API that don't explicitly specify an IndexSizeError check. I think it’s likely this is not already needed for web compatibility, so it’s not too late to fix this.
These same considerations apply to the setBaseAndExtent method. And I suggest the same change, removing the explicit IndexSizeError step.
- 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
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·