Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML page has non-empty title [2779a5]: Shadow root example - Included as failed example 6 #2180

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading