Bug 247245

Summary: Animation.commitStyles() doesn't change "style" attribute for individual CSS transform properties
Product: WebKit Reporter: Andrew Shcherbyna <octrace>
Component: AnimationsAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, graouts, graouts, koivisto, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Mac (Intel)   
OS: macOS 13   
See Also: https://github.com/web-platform-tests/wpt/pull/36986
Attachments:
Description Flags
Test none

Description Andrew Shcherbyna 2022-10-30 11:19:49 PDT
Visit this sandbox in Safari: https://codesandbox.io/s/commitstyles-of-individual-transforms-kk8fdy

Click 'Animate' button and wait for the animation to finish.

After the animation is complete, the element's style attribute is set to an empty string, instead of 'translate: 200px'.
Comment 1 Radar WebKit Bug Importer 2022-11-06 10:20:21 PST
<rdar://problem/102014524>
Comment 2 Antoine Quint 2022-11-15 11:37:18 PST
Created attachment 463538 [details]
Test

Attaching a single-file version of the codesandbox example.
Comment 3 Antoine Quint 2022-11-15 11:50:43 PST
The issue is in `static Ref<CSSValue> computedTranslate(RenderObject*, const RenderStyle&)` where the `rendererCanBeTransformed(renderer)` check fails because the renderer is null when called under `WebAnimation::commitStyles()`.

We should probably mirror `computedTransform()` to only check `is<RenderInline>(renderer)`.
Comment 4 Antoine Quint 2022-11-16 00:44:10 PST
Pull request: https://github.com/WebKit/WebKit/pull/6542
Comment 5 Antoine Quint 2022-11-16 00:45:01 PST
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/36986
Comment 6 EWS 2022-11-16 02:48:05 PST
Committed 256728@main (c148a252e8ff): <https://commits.webkit.org/256728@main>

Reviewed commits have been landed. Closing PR #6542 and removing active labels.