Skip to content

[cssom-view] element.checkVisibility() should query the flat tree not shadow-including ancestors #9486

@nt1m

Description

@nt1m

https://drafts.csswg.org/cssom-view/#dom-element-checkvisibility

The spec mentions "shadow-including ancestor" multiple times, but this doesn't match CSS rendering. CSS rendering uses the flat tree, not the shadow-including tree.

This makes a difference when you involve slots.

In fact it looks like Chrome uses the flat tree in the implementation too: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/element.cc;l=9073?q=Element::checkVisibility&ss=chromium

cc @tabatkins @josepharhar @vmpstr

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions