Changeset 224127 in webkit


Ignore:
Timestamp:
Oct 27, 2017 1:17:53 PM (7 years ago)
Author:
graouts@webkit.org
Message:

[Web Animations] Use Seconds vs. MonotonicTime to represent times
https://bugs.webkit.org/show_bug.cgi?id=178950

Reviewed by Dean Jackson.

Animation start times, all expressed in seconds, in the Web Animations API are relative to the timeline
originTime, itself relative to the page's nagigation time (Performance.navigationTime), so it makes more
sense to use Seconds to represent them as opposed to a MonotonicTime.

  • animation/WebAnimation.cpp:

(WebCore::WebAnimation::bindingsStartTime const):
(WebCore::WebAnimation::setBindingsStartTime):

  • animation/WebAnimation.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r224125 r224127  
     12017-10-27  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Use Seconds vs. MonotonicTime to represent times
     4        https://bugs.webkit.org/show_bug.cgi?id=178950
     5
     6        Reviewed by Dean Jackson.
     7
     8        Animation start times, all expressed in seconds, in the Web Animations API are relative to the timeline
     9        originTime, itself relative to the page's nagigation time (Performance.navigationTime), so it makes more
     10        sense to use Seconds to represent them as opposed to a MonotonicTime.
     11
     12        * animation/WebAnimation.cpp:
     13        (WebCore::WebAnimation::bindingsStartTime const):
     14        (WebCore::WebAnimation::setBindingsStartTime):
     15        * animation/WebAnimation.h:
     16
    1172017-10-27  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WebCore/animation/WebAnimation.cpp

    r223883 r224127  
    6262{
    6363    if (m_startTime)
    64         return m_startTime->secondsSinceEpoch().value();
     64        return m_startTime->value();
    6565    return std::nullopt;
    6666}
     
    7171        m_startTime = std::nullopt;
    7272    else
    73         m_startTime = MonotonicTime::fromRawSeconds(startTime.value());
     73        m_startTime = Seconds(startTime.value());
    7474}
    7575
  • trunk/Source/WebCore/animation/WebAnimation.h

    r223883 r224127  
    2727
    2828#include <wtf/Forward.h>
    29 #include <wtf/MonotonicTime.h>
    3029#include <wtf/Optional.h>
    3130#include <wtf/Ref.h>
    3231#include <wtf/RefCounted.h>
    3332#include <wtf/RefPtr.h>
     33#include <wtf/Seconds.h>
    3434
    3535namespace WebCore {
     
    4848    std::optional<double> bindingsStartTime() const;
    4949    void setBindingsStartTime(std::optional<double>);
    50     std::optional<MonotonicTime> startTime() const { return m_startTime; }
    51     void setStartTime(MonotonicTime& startTime) { m_startTime = startTime; }
     50    std::optional<Seconds> startTime() const { return m_startTime; }
     51    void setStartTime(Seconds startTime) { m_startTime = startTime; }
    5252
    5353    String description();
     
    5757    RefPtr<AnimationEffect> m_effect;
    5858    RefPtr<AnimationTimeline> m_timeline;
    59     std::optional<MonotonicTime> m_startTime;
     59    std::optional<Seconds> m_startTime;
    6060};
    6161
Note: See TracChangeset for help on using the changeset viewer.