Skip to content

[css-display] Explicitly note display:contents does not affect inheritance #1473

Closed
@Loirooriol

Description

@Loirooriol

display: contents has this note

As only the box tree is affected, any semantics based on the document tree, such as selector-matching and event handling, are not affected.

This is kinda obvious: if display: contents can be set to an element via selector-matching, it shouldn't affect selector-matching. And event handling is entirely a DOM thingie.

CSS Cascade says inheritance follows the document tree but that's a blatant lie, e.g. ::first-line intercepts inheritance for some properties, and it is based on the box tree. Therefore, I don't think it's obvious at all that children elements of a display: contents still inherit from it.

So please note style inheritance is not affected by display: contents neither.

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