Skip to content

the steps of Selection.extend() does not check whether the given offset is valid in the container #353

Open

Description

@masayuki-nakano

The collapse() method section has the following:

The method must throw an IndexSizeError exception if offset is longer than node's length and abort these steps.

However, the extend() method section does not have the corresponding step.

I think that the check should be done before or after the 2nd step.

Activity

  1. masayuki-nakano commented on Jan 9, 2026

    @masayuki-nakano
    Author

    Oh, and also these things should be checked too:

    1. If node is null, this method must behave identically as removeAllRanges() and abort these steps.
    2. If node is a DocumentType, throw an InvalidNodeTypeError exception and abort these steps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions