Skip to content
This repository was archived by the owner on Jan 4, 2018. It is now read-only.
This repository was archived by the owner on Jan 4, 2018. It is now read-only.

necessity of wrapping the element in order to dynamically project <content> #11

@andyjcross

Description

@andyjcross

I don't have much experience writing polyfills, so forgive me and disregard if this is a dumb question.

I was wondering why the usage of a wrapper element that mostly implements the DOM element interface is necessary, versus simply overriding the methods on the prototype of the custom element you're declaring? Similar to how mutation observers are polyfilled in skatejs for IE:

Object.defineProperty(elementPrototype, "innerHTML", {...

If I write a custom element called "my-component" that projects some content from the light DOM, I'm assuming as it is now I couldn't then nest it inside a parent component and set its content dynamically:

<my-component>{{content via data-binding}}</my-component>

because a templating engine or whatever I'm using doesn't know to create the wrapper. Whether it just resets .innerHTML or does something more efficient, it won't trigger the projection logic that might (or might not, depending on the new content) be necessary.

Thanks!

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