[webkit-reviews] review granted: [Bug 209415] [Web Animations] ElementAnimationRareData is created too frequently : [Attachment 394252] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 23 04:38:15 PDT 2020


Antti Koivisto <koivisto at iki.fi> has granted Antoine Quint
<graouts at apple.com>'s request for review:
Bug 209415: [Web Animations] ElementAnimationRareData is created too frequently
https://bugs.webkit.org/show_bug.cgi?id=209415

Attachment 394252: Patch

https://bugs.webkit.org/attachment.cgi?id=394252&action=review




--- Comment #3 from Antti Koivisto <koivisto at iki.fi> ---
Comment on attachment 394252
  --> https://bugs.webkit.org/attachment.cgi?id=394252
Patch

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

> Source/WebCore/animation/AnimationTimeline.cpp:226
> +    if (const auto* transitions = element.transitions()) {

No particular reason to spell out const here explicitly.

> Source/WebCore/dom/Element.cpp:3833
> +const PropertyToTransitionMap* Element::completedTransitionsByProperty()
const
> +{
> +    if (auto* animationData = animationRareData())
> +	   return &animationRareData()->completedTransitionsByProperty();
> +    return nullptr;
> +}
> +
> +const PropertyToTransitionMap* Element::runningTransitionsByProperty() const
> +{
> +    if (auto* animationData = animationRareData())
> +	   return &animationRareData()->runningTransitionsByProperty();
> +    return nullptr;
> +}

Instead of exposing the maps, perhaps you could just have 

RefPtr<CSSTransition> Element::completedTransitionForProperty(CSSProperty)

Seems like that's the only thing these are used for and it would simplify the
call sites.


More information about the webkit-reviews mailing list