Intent to Ship: Align with Gecko and spec on grouping properties

198 views
Skip to first unread message

Chris Harrelson

unread,
Oct 29, 2020, 8:58:08 PM10/29/20
to blink-dev

Contact emails

chri...@chromium.org

Explainer


The transform-style CSS property allows the developer to say whether 3D transforms on descendants are flattened into 2D when drawing into the parent stacking context, or are instead sorted in 3D space along with ancestors. If transform-style: preserve-3d is specified, the *computed* style of transform-style is preserve-3d, but the *used* style (the one that actually takes effect when drawing to the screen) depends on whether flattening is forced by the presence of certain other CSS properties. These properties are called grouping properties. The reason this happens is because otherwise the meaning of those properties is ill-defined, since those properties only make sense when applied to a 2d bitmap.

Specification

https://drafts.csswg.org/css-transforms-2/#grouping-property-values

Summary

The CSS transforms level 2 spec requires that any grouping property causes the used value of transform-style to be flat. Chromium applies grouping for some of the specified grouping properties, but not all. This change tracked here will add: * clip * clip-path * mask * backdrop-filter * isolation


Blink component

Blink

TAG review

None - this change aligns with the spec, and with some shipped behaviors of Gecko and WebKit, for an already-well-established feature.

TAG review status

Not applicable - same reasoning as no TAG review.

Risks



Interoperability and Compatibility

The UseCounter for this change shows about 0.06% of page loads will be nominally affected by this feature. I reviewed the top 10 pages linked to from the UseCounter page, and nothing was broken. In basically all cases,

transform-style: preserve-3d was being used in a way that had no effect in the first place.


This change will align Chromium exactly with the spec. Gecko fails to flatten for backdrop-filter (because they don't implement it) and isolation. WebKit fails to flatten for backdrop-filter, isolation and mask. I plan to file a bug for both engines to fix those cases.


Gecko: No official signal, but strongly positive in offline discussions for moving towards 3D rendering interop

WebKit: No official signal, but positive in CSSWG discussions on the spec definition, as well as for interop

Web developers: No signals


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

Yes

None



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

Yes: external/wpt/css/css-transforms/preserve-3d-flat-grouping-properties.tentative.html

Tracking bug

https://crbug.com/1008483

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5647948924846080

This intent message was generated by Chrome Platform Status.

Vladimir Levin

unread,
Oct 30, 2020, 11:06:31 AM10/30/20
to Chris Harrelson, blink-dev

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

Yes: external/wpt/css/css-transforms/preserve-3d-flat-grouping-properties.tentative.html


It sounds like this is a well established, and well specified feature. Is there a reason why the test is "tentative"?

Chris Harrelson

unread,
Oct 30, 2020, 11:31:29 AM10/30/20
to Vladimir Levin, blink-dev
I plan to remove the ".tentative" as part of shipping. 

--
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/CADsXd2NT0C5ggN-U3hY88%3DRCoHrQfjYAXmepbtVTFAcPf2MzGQ%40mail.gmail.com.

Manuel Rego Casasnovas

unread,
Nov 2, 2020, 4:17:10 AM11/2/20
to blin...@chromium.org
LGTM1

Some inline comments.

On 30/10/2020 01:57, Chris Harrelson wrote:
> Interoperability and Compatibility
>
> The UseCounter
> <https://chromestatus.com/metrics/feature/timeline/popularity/3297> for
> this change shows about 0.06% of page loads will be nominally affected
> by this feature. I reviewed
> <https://docs.google.com/document/d/1_Z2Q_fYyhIkmL_u1EDHA6J0R7u33TIQizzsPZwM67gw/edit>
> the top 10 pages linked to from the UseCounter page, and nothing was
> broken. In basically all cases,
>
> transform-style: preserve-3d was being used in a way that had no effect
> in the first place.

Thanks for the web compat analysis, it looks like no issues were found
so that's great.

> This change will align Chromium exactly with the spec. Gecko fails to
> flatten for backdrop-filter (because they don't implement it) and
> isolation. WebKit fails to flatten for backdrop-filter, isolation and
> mask. I plan to file a bug for both engines to fix those cases.

Yes, please fill the bugs for them.

Checking the results at wpt.fyi [1] it looks like WebKit also fails for
"opacity" and also the last test case is failing there.

> Is this feature fully tested by web-platform-tests
> <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md>?
>
> Yes: external/wpt/css/css-transforms/preserve-3d-flat-grouping-properties.tentative.html

IIUC Chromium will be passing all those test cases once this ships.

And as mentioned in the previous mail rename to to remove "tentative"
suffix.

Bye,
Rego

[1]
https://wpt.fyi/results/css/css-transforms/preserve-3d-flat-grouping-properties.tentative.html?label=experimental&label=master&aligned

Yoav Weiss

unread,
Nov 2, 2020, 4:31:01 AM11/2/20
to Manuel Rego Casasnovas, blink-dev
LGTM2

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

Alex Russell

unread,
Nov 5, 2020, 3:19:11 PM11/5/20
to blink-dev, yo...@yoav.ws, blink-dev, Manuel Rego
LGTM3
Reply all
Reply to author
Forward
0 new messages