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

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

I don't understand the question - what do you think is undefined about this?

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

Transitions already rely on the concept of equality between computed values; this uses the exact same concept. (To the extent that Transitions is underdefined, this is too, but that's a decade+ old issue that we've muddled thru so far.)

> How about shorthand properties?

Recently answered in <https://github.com/w3c/csswg-drafts/commit/2e215a09af801bc53e0bad0d5768ab9e8bcb4572>

> What happens with style(color:inherit) or say style(color:revert-layer)? 

As noted in #7080, 'inherit', 'initial', and 'unset' are allowed, as they don't require cascade resolution (and it's useful to be able to compare a property against its inherited value). 'revert' and 'revert-layer' are disallowed. (Specified now in <https://github.com/w3c/csswg-drafts/commit/bb594b71daff9a2b290b2f89b533e7fecce8018e>.)

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

Ranges are a useful expansion of the feature that we can do in the future, but as it stands the feature is still useful; see the perennial use-case for "be italic, unless the surrounding text is italic in which case be normal", for example.

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

Animations affect the computed value, so it'll check against those. Some frame delays in accelerated animations are quality-of-implementation and fine; this sort of lag is common to many features that interact with animations.

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

For the most part the difficult parts of this are already implicated by Transitions, as far as I can tell. If there are hard parts beyond that, we can def look at deferring those bits. But the spec at this point is pretty much complete, so while it might make sense to mark it at risk, there doesn't seem to be much benefit to pushing it to the next level just yet. If an implementer wants to take it on, it's as ready to implement as the rest of the spec.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7185#issuecomment-1085196467 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 22:36:49 UTC