Open Bug 1887436 Opened 2 years ago Updated 2 years ago

Declarative shadow DOM does not work for XHTML

Categories

(Core :: DOM: Core & HTML, defect)

Firefox 124
defect

Tracking

()

UNCONFIRMED

People

(Reporter: mail, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0

Steps to reproduce:

Declarative shadow DOMs don't appear to work for XHTML pages, as demonstrated by the following XHTML snippet (paste into 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) behavior 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.

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.