Skip to content

[selectors-4] Should document.documentElement match :scope when document is included scoping roots? #13494

@cdoublev

Description

@cdoublev

Otherwise I cannot understand how, following the corresponding definitions of HTML and Selectors, document.querySelector(':scope') can return document.documentElement (:root), which is apparently expected (wpt.fyi, WPT).

In some contexts, selectors are matched with respect to one or more scoping roots, such as when calling the querySelector() method in [DOM]. The :scope pseudo-class represents this scoping root [...]

https://drafts.csswg.org/selectors-4/#the-scope-pseudo

My understanding is that document is passed as one of the scoping roots, and that none of the candidate elements match :scope since none is included in scoping roots.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions