RESOLVED INVALID 271645
Declarative shadow DOM does not work for XHTML
https://bugs.webkit.org/show_bug.cgi?id=271645
Summary Declarative shadow DOM does not work for XHTML
Jonathan Heathcote
Reported 2024-03-25 07:25:47 PDT
Browser: Epiphany 45.3 on Arch Linux. The Declarative shadow DOM function does not work for XHTML documents (though it does for plain HTML ones). # Steps to reproduce: Paste the following XHTML snippet into the address bar: data:application/xhtml+xml,<div xmlns="http://www.w3.org/1999/xhtml"><template shadowrootmode="open">OpenDeclarativeShadowDOMsupported</template></div> # Actual results: An empty page is shown (and the developer tool DOM tree shows the <template> element is not removed, the template contents aren't moved into the parent and no shadow DOM is created. # Expected results: I would have expected the same (working) behaviour we see for equivalent HTML documents (see snippet below): data:text/html,<div><templateshadowrootmode="open">OpenDeclarativeShadowDOMsupported</template></div> This shows "OpenDeclarativeShadowDOMsupported" when opened in a browser. # Other browsers The same bug also appears to effect: * Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1887436 * Chromium: https://issues.chromium.org/issues/330967152
Attachments
Radar WebKit Bug Importer
Comment 1 2024-04-01 07:26:14 PDT
Sam Sneddon [:gsnedders]
Comment 2 2024-04-03 06:57:39 PDT
As per the Chromium bug, this is intended behaviour: specific shadow DOM treatment requires changes to the parser, and the XML parser doesn't do this. The discussion on the Chromium bug has ended up with https://github.com/whatwg/html/issues/10237 against the HTML spec, and it probably makes sense to keep the discussion there.
Note You need to log in before you can comment on or make changes to this bug.