Bug 234792 - "animation" shorthand should list all longhand values when serializing
Summary: "animation" shorthand should list all longhand values when serializing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar, WebExposed
Depends on:
Blocks: 235138
  Show dependency treegraph
 
Reported: 2022-01-02 00:26 PST by Antoine Quint
Modified: 2022-01-12 12:40 PST (History)
11 users (show)

See Also:


Attachments
Patch (32.79 KB, patch)
2022-01-02 00:32 PST, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (33.57 KB, patch)
2022-01-02 02:50 PST, Antoine Quint
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2022-01-02 00:26:44 PST
"animation" shorthand should list all longhand values when serializing
Comment 1 Antoine Quint 2022-01-02 00:32:15 PST
Created attachment 448170 [details]
Patch
Comment 2 Antoine Quint 2022-01-02 02:50:35 PST
Created attachment 448171 [details]
Patch
Comment 3 Darin Adler 2022-01-02 11:44:42 PST
Comment on attachment 448171 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=448171&action=review

> Source/WebCore/css/parser/CSSPropertyParser.cpp:1662
> +                if (property == CSSPropertyAnimationDuration)

We can and should make this code less repetitive. One function to turn a property into a value, rather than repeating the append calls. Can just take a property ID as an argument and return a Ref<>. A lambda if you prefer but I think a separate named function would be good.
Comment 4 Antoine Quint 2022-01-03 02:01:07 PST
Committed r287534 (245669@trunk): <https://commits.webkit.org/245669@trunk>
Comment 5 Radar WebKit Bug Importer 2022-01-03 02:02:21 PST
<rdar://problem/87062031>
Comment 6 Antoine Quint 2022-01-03 02:15:13 PST
(In reply to Darin Adler from comment #3)
> Comment on attachment 448171 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=448171&action=review
> 
> > Source/WebCore/css/parser/CSSPropertyParser.cpp:1662
> > +                if (property == CSSPropertyAnimationDuration)
> 
> We can and should make this code less repetitive. One function to turn a
> property into a value, rather than repeating the append calls. Can just take
> a property ID as an argument and return a Ref<>. A lambda if you prefer but
> I think a separate named function would be good.

I landed the patch as-is but would like to address this, however I don't understand what you're driving at. Are you thinking of a function like this?

void ComputedStyleExtractor::addValueForAnimationPropertyToList(CSSPropertyID, CSSValueList&)

This could be useful also for the changes made for bug 234785. I'll probably make a followup to refactor once bug 234785 lands.
Comment 7 Antoine Quint 2022-01-03 04:14:49 PST
Refactoring is happening in bug 234812.