[css-contain-3] Revisit decision to make style
the default container-type
· Issue #7066 · w3c/csswg-drafts (original) (raw)
In #6393 (comment) we resolved that:
Boxes default to style containment
@una reopened that discussion in #6393 (comment), and it was briefly discussed again in #6644 (comment) without any definitive conclusion.
It seemed like a good idea for this discussion to have its own issue.
The primary concerns on each side are:
- Keeping the
style
default makes one container type inconsistent with all other types. And while it helps with queries on inherited properties, it makescontainer-name
much more important for style queries on non-inherited properties (like background-color). - Removing the style default makes it much harder to query inherited properties, which should almost always resolve against the direct parent. Without the default value, authors are likely to add the
style
container-type to all elements with the universal selector, which is less performant.
Related, I'm curious about the details of what it means to have style
as a default. Do we mean…
- …that
style
is the initial value of the property, and any other value overrides that behavior? In this case, authors would have to write e.g.container-type: size style
in order to keep the default intact while adding other container types. That doesn't seem ideal. - …that all elements are style containers, no matter what value is applied to the property? In this case, we might not need an explicit
style
value? Or a variant might be that the default can be removed withnone
and re-applied withstyle
?