Bug 23924

Summary: getComputedStyle() on transform property should return function list
Product: WebKit Reporter: Chris Marrin <cmarrin>
Component: CSSAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: ayg, graouts, jussi.kukkonen, mrobinson, nmouchtaris, simon.fraser, webkit-bug-importer, zoltan.nyul
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
See Also: https://bugs.webkit.org/show_bug.cgi?id=245523
Bug Depends on:    
Bug Blocks: 222096, 235139, 235807, 235808    

Description Chris Marrin 2009-02-12 09:23:47 PST
Currently getComputedStyle for -webkit-transform returns matrix(...) or matrix3d(...). It should return the original function list with pixels where percents used to be, etc.
Comment 1 Martin Robinson 2022-01-04 02:22:30 PST
I believe this issue can be closed and the comment in CSSComputedStyleDeclaration.cpp can be removed because the CSS Transforms Module Level 2 specification says:

"A <transform-list> for the computed value is serialized to either one <matrix()> or one <matrix3d()> function by the following algorithm:"
Comment 2 Nikos Mouchtaris 2022-06-07 15:33:24 PDT
I think the spec you were looking at was out of date Martin. According to https://drafts.csswg.org/css-transforms/#serialization-of-transform-functions, we should be serializing the individual functions. This is related to our test failures in css/css-transforms/animation/transform-interpolation-inline-value.html.
Comment 3 Martin Robinson 2022-07-13 07:53:21 PDT
I've been investigating this a bit more and I confirmed that getComputedStyle(...).transform always returns `matrix()` or `matrix3d()` whereas div.style after running `commitStyles()` is returning the individual transform functions. In WebKit, `div.style` is returning `matrix()` and `matrix3d()` always after `commitStyles()`. I think the failure in css/css-transforms/animation/transform-interpolation-inline-value.html are probably an issue with `commitStyles()`.
Comment 4 Martin Robinson 2022-07-13 07:53:59 PDT
(In reply to Martin Robinson from comment #3)
> I've been investigating this a bit more and I confirmed that
> getComputedStyle(...).transform always returns `matrix()` or `matrix3d()`
> whereas div.style after running `commitStyles()` is returning the individual
> transform functions. In WebKit, `div.style` is returning `matrix()` and
> `matrix3d()` always after `commitStyles()`. I think the failure in
> css/css-transforms/animation/transform-interpolation-inline-value.html are
> probably an issue with `commitStyles()`.

To clarify, div.style after running `commitStyles()` is returning the individual transform functions in Firefox and Chrome.
Comment 5 Antoine Quint 2022-09-14 11:29:59 PDT
This is also an issue with getKeyframes() always returning the matrix form.
Comment 6 Antoine Quint 2022-09-14 11:36:03 PDT
I think I'll take a crack at it.
Comment 7 Antoine Quint 2022-09-15 09:28:52 PDT
I've made good progress here, still something to polish off before I can file a patch.
Comment 8 Antoine Quint 2022-09-22 02:55:38 PDT
Pull request: https://github.com/WebKit/WebKit/pull/4591
Comment 9 Antoine Quint 2022-09-22 07:26:20 PDT
The fix for this will cause a slight WPT regression tracked by bug 245523.
Comment 10 EWS 2022-09-22 10:47:26 PDT
Committed 254760@main (ae44d0ca68fa): <https://commits.webkit.org/254760@main>

Reviewed commits have been landed. Closing PR #4591 and removing active labels.
Comment 11 Radar WebKit Bug Importer 2022-09-22 10:48:24 PDT
<rdar://problem/100283235>