[csswg-drafts] [css-ui] Should inertness be exposed as CSS property? (#7021)

Loirooriol has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-ui] Should inertness be exposed as CSS property? ==
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, show 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 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7021 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 8 February 2022 00:17:41 UTC