Skip to content

[web-animations-1] Add getAnimations() to ShadowRoot #3951

@birtles

Description

@birtles

Currently the following will return an empty array:

const shadow = host.attachShadow({ mode: 'open' });
const elem = document.createElement('div');
shadow.appendChild(elem);
elem.animate(...);

// Get the animations from the host
// --> Returns empty array because getAnimations does not cross shadow-tree boundaries
host.getAnimations({ subtree: true });

To make working with shadow trees easier we could add:

partial interface ShadowRoot {
  sequence<Animation> getAnimations();
};

(Or should we add this to DocumentFragment instead?)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions