Changeset 290655 in webkit


Ignore:
Timestamp:
Mar 1, 2022 10:14:37 AM (5 months ago)
Author:
graouts@webkit.org
Message:

[web-animations] add support for passing an optional timeline to Element.animate()
https://bugs.webkit.org/show_bug.cgi?id=237312

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

  • web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt:

Source/WebCore:

  • animation/KeyframeAnimationOptions.h:
  • animation/KeyframeAnimationOptions.idl:
  • dom/Element.cpp:

(WebCore::Element::animate):

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r290651 r290655  
     12022-03-01  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] add support for passing an optional timeline to Element.animate()
     4        https://bugs.webkit.org/show_bug.cgi?id=237312
     5
     6        Reviewed by Dean Jackson.
     7
     8        * web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt:
     9
    1102022-02-28  Jonathan Bedard  <jbedard@apple.com>
    211
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt

    r289048 r290655  
    134134PASS Element.animate() correctly sets the Animation's timeline with no timeline parameter in KeyframeAnimationOptions.
    135135PASS Element.animate() correctly sets the Animation's timeline with undefined timeline in KeyframeAnimationOptions.
    136 FAIL Element.animate() correctly sets the Animation's timeline with null timeline in KeyframeAnimationOptions. assert_equals: Animation timeline should be null expected null but got object "[object DocumentTimeline]"
     136PASS Element.animate() correctly sets the Animation's timeline with null timeline in KeyframeAnimationOptions.
    137137PASS Element.animate() correctly sets the Animation's timeline with DocumentTimeline in KeyframeAnimationOptions.
    138138PASS Element.animate() calls play on the Animation
  • trunk/Source/WebCore/ChangeLog

    r290650 r290655  
     12022-03-01  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] add support for passing an optional timeline to Element.animate()
     4        https://bugs.webkit.org/show_bug.cgi?id=237312
     5
     6        Reviewed by Dean Jackson.
     7
     8        * animation/KeyframeAnimationOptions.h:
     9        * animation/KeyframeAnimationOptions.idl:
     10        * dom/Element.cpp:
     11        (WebCore::Element::animate):
     12
    1132022-03-01  Commit Queue  <commit-queue@webkit.org>
    214
  • trunk/Source/WebCore/animation/KeyframeAnimationOptions.h

    r290123 r290655  
    2828#include "AnimationFrameRate.h"
    2929#include "AnimationFrameRatePreset.h"
     30#include "AnimationTimeline.h"
    3031#include "KeyframeEffectOptions.h"
    3132
     
    3435struct KeyframeAnimationOptions : KeyframeEffectOptions {
    3536    String id;
     37    std::optional<RefPtr<AnimationTimeline>> timeline;
    3638    std::variant<FramesPerSecond, AnimationFrameRatePreset> frameRate;
    3739};
  • trunk/Source/WebCore/animation/KeyframeAnimationOptions.idl

    r290123 r290655  
    2828dictionary KeyframeAnimationOptions : KeyframeEffectOptions {
    2929    DOMString id = "";
     30    [EnabledBySetting=WebAnimationsMutableTimelinesEnabled] AnimationTimeline? timeline;
    3031    [EnabledBySetting=WebAnimationsCustomFrameRateEnabled] (FramesPerSecond or AnimationFrameRatePreset) frameRate = "auto";
    3132};
  • trunk/Source/WebCore/dom/Element.cpp

    r290646 r290655  
    46864686{
    46874687    String id = "";
     4688    std::optional<RefPtr<AnimationTimeline>> timeline;
    46884689    std::variant<FramesPerSecond, AnimationFrameRatePreset> frameRate = AnimationFrameRatePreset::Auto;
    46894690    std::optional<std::variant<double, KeyframeEffectOptions>> keyframeEffectOptions;
     
    46974698            id = keyframeEffectOptions.id;
    46984699            frameRate = keyframeEffectOptions.frameRate;
     4700            timeline = keyframeEffectOptions.timeline;
    46994701            keyframeEffectOptionsVariant = WTFMove(keyframeEffectOptions);
    47004702        }
     
    47084710    auto animation = WebAnimation::create(document(), &keyframeEffectResult.returnValue().get());
    47094711    animation->setId(id);
     4712    if (timeline)
     4713        animation->setTimeline(timeline->get());
    47104714    animation->setBindingsFrameRate(WTFMove(frameRate));
    47114715
Note: See TracChangeset for help on using the changeset viewer.