Re: [csswg-drafts] [css-transforms-2] Is it necessary to serialize all 3 components of translate given the 3rd component is 0px (#3305)

> Any chance of us being able to stop doing the "`transform: translateZ(0);` causes rendering differences" behavior, since it's theoretically a no-op transform?

This issue is about the `translate`, `rotate`, `scale` properties, not the `transform` property's functions.  The suggestion is not that Blink change the `transform` property "non-binding hint" behavior; simply that `translate` etc. need not carry that behavior forwards as there is no web-compat need; authors can use `will-change` (or a paused animation) as a standards-based approach.

> That said, it would still be quite bad if, in WK/Blink, the element flipped from 3d to 2d in the middle of an animation, triggering all the weirdness of being demoted and then promoted again

That doesn't happen, at least in Blink. We detect that the property is animating.

More Blink implementation detail:

If an individual transform property has a [non-zero 3D component](https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/style/computed_style.h?rcl=fc5ad208c5a028f8e15a175aefd0134823dafd8b&l=2229) (or transform has a 3D function), Blink records a compositing reason: having a [current 3D transform](https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/paint/compositing/compositing_reason_finder.cc?rcl=c1f3da8b2bba38b595654eeec77baf77f9df15f1&l=65).

If an individual transform property (or transform) is [animating](https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/animation/element_animations.cc?rcl=57fcf0ab56ec160ddcde4f198e0e27ae630ec985&l=48), Blink records a compositing reason: having a [current transform animation](https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/paint/compositing/compositing_reason_finder.cc?rcl=fc5ad208c5a028f8e15a175aefd0134823dafd8b&l=216).

If an individual transform property (or transform) is [mentioned in will-change](https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/style/computed_style.cc?rcl=39c765b9253137fcb18c735ed41a4286edf3cb15&l=1067), Blink records a compositing reason: having a [will-change transform hint](https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/paint/compositing/compositing_reason_finder.cc?rcl=fc5ad208c5a028f8e15a175aefd0134823dafd8b&l=233).

Any of these compositing reasons, and others, are sufficient to cause 3D behavior.

There are exploratory Blink CLs to record in the computed style if the individual transform has a supplied 3D component. These complicate animation implementation for no benefit other than
carrying forward to individual transform properties the `translateZ(0)` hint that predates `will-change`.





-- 
GitHub Notification of comment by ewilligers
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3305#issuecomment-539834192 using your GitHub account

Received on Wednesday, 9 October 2019 05:14:02 UTC