Skip to content

Commit

Permalink
Typos in # Feature Detection and Polyfilling
Browse files Browse the repository at this point in the history
- Feature Detection:

template.hasOwnProperty('shadowRootMode') needs to be camelCase, otherwise it is not recognized in Chrome and Safari which do support the feature already. See:
https://developer.chrome.com/articles/declarative-shadow-dom/

- Polyfill:

Missing ending ');'
  • Loading branch information
estherbrunner authored Nov 9, 2023
1 parent f00cb06 commit af45132
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ To detect support for declarative Shadow DOM, something like this could be used:
```javascript
function supportsDeclarativeShadowDOM() {
return HTMLTemplateElement.prototype.hasOwnProperty("shadowrootmode");
return HTMLTemplateElement.prototype.hasOwnProperty("shadowRootMode");
}
```
Expand All @@ -570,7 +570,7 @@ document.querySelectorAll('template[shadowrootmode]').forEach(template => {
const shadowRoot = template.parentNode.attachShadow({ mode });
shadowRoot.appendChild(template.content);
template.remove();
}
});
```
# Example Custom Element
Expand Down

0 comments on commit af45132

Please sign in to comment.