diff --git a/proposals/Declarative-Custom-Elements-Strawman.md b/proposals/Declarative-Custom-Elements-Strawman.md index a6195fa..a8ca045 100644 --- a/proposals/Declarative-Custom-Elements-Strawman.md +++ b/proposals/Declarative-Custom-Elements-Strawman.md @@ -9,7 +9,8 @@ First, with the proposed template instantiation API in mind, we imagined a HTML ```html - + + @@ -22,7 +23,8 @@ This still requires having to repeat the constructor name twice. We can avoid th ```html - + + @@ -42,7 +44,8 @@ class /* default custom element */ extends HTMLElement { const template = customElements.getTemplate(this); if (!template) return; - #shadowRoot = this.attachShadow({mode: template.getAttribute('shadowmode')}); + const shadowOptions = customElements.getShadowOptions(this); + #shadowRoot = this.attachShadow(shadowOptions); #templateInstance = #shadowRoot.appendChild(template.createInstance(#shadowRoot)); } attributeChangedCallback(attributeName, oldValue, newValue, namespace) { @@ -57,7 +60,8 @@ Note that the shadow root of the custom element is passed to createInstance's st ```html -