Description
Request for Mozilla Position on an Emerging Web Specification
- Specification Title: Declarative Shadow DOM
- Specification or proposal URL:
- Explainer
- Spec PRs for HTML and DOM
- WhatWG DOM Issue discussion
- TAG review
- Caniuse.com URL (optional):
- Bugzilla URL (optional):
- Mozillians who can provide input (optional):
Other information
A declarative API to allow the creation of #shadowroots using only HTML and no Javascript. This API allows Web Components that use Shadow DOM to also make use of Server-Side Rendering (SSR), to get rendered content onscreen quickly without requiring Javascript for shadow root attachment and population.
Much more detail, including more motivating use cases, can be found in the explainer.
Chrome is particularly interested in shipping this feature. A majority of the proposed spec has been implemented, with WPT tests, behind the DeclarativeShadowDOM feature flag.
Example syntax:
<host-element>
<template shadowroot="open">
<style>shadow styles</style>
<h2>Shadow Content</h2>
<slot></slot>
</template>
<h2>Light content</h2>
</host-element>