In the W3C custom elements spec, it is mentioned that within the Custom element constructor:
The element must not gain any attributes or children, as this violates the expectations of consumers who use the
createElement
orcreateElementNS
methods.
I am finding it difficult to understand what expectations are we violating. My initial guess was that using createElement
to create a custom element does not invoke the Constructor behind the scenes, but that does not seem to be the case based on a proof of concept which I did.
Aucun commentaire:
Enregistrer un commentaire