Intent to Ship: Add containerName and containerQuery, update conditionText

142 views
Skip to first unread message

Daniil Sakhapov

unread,
Jan 17, 2023, 11:31:42 AM1/17/23
to blin...@chromium.org

Contact emails

sakh...@chromium.org

Specification

https://w3c.github.io/csswg-drafts/css-contain-3/#the-csscontainerrule-interface

Summary

Updates the CSSContainerRule interface to match the specs. Implements containerName and containerQuery, updates conditionText for @container to be up-to-date with specs.


Blink component

Blink>CSS

TAG review

https://github.com/w3ctag/design-reviews/issues/592

TAG review status

Issues addressed

Risks


Activation

Previous conditionText attribute contained only container-query part, but now it's both container-name and container-query. But it should not break a lot of sites due to low current usage as per: https://chromestatus.com/metrics/css/timeline/popularity/697 https://chromestatus.com/metrics/css/timeline/popularity/699 The real breakage is hard to measure, as it's not possible to track the how result of conditionText is used and the usage of container-name is low compared to the container-type usage. Also, conditionText is readonly, so there are no round-trip issues


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

Yes

Alex Russell

unread,
Jan 18, 2023, 12:04:55 PM1/18/23
to blink-dev, Daniil Sakhapov
Hey Daniil:

Thanks for filing for this change while the feature is still low-use; it'll be much more challenging to make this switch later.

Something that wasn't clear from the use counters you linked was the use of the IDL properties vs. the CSS names. Given that it seems like we have use-counters for the latter but not the former, it seems reasonable to consider CSS usage to be a hard cap on potential use of the JS interface.

Would you be willing to manually inspect some content (say 10-20 sites) that use the CSS `container-name` and `container-query` attributes to look for script access? Presumably it's a fraction that population, but verifying would be helpful.

Thanks

Daniil Sakhapov

unread,
Jan 23, 2023, 5:36:01 AM1/23/23
to Alex Russell, blink-dev
Hi!

So, I haven't found any usage on the websites chromestatus gave me.
But looking at WebArchive results I can see that the usage is very small and the update won't change anything.

Daniil Sakhapov

unread,
Jan 24, 2023, 6:48:55 AM1/24/23
to Alex Russell, blink-dev
And another query for @container + conditionText. There are no things that can be broken.

https://docs.google.com/spreadsheets/d/1ILyBkGLud7fy4kXjlLURELhcMRAPqdEWz8X8J25SfDY/edit?usp=sharing

Philip Jägenstedt

unread,
Jan 24, 2023, 9:19:25 AM1/24/23
to Daniil Sakhapov, Alex Russell, blink-dev
LGTM1

Thanks Daniil for that httparchive analysis. The second one looking for use of the @container rule should include all cases that could matter. 56 unique matches is a very small number when it comes to httparchive compat analysis. I double checked just one of them (botaniska.se, a nice park in Gothenburg!) and indeed that usage doesn't even involve CSSContainerRule. When we're unable to find even a single case that would break, that's as good as it gets for compat risk.

Let's ship it before something starts to depend on the old behavior!

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAH3Z92_u4JkFfr4KE-z_Xyt9x_T3Jks40xiEs5vNjcwBsurjjQ%40mail.gmail.com.

Mike Taylor

unread,
Jan 24, 2023, 10:27:48 AM1/24/23
to Philip Jägenstedt, Daniil Sakhapov, Alex Russell, blink-dev

Rick Byers

unread,
Jan 24, 2023, 12:21:49 PM1/24/23
to Mike Taylor, Philip Jägenstedt, Daniil Sakhapov, Alex Russell, blink-dev
Looks to be a very low risk update to a brand new feature, LGTM3

But what do we know about the other implementations with respect to this change? For any which haven't yet updated, are there bugs tracking it?

Daniil Sakhapov

unread,
Jan 24, 2023, 12:41:54 PM1/24/23
to Rick Byers, Mike Taylor, Philip Jägenstedt, Daniil Sakhapov, Alex Russell, blink-dev
Hi, Rick!

Thanks! Not sure I understand what you mean.

Rick Byers

unread,
Jan 24, 2023, 1:00:25 PM1/24/23
to Daniil Sakhapov, Mike Taylor, Philip Jägenstedt, Daniil Sakhapov, Alex Russell, blink-dev
Sorry I wasn't clear. I mean that WebKit and Gecko have implementations of container queries, do they already support these properties? If not, we want to ensure they're aware of the spec change and have open bugs tracking making updates to their engines to reduce the likely time period for inconsistent behavior between browsers especially since there's some web compat risk around conditionText.

In general we're looking for signals from the other engines. This is what the Safari and Firefox signals portion of the status entry are for, but yours are both blank. In this case it's a tiny change approved by the CSSWG so I'm not too worried (hence my LGTM without blocking), but the principle of evolving the web together with the other engines still applies.

Thanks,
   Rick

Daniil Sakhapov

unread,
Jan 24, 2023, 2:03:19 PM1/24/23
to Rick Byers, Mike Taylor, Philip Jägenstedt, Daniil Sakhapov, Alex Russell, blink-dev
Now I see, thanks!

Firefox has updated their implementation and is up-to-date.
Safari hasn't done anything yet from what I can tell. I will ping them.

Long live the web platform!

Rick Byers

unread,
Jan 24, 2023, 4:22:15 PM1/24/23
to Daniil Sakhapov, Mike Taylor, Philip Jägenstedt, Daniil Sakhapov, Alex Russell, blink-dev
Thanks Danil. Great, that means you can mark 'Firefox' as 'shipping' in chromestatus. For Safari ideally you'd link to a WebKit bug tracking this, but regardless (even if they say something positive) the signal stays as "no signal" (unless they too are shipping or have an official standards position entry - which seems like overkill here). 

Rick
Reply all
Reply to author
Forward
0 new messages