Skip to content

Selection's selectAllChildren() doesn't work with shadow roots #47119

Closed

Description

@webbedspace

Describe the bug:
Passing a shadow root to it (s.selectAllChildren(Z.shadowRoot)) doesn't do anything. Changing it to s.selectAllChildren(Z) does cause Servo to select the shadow root contents, erroneously.

To Reproduce:

<!DOCTYPE html>
<body bgcolor="white">
<span id="X">Light DOM</span> <span id="Y">Light DOM</span> 
<span id="Z"><template shadowrootmode=open><mark>Shadow</mark> Root</template></span>
<script>
let s = document.getSelection()
s.selectAllChildren(Z.shadowRoot)
</script>

Chrome
Image
Servo
Image

Platform:
Win 10

Activity

  1. added
    C-untriaged
    on Aug 10, 2026
  2. added
    A-content/dom
    C-has-manual-testcase
    and removed
    C-untriaged
    on Aug 11, 2026
  3. added
    I-spec-unclear
    on Aug 26, 2026
  4. added a commit that references this issue on Sep 7, 2026
    7459ed3
  5. added a commit that references this issue on Oct 6, 2026
    39d8edf
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

    A-content/domC-has-manual-testcaseI-spec-unclear

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions