Skip to content

[css-ui] Should inertness be exposed as CSS property? #7021

Closed
@Loirooriol

Description

@Loirooriol

When discussing the inert attribute for HTML, there was some controversy about whether inertness should be propagated to descendants in the flat tree, or to shadow-including descendants.

@rniwa argued that semantic content attributes (like contenteditable, lang, etc.) don't use the flat tree.

@othermaciej argued that inert needs to operate on the flat tree to have its functional effect.

The current situation is that all Blink, WebKit and Gecko implement inertness as part of the computed style, so it propagates in the flat tree, like the CSS cascade. Also, in #6685 we resolved that the effect of inertness can be mostly explained by setting existing CSS properties like pointer-events.

So given the highly presentational nature of inertness, @rniwa proposed that maybe inert should actually be a CSS property:

the correct course of action is to introduce a new CSS property which specifies inertness in CSS since that seems like the most natural mechanism to set inertness anyway. I don’t see any strong reason not to add such a CSS property given most use cases for “inert” seems to involve modifying the style of an element at the same time as inertness.

@cookiecrook argued that it should still be an attribute, but wasn't opposed to also having a reflecting CSS property.

This would be consistent with hidden, which maps to display: none and then works in the flat tree.

Then, should we add this property? Since descendants are not supposed to escape inertness, I guess it would be a non-inherited property that would be propagated to descendants somewhat like text-decoration.

CC @nt1m, @emilio, @chrishtr

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