> > > As an alternate suggestion, and one that might dodge the subclassing > issues, perhaps createShadowRoot could take an optional template argument > and clone it automatically. Then this: > > this._root = this.createShadowRoot(); > this._root.appendChild(template.content.cloneNode()); > > Could turn into this: > > this._root = this.createShadowRoot(template); > > Which is quite a bit simpler, and involves fewer basic contents. > > Just to be totally clear, you are suggesting that the later would desugar into precisely the former, correct? What would happen if you called createShadowRoot with some other kind of element?
- Re: [webcomponents] Auto-creating shado... Maciej Stachowiak
- Re: [webcomponents] Auto-creating shado... Rafael Weinstein
- Re: [webcomponents] Auto-creating shado... Ryosuke Niwa
- Re: [webcomponents] Auto-creating shado... Rafael Weinstein
- Re: [webcomponents] Auto-creating shado... Daniel Freedman
- Re: [webcomponents] Auto-creating shado... Ryosuke Niwa
- Re: [webcomponents] Auto-creating shado... Ryosuke Niwa
- Re: [webcomponents] Auto-creating shado... Brian Di Palma
- Re: [webcomponents] Auto-creating shadow DOM for custom ... Dominic Cooney
- Re: [webcomponents] Auto-creating shadow DOM for cu... Maciej Stachowiak
- Re: [webcomponents] Auto-creating shadow DOM fo... Brian Kardell