Changeset 224128 in webkit
- Timestamp:
- Oct 27, 2017 1:29:59 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r224126 r224128 1 2017-10-27 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Expose the currentTime property on AnimationTimeline 4 https://bugs.webkit.org/show_bug.cgi?id=178928 5 6 Reviewed by Dean Jackson. 7 8 Add a new test that checks we can read the document's timeline currentTime 9 property and set it via the internals method. 10 11 * webanimations/timeline-current-time-expected.txt: Added. 12 * webanimations/timeline-current-time.html: Added. 13 1 14 2017-10-27 Ryan Haddad <ryanhaddad@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r224127 r224128 1 2017-10-27 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Expose the currentTime property on AnimationTimeline 4 https://bugs.webkit.org/show_bug.cgi?id=178928 5 6 Reviewed by Dean Jackson. 7 8 We add the currentTime property on AnimationTimeline and add an internals method 9 to set it in a test which will allow us to validate the timing model state for 10 a given time. 11 12 Test: webanimations/timeline-current-time.html 13 14 * animation/AnimationTimeline.cpp: 15 (WebCore::AnimationTimeline::bindingsCurrentTime const): 16 (WebCore::AnimationTimeline::setCurrentTime): 17 * animation/AnimationTimeline.h: 18 (WebCore::AnimationTimeline::currentTime const): 19 * animation/AnimationTimeline.idl: 20 * testing/Internals.cpp: 21 (WebCore::Internals::setTimelineCurrentTime): 22 * testing/Internals.h: 23 * testing/Internals.idl: 24 1 25 2017-10-27 Antoine Quint <graouts@apple.com> 2 26 -
trunk/Source/WebCore/animation/AnimationTimeline.cpp
r223825 r224128 53 53 } 54 54 55 std::optional<double> AnimationTimeline::bindingsCurrentTime() const 56 { 57 if (!m_currentTime) 58 return std::nullopt; 59 return m_currentTime->value(); 60 } 61 62 void AnimationTimeline::setCurrentTime(Seconds currentTime) 63 { 64 m_currentTime = currentTime; 65 } 66 55 67 String AnimationTimeline::description() 56 68 { -
trunk/Source/WebCore/animation/AnimationTimeline.h
r223825 r224128 30 30 #include <wtf/Forward.h> 31 31 #include <wtf/HashSet.h> 32 #include <wtf/Optional.h> 32 33 #include <wtf/Ref.h> 33 34 #include <wtf/RefCounted.h> 35 #include <wtf/Seconds.h> 34 36 35 37 namespace WebCore { … … 42 44 void addAnimation(Ref<WebAnimation>&&); 43 45 void removeAnimation(Ref<WebAnimation>&&); 46 std::optional<double> bindingsCurrentTime() const; 47 std::optional<Seconds> currentTime() const { return m_currentTime; } 48 WEBCORE_EXPORT void setCurrentTime(Seconds); 44 49 WEBCORE_EXPORT String description(); 45 50 … … 57 62 private: 58 63 ClassType m_classType; 64 std::optional<Seconds> m_currentTime; 59 65 HashSet<RefPtr<WebAnimation>> m_animations; 60 66 }; -
trunk/Source/WebCore/animation/AnimationTimeline.idl
r223825 r224128 29 29 CustomToJSObject 30 30 ] interface AnimationTimeline { 31 [ImplementedAs=bindingsCurrentTime] readonly attribute double? currentTime; 31 32 }; -
trunk/Source/WebCore/testing/Internals.cpp
r223855 r224128 4262 4262 } 4263 4263 4264 void Internals::setTimelineCurrentTime(AnimationTimeline& timeline, double currentTime) 4265 { 4266 timeline.setCurrentTime(Seconds(currentTime)); 4267 } 4268 4264 4269 #if ENABLE(APPLE_PAY) 4265 4270 MockPaymentCoordinator& Internals::mockPaymentCoordinator() const -
trunk/Source/WebCore/testing/Internals.h
r223855 r224128 626 626 627 627 String timelineDescription(AnimationTimeline&); 628 void setTimelineCurrentTime(AnimationTimeline&, double); 628 629 629 630 private: -
trunk/Source/WebCore/testing/Internals.idl
r223855 r224128 564 564 565 565 [EnabledAtRuntime=WebAnimations] DOMString timelineDescription(AnimationTimeline timeline); 566 [EnabledAtRuntime=WebAnimations] void setTimelineCurrentTime(AnimationTimeline timeline, double currentTime); 566 567 [Conditional=APPLE_PAY] readonly attribute MockPaymentCoordinator mockPaymentCoordinator; 567 568 };
Note: See TracChangeset
for help on using the changeset viewer.