Bug 1451026 [wpt PR 10281] - Web Animations: Fix bug with Document::getAnimations, a=testonly
authorStephen McGruer <smcgruer@chromium.org>
Mon, 09 Apr 2018 22:07:41 +0000
changeset 467275 d8d73c38711f670ba1e8831044cdf1f2d0716342
parent 467274 3d296a3a153911082974c3cbc5319784ce162fed
child 467276 9621c3206ea93b712c755954aee858052dc47217
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1451026, 10281, 828424, 992812, 548156
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1451026 [wpt PR 10281] - Web Animations: Fix bug with Document::getAnimations, a=testonly Automatic update from web-platform-testsWeb Animations: Fix bug with Document::getAnimations Per spec, we should exclude effects that do not target an element in the called document: https://drafts.csswg.org/web-animations-1/#dom-document-getanimations Bug: 828424 Change-Id: I41405d82184b17c1185931e34735a5f946573844 Reviewed-on: https://chromium-review.googlesource.com/992812 Commit-Queue: Stephen McGruer <smcgruer@chromium.org> Reviewed-by: Xida Chen <xidachen@chromium.org> Cr-Commit-Position: refs/heads/master@{#548156} wpt-commits: c148004d6600cc0530d41ec285f2cf80f443052f wpt-pr: 10281 wpt-commits: c148004d6600cc0530d41ec285f2cf80f443052f wpt-pr: 10281
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/web-animations/interfaces/Document/getAnimations.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -603391,17 +603391,17 @@
    "5aff03b7fa469e5ec0dc02a389eca963ae24b470",
    "testharness"
   ],
   "web-animations/interfaces/AnimationPlaybackEvent/idlharness.html": [
    "d9fc177ebbc3fa0317125912e38a4bfd65f727c8",
    "testharness"
   ],
   "web-animations/interfaces/Document/getAnimations.html": [
-   "7fbd5eed47955fdaeccd329f82f0884b86654784",
+   "41edbdf1f03889156068f38d87875387f129924f",
    "testharness"
   ],
   "web-animations/interfaces/Document/timeline.html": [
    "2577a2d5c89fa0eec3cae2fd07b66e576ee6a483",
    "testharness"
   ],
   "web-animations/interfaces/DocumentTimeline/constructor.html": [
    "b11caf0a1766818a168a7f91b01ccd6ae9a7e4f0",
--- a/testing/web-platform/tests/web-animations/interfaces/Document/getAnimations.html
+++ b/testing/web-platform/tests/web-animations/interfaces/Document/getAnimations.html
@@ -37,16 +37,29 @@ test(t => {
   const anim1 = div.animate(gKeyFrames, 100 * MS_PER_SEC);
   const anim2 = div.animate(gKeyFrames, 100 * MS_PER_SEC);
   assert_array_equals(document.getAnimations(),
                       [ anim1, anim2 ],
                       'getAnimations() returns running animations');
 }, 'Test the order of document.getAnimations with script generated animations')
 
 test(t => {
+  // This element exists but is not a descendent of any document, so isn't
+  // picked up by getAnimations.
+  const div = document.createElement('div');
+  const anim = div.animate(gKeyFrames, 100 * MS_PER_SEC);
+  assert_equals(document.getAnimations().length, 0);
+
+  // Now connect the div; it should appear in the list of animations.
+  document.body.appendChild(div);
+  t.add_cleanup(() => { div.remove(); });
+  assert_equals(document.getAnimations().length, 1);
+}, 'Test document.getAnimations for a disconnected node');
+
+test(t => {
   const effect = new KeyframeEffect(null, gKeyFrames, 100 * MS_PER_SEC);
   const anim = new Animation(effect, document.timeline);
   anim.play();
 
   assert_equals(document.getAnimations().length, 0,
                 'document.getAnimations() only returns animations targeting ' +
                 'elements in this document');
 }, 'Test document.getAnimations with null target');