Skip to content

Commit

Permalink
HTML page has non-empty title [2779a5]: Shadow root example - Include…
Browse files Browse the repository at this point in the history
…d as failed example 6 (#2180)

* Shadow root example included as failed example 6

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

Co-authored-by: Wilco Fiers <[email protected]>

---------

Co-authored-by: Wilco Fiers <[email protected]>
Co-authored-by: Jean-Yves Moyen <[email protected]>
  • Loading branch information
3 people authored Sep 30, 2024
1 parent 70e6e12 commit d77d6fc
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions _rules/html-page-non-empty-title-2779a5.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,27 @@ This page has a `title` element that only contains a separator character.
</html>
```

#### Failed Example 6

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).

```html
<html>
<body>
<template id="shadow-element">
<title>This is the page title</title>
</template>
<script>
const host = document.querySelector("body");
const shadow = host.attachShadow({ mode: "open" });
const template = document.getElementById("shadow-element");
shadow.appendChild(template.content);
</script>
</body>
</html>
```

### Inapplicable

#### Inapplicable Example 1
Expand Down

0 comments on commit d77d6fc

Please sign in to comment.