Re: [w3c/webcomponents] How to define APIs only for custom element authors (#758)

I talked to JavaScript-binding experts in the team, and our conclusion was it's very difficult to detect whether an operation is inside ```new MyElement()``` or not.
Also, I noticed it's difficult to define ```createdCallback``` behavior in ```new MyElement()``` case.

I think the second approach (```new ElementInternals(this)```, ```this.attachInternals()```,  ```customElements.createInternals(this)```, or something) is acceptable though it's impossible to prevent non-ce-authors from using it perfectly.   We may clear can-create-internals-flag in [create-an-element](https://dom.spec.whatwg.org/#concept-create-element) path and [upgrade-an-element](https://html.spec.whatwg.org/multipage/custom-elements.html#concept-upgrade-an-element) path, and may clear it when the 'custom'-state element is connected.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/758#issuecomment-428817453

Received on Thursday, 11 October 2018 04:33:23 UTC