[csswg-drafts] [css-contain-3] Move style queries of standard properties to level 4 (#7185)

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

== [css-contain-3] Move style queries of standard properties to level 4 ==
Style queries for standard (non-custom) properties are currently severely underspecified and have many open questions in terms of behavior, implementability and usefulness.

Some examples:

How does `style(width: calc(…))` behave? 

Will authors understand why this (or any particular value syntax) is available with `style()` but not with the usual size query syntax `()` especially when feature and property names are the same? 

As far as I know there is no definition of “equality” in general between the computed style and some arbitrary author property value. Engines have some internal notion of equality between two computed styles but that doesn’t seem sufficient here. This would need to be fully specified in all cases.

How about shortcut properties?

What happens with `style(color:inherit)` or say `style(color:revert-layer)`? Are we supposed to run full style resolution pipeline in middle of selector matching to determine the value being queried? Based on https://github.com/w3c/csswg-drafts/issues/7080 it sounds like there are plans to limit some but not all global values. How do authors know what is allowed? 

Possible spec/implementation shortcuts for above (“just serialize and use string equality”) have major performance concerns.

Is this feature useful as specified? Exact equality is very limiting. Many interesting properties are numbers or multidimensional objects like colors. Size queries support ranges for a reason.

How does this interact with animations? Accelerated ones where style is not resolved for every frame?

There is a huge testing matrix for this with 600+ properties (and infinite amount of complex values). 

It seems to me that this feature as specified adds a massive amount of complexity for very limited utility. A serious implementation effort would surely find way more questions. 

Container queries without style queries (or style queries limited to custom properties/variables) offers a nice set of functionality. It seems unwise to delay those features in pursuit of this.


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


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

Received on Thursday, 31 March 2022 12:48:42 UTC