Per the spec, Document::getAnimations() must report all Animations whose target effect is the given document.
Currently this can fail in Chrome because we actually list Animations in the DocumentTimeline they are attached to, not the Document. E.g.
const effect = new KeyframeEffect(target2, [ { backgroundColor: 'green' }, { backgroundColor: 'red' } ], 10000);
anim = new Animation(effect, document.timeline);
anim.play();
In the above case, 'anim' hangs off of the main Document's DocumentTimeline, and so the iframe Document doesn't see it for getAnimations()!
This will likely be quite tricky to solve; we need to figure out where to hang Animations that have no target as well.
Firefox implements this correctly.
Per the spec, Document::getAnimations() must report all Animations whose target effect is the given document.
Currently this can fail in Chrome because we actually list Animations in the DocumentTimeline they are attached to, not the Document. E.g.
const target = iframe.contentDocument.getElementById("target");
const effect = new KeyframeEffect(target, [ { backgroundColor: 'green' }, { backgroundColor: 'red' } ], 10000);
anim = new Animation(effect, document.timeline);
anim.play();
In the above case, 'anim' hangs off of the main Document's DocumentTimeline, and so the iframe Document doesn't see it for getAnimations()!
This will likely be quite tricky to solve; we need to figure out where to hang Animations that have no target as well.
Firefox implements this correctly.
Per the spec, Document::getAnimations() must report all Animations whose target effect is the given document.
Currently this can fail in Chrome because we actually list Animations in the DocumentTimeline they are attached to, not the Document. E.g.
const target = iframe.contentDocument.getElementById("target");
const effect = new KeyframeEffect(target, [ { backgroundColor: 'green' }, { backgroundColor: 'red' } ], 10000);
const anim = new Animation(effect, document.timeline);
anim.play();
In the above case, 'anim' hangs off of the main Document's DocumentTimeline, and so the iframe Document doesn't see it for getAnimations()!
This will likely be quite tricky to solve; we need to figure out where to hang Animations that have no target as well.
Firefox implements this correctly.
Comment 1 by smcgruer@chromium.org
, Apr 3 2018