Skip to content

Declarative Shadow DOM #335

Closed
@mfreed7

Description

@mfreed7

Request for Mozilla Position on an Emerging Web Specification

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting feedbackAwaiting feedback from other Mozillians (request must have either been emailed or acknowledged)position: positivevenue: WHATWGSpecifications in a WHATWG Workstream

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions