Look up query containers in the flat tree ancestor order instead of shadow-including order. The specification for container queries changed to look up flat tree ancestors. This change is only relevant for shadow DOM where an element will now be able to see non-named containers inside shadow trees into which the element or one of its ancestors are slotted, even if the CSS rule does not use ::part() or ::slotted().
The existing implementation for container units was somewhat broken in the sense that container unit lengths would find a container based on the styled element's tree scope instead of the rule's tree scope. That meant you can end up with container units inside container queries that did not use the same container as a basis for such sizes.
Example: padding-left and padding-right would be based on the same container here (the #host), even if their @container queries would match different containers:
Interoperability: Firefox shipped with an implementation matching the current spec for ancestor lookup from the start. This is aligning with their implementation. The signal from Safari is positive. Compatibility risks: Mainly that lookup of non-named containers for slotted element subtrees can now start matching containers in the shadow tree they are slotted into. For named containers, matching tree scoped references will make sure it is kept close to the current behavior. Attempting to create a use counter for this change has failed to be done in a performant manner without slightly changing the existing behavior. According to Firefox they have not seen issues with their implementation, which indicates a lower risk.
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
The container lookup in devtools uses the same functionality as the engine. Confirmed that the container lookup in the styles pane matches the new behavior with the flag enabled.
https://wpt.fyi/results/css/css-conditional/container-queries/container-for-shadow-dom.html https://wpt.fyi/results/css/css-conditional/container-queries/container-units-shadow.html https://wpt.fyi/results/css/css-conditional/container-queries/style-container-for-shadow-dom.html
Shipping on desktop | 130 |
DevTrial on desktop | 128 |
Shipping on Android | 130 |
DevTrial on Android | 128 |
Shipping on WebView | 130 |
Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).
None
Finch feature name
Generated from CSSFlatTreeContainer in runtime_enabled_features.json5
Requires code in //chrome?
False
Tracking bug
https://crbug.com/340876720
Estimated milestones
Shipping on desktop 130 DevTrial on desktop 128 Shipping on Android 130 DevTrial on Android 128 Shipping on WebView 130 Anticipated spec changes
Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).
NoneLink to entry on the Chrome Platform Status
https://chromestatus.com/feature/5242724333387776?gate=6649713206755328
This intent message was generated by Chrome Platform Status.
--
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/CACuPfeSd1%2BJTn6EZtFKxTBzEvp3eG8o-vw1z48sZgBD6PhyaLw%40mail.gmail.com.
LGTM1, with nit about Chrome Platform Status info accuracy below.On Fri, Aug 16, 2024 at 10:31 PM Rune Lillesveen <fut...@chromium.org> wrote:
Flag name on chrome://flags
CSSFlatTreeContainer
I navigated to chrome://flags and did not see any flag for this behavior. I think you likely have no flag in chrome://flags, and instead you should enter CSSFlatTreeContainer as the Finch feature name.
LGTM3
/Daniel
--
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/CACuPfeSxx0yLqt2ms2J_KSApMpmAUZAFVi48tdK4Kza9dPd-Vg%40mail.gmail.com.