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

> 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.

FWIW I think `lang` in Gecko is implemented as a CSS property and thus would inherit in the flat tree (though interestingly we don't use the flat tree to get the language for selector-matching [here](https://searchfox.org/mozilla-central/rev/8e1eb5cbd89a2455c34032d921f8de28261d016b/dom/base/FragmentOrElement.cpp#291-313), so it's a bit inconsistent).

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

I agree, fwiw. It'd be pretty weird otherwise.

> 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`.

That model seems a bit unfortunate, it would cause us either having to do a tree walk at used value time to query inertness, or be one of these "not-inherited but kinda" properties that introduce special-cases in the CSS engines (like https://github.com/w3c/csswg-drafts/issues/3344).

Given there's no point in making something non-inert inside something inert (except for modal `<dialog>` I guess) I'd rather not add a CSS property, tbh.

-- 
GitHub Notification of comment by emilio
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7021#issuecomment-1033039431 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 20:37:48 UTC