Web Animations: Don't set compositor pending when document has been detached

When there are multiple documents it is possible for an animation's
timeline to become detached. The existing assertions were not valid in this
case.

BUG=492061

Review URL: https://codereview.chromium.org/1360043002

git-svn-id: svn://svn.chromium.org/blink/trunk@202666 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/third_party/WebKit/Source/core/animation/Animation.cpp b/third_party/WebKit/Source/core/animation/Animation.cpp
index 919ff32..67d15ad 100644
--- a/third_party/WebKit/Source/core/animation/Animation.cpp
+++ b/third_party/WebKit/Source/core/animation/Animation.cpp
@@ -743,13 +743,16 @@
     if (m_compositorPending || m_isPausedForTesting) {
         return;
     }
+#if !ENABLE(OILPAN)
+    if (!timeline() || !timeline()->document()) {
+        return;
+    }
+#endif
 
     if (!m_compositorState || m_compositorState->effectChanged
         || !playing() || m_compositorState->playbackRate != m_playbackRate
         || m_compositorState->startTime != m_startTime) {
         m_compositorPending = true;
-        ASSERT(timeline());
-        ASSERT(timeline()->document());
         timeline()->document()->compositorPendingAnimations().add(this);
     }
 }