Version: blitz-dom / blitz-html 0.3.0-beta.2 (crates.io), rendered headless through HtmlDocument::from_html + blitz_paint::paint_scene with anyrender_vello_cpu.
<template shadowrootmode="open"> is parsed as an inert template (html_sink.rs: get_template_contents has a // TODO: implement templates properly), so a page that relies on declarative shadow DOM renders nothing from the template and shows its light-DOM children unslotted.
Repro
<!doctype html>
<body>
<template shadowrootmode="open">
<h1>Shadow heading</h1>
<slot name="a"><p>placeholder for a</p></slot>
</template>
<div slot="a">Slotted content</div>
</body>
Expected (Chrome 111+, Firefox 123+, Safari 16.4+): <body> gets an open shadow root; "Shadow heading" renders, and "Slotted content" renders in place of the placeholder.
Actual: nothing from the template is rendered. query_selector("h1") finds no node with a layout box; "Slotted content" renders as an ordinary block.
Context
I hit this using Blitz as the render engine for a zero-JS server-side component library's test suite, where out-of-order streaming ships the page inside a DSD root on <body> and appends <div slot=…> chunks later in the byte stream. Every other page in that suite renders fine through Blitz.
#889 / #892 add shadow trees and slots but explicitly leave the declarative parser path out ("Not in this PR"). This issue is to track that remaining piece: html5ever's TreeSink::get_template_contents + the shadowrootmode attribute attaching a shadow root to the template's parent, with the template's children moved into it.
Version: blitz-dom / blitz-html 0.3.0-beta.2 (crates.io), rendered headless through
HtmlDocument::from_html+blitz_paint::paint_scenewithanyrender_vello_cpu.<template shadowrootmode="open">is parsed as an inert template (html_sink.rs:get_template_contentshas a// TODO: implement templates properly), so a page that relies on declarative shadow DOM renders nothing from the template and shows its light-DOM children unslotted.Repro
Expected (Chrome 111+, Firefox 123+, Safari 16.4+):
<body>gets an open shadow root; "Shadow heading" renders, and "Slotted content" renders in place of the placeholder.Actual: nothing from the template is rendered.
query_selector("h1")finds no node with a layout box; "Slotted content" renders as an ordinary block.Context
I hit this using Blitz as the render engine for a zero-JS server-side component library's test suite, where out-of-order streaming ships the page inside a DSD root on
<body>and appends<div slot=…>chunks later in the byte stream. Every other page in that suite renders fine through Blitz.#889 / #892 add shadow trees and slots but explicitly leave the declarative parser path out ("Not in this PR"). This issue is to track that remaining piece: html5ever's
TreeSink::get_template_contents+ theshadowrootmodeattribute attaching a shadow root to the template's parent, with the template's children moved into it.