Bug 247245 - Animation.commitStyles() doesn't change "style" attribute for individual CSS transform properties
Summary: Animation.commitStyles() doesn't change "style" attribute for individual CSS ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: Safari 16
Hardware: Mac (Intel) macOS 13
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-10-30 11:19 PDT by Andrew Shcherbyna
Modified: 2022-11-16 02:48 PST (History)
5 users (show)

See Also:


Attachments
Test (428 bytes, text/html)
2022-11-15 11:37 PST, Antoine Quint
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.