Skip to content

[feature] callbacks/events before import and append. #51

@tomalec

Description

@tomalec

Description

I need to access the elements and stub few things precisely when they are created (imported) then when stamped (connected).

Actually, I'm trying to test a polyfill for the declarative shadow dom element, according to latest ideas which consist removing the element once parsed.

Expected outcome

I'd love to have an event or callback:

  • imported - with a NodesList of imported nodes as a detail/parameter, so I could access them even though the may get removed from the document after constructor/connectedCallback/fixture. Called just after content of tempalte is imported.
  • connected - when the elements are being appended to the main document.

I could provide a PR if that's the idea with any chance to get merged.

Actual outcome

No way to catch those.

Note, that I cannot stub into Custom Elements constructor.

Live Demo

Steps to reproduce

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions