[Web Animations] Remove useless internals methods
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Oct 2018 18:53:32 +0000 (18:53 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Oct 2018 18:53:32 +0000 (18:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=190968

Reviewed by Dean Jackson.

Source/WebCore:

We had a few internals methods added early on in the Web Animations implementation that are no longer
relevant now that the full API is implemented. We can safely remove them now.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::setCurrentTime): Deleted.
(WebCore::AnimationTimeline::description): Deleted.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::currentTime):
(WebCore::AnimationTimeline::pause): Deleted.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::currentTime):
(WebCore::DocumentTimeline::pause): Deleted.
* animation/DocumentTimeline.h:
* testing/Internals.cpp:
(WebCore::Internals::timelineDescription): Deleted.
(WebCore::Internals::pauseTimeline): Deleted.
(WebCore::Internals::setTimelineCurrentTime): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Remove a test that is no longer useful.

* webanimations/animation-creation-addition-expected.txt: Removed.
* webanimations/animation-creation-addition.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237474 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/webanimations/animation-creation-addition-expected.txt [deleted file]
LayoutTests/webanimations/animation-creation-addition.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/animation/AnimationTimeline.cpp
Source/WebCore/animation/AnimationTimeline.h
Source/WebCore/animation/DocumentTimeline.cpp
Source/WebCore/animation/DocumentTimeline.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl

index d6a7fa0..d9f5c5a 100644 (file)
@@ -1,3 +1,15 @@
+2018-10-26  Antoine Quint  <graouts@apple.com>
+
+        [Web Animations] Remove useless internals methods
+        https://bugs.webkit.org/show_bug.cgi?id=190968
+
+        Reviewed by Dean Jackson.
+
+        Remove a test that is no longer useful.
+
+        * webanimations/animation-creation-addition-expected.txt: Removed.
+        * webanimations/animation-creation-addition.html: Removed.
+
 2018-10-26  Per Arne Vollan  <pvollan@apple.com>
 
         [High Sierra/Sierra Release] Layout Test media/track/track-cue-css.html is a flaky image failure
diff --git a/LayoutTests/webanimations/animation-creation-addition-expected.txt b/LayoutTests/webanimations/animation-creation-addition-expected.txt
deleted file mode 100644 (file)
index 21cd248..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Constructing an Animation with a timeline should add the animation to the timeline.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-DocumentTimeline with 2 animations:
-  1. Animation
-  2. Animation
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/webanimations/animation-creation-addition.html b/LayoutTests/webanimations/animation-creation-addition.html
deleted file mode 100644 (file)
index 78b631c..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<script src="../resources/js-test-pre.js"></script>
-<script>
-
-description("Constructing an Animation with a timeline should add the animation to the timeline.");
-
-new Animation(null, document.timeline);
-new Animation(null, document.timeline);
-debug(internals.timelineDescription(document.timeline));
-
-</script>
-<script src="../resources/js-test-post.js"></script>
\ No newline at end of file
index 9c16860..dc93579 100644 (file)
@@ -1,5 +1,32 @@
 2018-10-26  Antoine Quint  <graouts@apple.com>
 
+        [Web Animations] Remove useless internals methods
+        https://bugs.webkit.org/show_bug.cgi?id=190968
+
+        Reviewed by Dean Jackson.
+
+        We had a few internals methods added early on in the Web Animations implementation that are no longer
+        relevant now that the full API is implemented. We can safely remove them now.
+
+        * animation/AnimationTimeline.cpp:
+        (WebCore::AnimationTimeline::setCurrentTime): Deleted.
+        (WebCore::AnimationTimeline::description): Deleted.
+        * animation/AnimationTimeline.h:
+        (WebCore::AnimationTimeline::currentTime):
+        (WebCore::AnimationTimeline::pause): Deleted.
+        * animation/DocumentTimeline.cpp:
+        (WebCore::DocumentTimeline::currentTime):
+        (WebCore::DocumentTimeline::pause): Deleted.
+        * animation/DocumentTimeline.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::timelineDescription): Deleted.
+        (WebCore::Internals::pauseTimeline): Deleted.
+        (WebCore::Internals::setTimelineCurrentTime): Deleted.
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
+2018-10-26  Antoine Quint  <graouts@apple.com>
+
         Web Inspector: Crash in http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html
         https://bugs.webkit.org/show_bug.cgi?id=190955
 
index 936ea2c..19c1001 100644 (file)
@@ -77,12 +77,6 @@ std::optional<double> AnimationTimeline::bindingsCurrentTime()
     return secondsToWebAnimationsAPITime(*time);
 }
 
-void AnimationTimeline::setCurrentTime(Seconds currentTime)
-{
-    m_currentTime = currentTime;
-    timingModelDidChange();
-}
-
 HashMap<Element*, ListHashSet<RefPtr<WebAnimation>>>& AnimationTimeline::relevantMapForAnimation(WebAnimation& animation)
 {
     if (animation.isCSSAnimation())
@@ -478,19 +472,4 @@ void AnimationTimeline::cancelOrRemoveDeclarativeAnimation(RefPtr<DeclarativeAni
     removeAnimation(animation.releaseNonNull());
 }
 
-String AnimationTimeline::description()
-{
-    TextStream stream;
-    int count = 1;
-    stream << (m_classType == DocumentTimelineClass ? "DocumentTimeline" : "AnimationTimeline") << " with " << m_animations.size() << " animations:";
-    stream << "\n";
-    for (const auto& animation : m_animations) {
-        writeIndent(stream, 1);
-        stream << count << ". " << animation->description();
-        stream << "\n";
-        count++;
-    }
-    return stream.release();
-}
-
 } // namespace WebCore
index 754cf03..3c7f40d 100644 (file)
@@ -51,9 +51,6 @@ public:
     void removeAnimation(Ref<WebAnimation>&&);
     std::optional<double> bindingsCurrentTime();
     virtual std::optional<Seconds> currentTime() { return m_currentTime; }
-    WEBCORE_EXPORT void setCurrentTime(Seconds);
-    WEBCORE_EXPORT String description();
-    virtual void pause() { };
 
     virtual void timingModelDidChange() { };
 
index e6d9a5d..687b9f2 100644 (file)
@@ -144,7 +144,7 @@ unsigned DocumentTimeline::numberOfActiveAnimationsForTesting() const
 
 std::optional<Seconds> DocumentTimeline::currentTime()
 {
-    if (m_paused || !m_document || !m_document->domWindow())
+    if (!m_document || !m_document->domWindow())
         return AnimationTimeline::currentTime();
 
     if (auto* mainDocumentTimeline = m_document->existingTimeline()) {
@@ -189,11 +189,6 @@ std::optional<Seconds> DocumentTimeline::currentTime()
     return m_cachedCurrentTime.value() - m_originTime;
 }
 
-void DocumentTimeline::pause()
-{
-    m_paused = true;
-}
-
 void DocumentTimeline::timingModelDidChange()
 {
     if (m_needsUpdateAnimationSchedule || m_isSuspended)
index c2f0b56..e6a6c29 100644 (file)
@@ -46,7 +46,6 @@ public:
     Document* document() const { return m_document.get(); }
 
     std::optional<Seconds> currentTime() override;
-    void pause() override;
 
     void timingModelDidChange() override;
 
@@ -96,7 +95,6 @@ private:
 
     RefPtr<Document> m_document;
     Seconds m_originTime;
-    bool m_paused { false };
     bool m_isSuspended { false };
     bool m_waitingOnVMIdle { false };
     std::optional<Seconds> m_cachedCurrentTime;
index bdeed15..df96f8b 100644 (file)
@@ -4624,21 +4624,6 @@ bool Internals::hasServiceWorkerConnection()
 }
 #endif
 
-String Internals::timelineDescription(AnimationTimeline& timeline)
-{
-    return timeline.description();
-}
-
-void Internals::pauseTimeline(AnimationTimeline& timeline)
-{
-    timeline.pause();
-}
-
-void Internals::setTimelineCurrentTime(AnimationTimeline& timeline, double currentTime)
-{
-    timeline.setCurrentTime(Seconds::fromMilliseconds(currentTime));
-}
-
 #if ENABLE(APPLE_PAY)
 MockPaymentCoordinator& Internals::mockPaymentCoordinator() const
 {
index e6538eb..62f9a46 100644 (file)
@@ -701,10 +701,6 @@ public:
     MockPaymentCoordinator& mockPaymentCoordinator() const;
 #endif
 
-    String timelineDescription(AnimationTimeline&);
-    void pauseTimeline(AnimationTimeline&);
-    void setTimelineCurrentTime(AnimationTimeline&, double);
-
     bool isSystemPreviewLink(Element&) const;
     bool isSystemPreviewImage(Element&) const;
 
index fd96a72..19dcf21 100644 (file)
@@ -682,9 +682,6 @@ enum CompositingPolicy {
     [Conditional=SERVICE_WORKER] void terminateServiceWorker(ServiceWorker worker);
     [Conditional=SERVICE_WORKER] boolean hasServiceWorkerConnection();
 
-    [EnabledAtRuntime=WebAnimations] DOMString timelineDescription(AnimationTimeline timeline);
-    [EnabledAtRuntime=WebAnimations] void pauseTimeline(AnimationTimeline timeline);
-    [EnabledAtRuntime=WebAnimations] void setTimelineCurrentTime(AnimationTimeline timeline, double currentTime);
     [Conditional=APPLE_PAY] readonly attribute MockPaymentCoordinator mockPaymentCoordinator;
 
     boolean isSystemPreviewLink(Element element);