Web Components: Difference between revisions

Content deleted Content added
Aasasd (talk | contribs)
Removed links to random commercial offerings, looked pretty spammy
Shadow DOM: removed dubious and unsourced claim; third person form
Line 21:
The scoped subtree in an element is called a shadow tree. The element the shadow tree is attached to is called a shadow host.<ref name=":0" />
 
Shadow DOM must always be connected to an existing element, either through attaching it as a literal element or through [[script (computer programming)|script]]ing. In [[JavaScript]], you attach Shadow DOMDOMs are attached to an element using <code>Element.attachShadow()</code>.<ref>{{Cite web|url=https://developer.mozilla.org/en-US/docs/Web/Web_Components/Shadow_DOM|title=Shadow DOM|website=Mozilla Developer Network|access-date=2016-12-01}}</ref>
 
The ability to scope [[HTML]] and [[Cascading Style Sheets|CSS]] is essential to the creation of Custom Elements. If shadow DOM did not exist, different external Custom Elements could interact in unwanted ways.
 
=== HTML Template ===