Skip to content

Commit 7008de3

Browse files
Shadow root example included as failed example 6
1 parent 25aa483 commit 7008de3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

_rules/html-page-non-empty-title-2779a5.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,27 @@ This page has a `title` element that only contains a separator character.
198198
</html>
199199
```
200200

201+
#### Failed Example 6
202+
203+
This page does not have a title because the shadow root is not a [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant) of the [document element](https://dom.spec.whatwg.org/#document-element).
204+
205+
```html
206+
<html>
207+
<body>
208+
<template id="shadow-element">
209+
<title>This is the page title</title>
210+
</template>
211+
<script>
212+
const host = document.querySelector("body");
213+
const shadow = host.attachShadow({ mode: "closed" });
214+
const template = document.getElementById("shadow-element");
215+
216+
shadow.appendChild(template.content);
217+
</script>
218+
</body>
219+
</html>
220+
```
221+
201222
### Inapplicable
202223

203224
#### Inapplicable Example 1

0 commit comments

Comments
 (0)