From 6d4ce11aa10b65e0c049b9e66c4255578a22ad88 Mon Sep 17 00:00:00 2001 From: SGavrl <277843151+SGavrl@users.noreply.github.com> Date: Thu, 30 Jul 2026 22:04:01 +0000 Subject: [PATCH] Keep declarative shadow templates inert --- crates/obscura-dom/src/tree_sink.rs | 90 +++++++++++++++++++++++++++++ crates/obscura-render/src/dom.rs | 23 ++++++++ 2 files changed, 113 insertions(+) diff --git a/crates/obscura-dom/src/tree_sink.rs b/crates/obscura-dom/src/tree_sink.rs index 35952f9..69783ba 100644 --- a/crates/obscura-dom/src/tree_sink.rs +++ b/crates/obscura-dom/src/tree_sink.rs @@ -224,6 +224,21 @@ impl TreeSink for DomTree { self.set_quirks(mode == QuirksMode::Quirks); } + fn allow_declarative_shadow_roots(&self, _intended_parent: &NodeId) -> bool { + // html5ever defaults this hook to `true`, but its default + // `attach_declarative_shadow` implementation returns an error. In + // that combination the tree builder consumes + // `