<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>271645</bug_id>
          
          <creation_ts>2024-03-25 07:25:47 -0700</creation_ts>
          <short_desc>Declarative shadow DOM does not work for XHTML</short_desc>
          <delta_ts>2024-04-03 06:57:39 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>148695</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Jonathan Heathcote">mail</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2023647</commentid>
    <comment_count>0</comment_count>
    <who name="Jonathan Heathcote">mail</who>
    <bug_when>2024-03-25 07:25:47 -0700</bug_when>
    <thetext>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,&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;template shadowrootmode=&quot;open&quot;&gt;OpenDeclarativeShadowDOMsupported&lt;/template&gt;&lt;/div&gt;


# Actual results:

An empty page is shown (and the developer tool DOM tree shows the &lt;template&gt; element is not removed, the template contents aren&apos;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,&lt;div&gt;&lt;templateshadowrootmode=&quot;open&quot;&gt;OpenDeclarativeShadowDOMsupported&lt;/template&gt;&lt;/div&gt;

This shows &quot;OpenDeclarativeShadowDOMsupported&quot; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025086</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-04-01 07:26:14 -0700</bug_when>
    <thetext>&lt;rdar://problem/125716107&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025671</commentid>
    <comment_count>2</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2024-04-03 06:57:39 -0700</bug_when>
    <thetext>As per the Chromium bug, this is intended behaviour: specific shadow DOM treatment requires changes to the parser, and the XML parser doesn&apos;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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>