Re: [w3c/webcomponents] Add authoring guidance for writing custom element constructors (#409)

>From [section 2.2](http://w3c.github.io/webcomponents/spec/custom/#custom-element-conformance):

> The element must not gain any attributes or children, as this violates the expectations of consumers who use the createElement or createElementNS methods.

As @JanMiksovsky pointed out, elements that create their own subtree would need to use a private flag / conditional in the connectedCallback which is a potential footgun and imo sort of messy looking. Would setting innerHTML or calling appendChild in a constructor throw an error? Is there a technical reason for this limitation? The one given is that it "violates expectations" but I'm unclear on what those expectations are - can anyone elaborate?

---
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/409#issuecomment-211590339

Received on Monday, 18 April 2016 21:28:45 UTC