Bug 235028 - [Web Animations] getKeyframes() for a CSS Animation should not use computed style for keyframes (part 2)
Summary: [Web Animations] getKeyframes() for a CSS Animation should not use computed s...
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
Depends on:
Blocks: 235138
  Show dependency treegraph
 
Reported: 2022-01-10 04:59 PST by Antoine Quint
Modified: 2022-01-12 12:34 PST (History)
4 users (show)

See Also:


Attachments
Patch (11.68 KB, patch)
2022-01-10 05:04 PST, Antoine Quint
koivisto: review+
ews-feeder: commit-queue-
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-10 04:59:14 PST
getKeyframes() should not use the computed value for animated properties
Comment 1 Antoine Quint 2022-01-10 05:04:18 PST
Created attachment 448734 [details]
Patch
Comment 2 Antti Koivisto 2022-01-10 06:00:02 PST
Comment on attachment 448734 [details]
Patch

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

> Source/WebCore/animation/KeyframeEffect.cpp:674
> +                if (m_pseudoId == PseudoId::None)
> +                    return styleResolver.styleRulesForElement(target, Style::Resolver::AllCSSRules);
> +                return styleResolver.pseudoStyleRulesForElement(target, m_pseudoId, Style::Resolver::AllCSSRules);

You can just call pseudoStyleRulesForElement with PseudoId::None.

Note that this does style resolution. I suppose it doesn't matter here that this is slow?
Comment 3 Antoine Quint 2022-01-10 07:05:37 PST
(In reply to Antti Koivisto from comment #2)
> Comment on attachment 448734 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=448734&action=review
> 
> > Source/WebCore/animation/KeyframeEffect.cpp:674
> > +                if (m_pseudoId == PseudoId::None)
> > +                    return styleResolver.styleRulesForElement(target, Style::Resolver::AllCSSRules);
> > +                return styleResolver.pseudoStyleRulesForElement(target, m_pseudoId, Style::Resolver::AllCSSRules);
> 
> You can just call pseudoStyleRulesForElement with PseudoId::None.

Cool! I'll change that.

> Note that this does style resolution. I suppose it doesn't matter here that
> this is slow?

Not a concern at all.

Would you have some tips to obtain a CSSValue with substituted variables? That's the last piece of this puzzle.
Comment 4 Antoine Quint 2022-01-10 07:09:26 PST
Committed r287835 (245887@trunk): <https://commits.webkit.org/245887@trunk>
Comment 5 Radar WebKit Bug Importer 2022-01-10 07:10:23 PST
<rdar://problem/87338875>