@@ -82,11 +82,11 @@ class StopWatchElement extends HTMLElement {
8282If you don't want to define the template within JavaScript, you can instead define it up-front in the HTML of your
8383component with a _ declarative ShadowDOM template_ . When you define a _ declarative ShadowDOM template_ the browser will
8484handle attaching a _ shadow root_ and cloning the contents of the template for you. To do this, you'll need to add a
85- ` <template> ` tag as a child of your element, with a ` shadowroot ` attribute:
85+ ` <template> ` tag as a child of your element, with a ` shadowrootmode ` attribute:
8686
8787``` html
8888<stop-watch >
89- <template shadowroot =" open" >
89+ <template shadowrootmode =" open" >
9090 <p >Hello World</p >
9191 </template >
9292</stop-watch >
@@ -143,10 +143,10 @@ class StopWatchElement extends HTMLElement {
143143### Advanced: Using a closed _ ShadowDOM_
144144
145145You might have noticed that ` attachShadow() ` has to be passed ` mode: 'open' ` (and similarly _ declarative ShadowDOM_ is
146- created using ` <template shadowroot ="open"> ` ). This tells the ShadowRoot to be in "open" mode, which makes it public.
147- Other elements will be able to access an open ShadowRoot via the ` .shadowRoot ` property - even if you don't set it
148- yourself. Generally speaking, open ShadowRoots are the best choice; they still offer good isolation and are easy to work
149- with.
146+ created using ` <template shadowrootmode ="open"> ` ). This tells the ShadowRoot to be in "open" mode, which makes it
147+ _ public _ . Other elements will be able to access an open ShadowRoot via the ` .shadowRoot ` property - even if you don't
148+ set it yourself. Generally speaking, open ShadowRoots are the best choice; they still offer good isolation and are easy
149+ to work with.
150150
151151Another option, however, is to set it to ` mode: 'closed' ` . This makes your ShadowRoot private. A _ closed ShadowRoot_
152152** will not** be accessible via ` .shadowRoot ` (unless you intentionally assign it to ` .shadowRoot ` ). It will also change
@@ -190,7 +190,7 @@ one can also get the _closed ShadowRoot_:
190190
191191``` html
192192<stop-watch >
193- <template shadowroot =" closed" >
193+ <template shadowrootmode =" closed" >
194194 <p >Hello World</p >
195195 </template >
196196</stop-watch >
0 commit comments