Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getComputedStyle() on transform property should return function list #4591

Conversation

graouts
Copy link
Contributor

@graouts graouts commented Sep 22, 2022

ae44d0c

getComputedStyle() on transform property should return function list
https://bugs.webkit.org/show_bug.cgi?id=23924

Reviewed by Antti Koivisto.

We should serialize the "transform" property to a series of individual functions to match
the individual operations found in the TransformOperations value. To determine when we should
be doing this, we pass a nullptr value as the renderer when calling valueForPropertyInStyle()
on the ComputedStyleExtractor in KeyframeEffect::getKeyframes() and WebAnimation::commitStyles().

Note the slight regression with first-letter and first-line tests where we now expose the "transform"
property not being rejected at parse-time, bug 245523 will address this.

* LayoutTests/imported/w3c/web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-letter-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-line-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-computed-value-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-inline-value-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt:
* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::getKeyframes):
* Source/WebCore/animation/WebAnimation.cpp:
(WebCore::WebAnimation::commitStyles):
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::computedTransform):

Canonical link: https://commits.webkit.org/254760@main

84f06ce

Misc iOS, tvOS & watchOS macOS Linux Windows
❌ πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  πŸ§ͺ win
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim   πŸ›  mac-debug βœ… πŸ›  gtk βœ… πŸ›  wincairo
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-gtk
  πŸ›  tv   πŸ§ͺ mac-wk1
  πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2
❌ πŸ›  πŸ§ͺ merge   πŸ›  watch   πŸ§ͺ mac-AS-debug-wk2
  πŸ›  watch-sim βœ… πŸ§ͺ mac-wk2-stress

@graouts graouts self-assigned this Sep 22, 2022
@graouts graouts added 528+ (Nightly build) CSS Cascading Style Sheets implementation labels Sep 22, 2022
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Sep 22, 2022
@graouts
Copy link
Contributor Author

graouts commented Sep 22, 2022

The two regressions on ::first-letter and ::first-line stem from the fact that we do not seem to have a notion of allow-list for these like we do with ::marker or ::cue (see PropertyAllowList.cpp) and since we now deal with null renderers in ComputedStyleExtractor the transform returns the provided value which is not rejected at parse-time.

@anttijk do you think this is an acceptable change? It really only manifests itself through the computed style. We should add an allow-list for ::first-letter and ::first-line.

@graouts graouts force-pushed the bug-23924-transform-serialization branch from cd50a8f to 84f06ce Compare September 22, 2022 14:26
FAIL KeyframeEffect.getKeyframes() returns expected values for animations with CSS variables as keyframe values assert_equals: value for 'transform' on Keyframe #1 should match expected "translate(100px)" but got "matrix(1, 0, 0, 1, 100, 0)"
FAIL KeyframeEffect.getKeyframes() returns expected values for animations with CSS variables as keyframe values assert_equals: value for 'transform' on Keyframe #1 should match expected "translate(100px)" but got "translate(100px, 0px)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still not entirely canonical?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there seems to be some differences between expected serialization that I haven't fully worked out. Fixing this is the next item on my to-do list.

@graouts graouts added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged labels Sep 22, 2022
https://bugs.webkit.org/show_bug.cgi?id=23924

Reviewed by Antti Koivisto.

We should serialize the "transform" property to a series of individual functions to match
the individual operations found in the TransformOperations value. To determine when we should
be doing this, we pass a nullptr value as the renderer when calling valueForPropertyInStyle()
on the ComputedStyleExtractor in KeyframeEffect::getKeyframes() and WebAnimation::commitStyles().

Note the slight regression with first-letter and first-line tests where we now expose the "transform"
property not being rejected at parse-time, bug 245523 will address this.

* LayoutTests/imported/w3c/web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-letter-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-line-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-computed-value-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-inline-value-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt:
* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::getKeyframes):
* Source/WebCore/animation/WebAnimation.cpp:
(WebCore::WebAnimation::commitStyles):
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::computedTransform):

Canonical link: https://commits.webkit.org/254760@main
@webkit-commit-queue
Copy link
Collaborator

Committed 254760@main (ae44d0c): https://commits.webkit.org/254760@main

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

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Sep 22, 2022
@graouts graouts deleted the bug-23924-transform-serialization branch September 22, 2022 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Cascading Style Sheets implementation
Projects
None yet
5 participants