template Inert Content Note
Classifies ordinary template DocumentFragment contents versus content already inserted into a document or a processed declarative shadow root. Only ordinary template contents remain in the inert template owner document; other reasons for inertness are not evaluated.
Description
Ordinary template content is stored in a separate DocumentFragment for later insertion.
Ordinary template content is stored in a separate DocumentFragment for later insertion. Content inserted into a document or processed into a declarative shadow root has a different lifecycle.1
Classifies ordinary template DocumentFragment contents versus content already inserted into a document or a processed declarative shadow root. Only ordinary template contents remain in the inert template owner document; other reasons for inertness are not evaluated.
When to use template Inert Content Note
Use this for the following task: Classifies ordinary template DocumentFragment contents versus content already inserted into a document or a processed declarative shadow root. Only ordinary template contents remain in the inert template owner document; other reasons for inertness are not evaluated.
Prepare the parsed attribute values, element states or ordered local lists requested below. Keep attribute presence separate from value.
How to use template Inert Content Note and understand its results
- Prepare the parsed attribute values, element states or ordered local lists requested below. Keep attribute presence separate from value.
- Enter location using the field table, then run the tool.
- Read inertTemplateContents, participatesInDocument. Interpret flags, units, ordering and placeholder values using the rules below.
- Review any reported issue or failed check, correct the supplied values when appropriate, and verify the result in its intended context.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| location | Location | string; choose "template-content", "inserted-content", "declarative-shadow-root-content" | Required |
Choose the actual content location. Return true for template inertness only for template-content, and invert that flag for document participation.2
inertTemplateContents = location == template-content; participatesInDocument = !inertTemplateContents This summarizes the declared operation. Units, indexing, inclusivity and exceptional cases are explained in the surrounding text.
| Output field | Meaning | Value type |
|---|---|---|
| inertTemplateContents | Inert Template Contents | boolean |
| participatesInDocument | Participates In Document | boolean |
{
"input": {
"location": "template-content"
},
"output": {
"inertTemplateContents": true,
"participatesInDocument": false
}
} Limitations and assumptions
This models template ownership only. It does not inspect the DOM, detect other inertness, or guarantee script execution after insertion.
This evaluates supplied local information; it does not fetch a page or run a browser. Malformed requests produce input errors. A successfully evaluated request can still contain false flags, empty result lists or a result outside the supplied threshold; those outcomes have the meanings stated above.
Alternative or Complementary methods
Choose slot name Fallback Shadow DOM Lookup for this operation: Resolves automatic named slot assignment from direct host slotable names. The first slot with a given name receives matching nodes; later same-name slots display fallback. Text nodes use the empty default name. Manual assignment is outside this profile. For a complementary task, use inert Focus Suppression Lookup for this operation: Resolves inert attribute restrictions from own and inherited flat-tree inertness. A modal dialog opened with showModal escapes inherited inertness, while its own inert attribute still applies. Other disabling and focus rules are separate.
Further background: HTML / accessibility reference: template Inert Content Note.
References
Similar or alternative tools
- slot name Fallback Shadow DOM Lookup
Resolves automatic named slot assignment from direct host slotable names. The first slot with a given name receives matching nodes; later same-name slots display fallback. Text nodes use the empty default name. Manual assignment is outside this profile.
- inert Focus Suppression Lookup
Resolves inert attribute restrictions from own and inherited flat-tree inertness. A modal dialog opened with showModal escapes inherited inertness, while its own inert attribute still applies. Other disabling and focus rules are separate.