<?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>280399</bug_id>
          
          <creation_ts>2024-09-26 02:38:08 -0700</creation_ts>
          <short_desc>Conditionally rendered slot elements causes other slots to be hidden</short_desc>
          <delta_ts>2025-11-18 01:07:17 -0800</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>Safari 18</version>
          <rep_platform>All</rep_platform>
          <op_sys>macOS 15</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>148695</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Hans Krywalsky">hanskrywaa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>cory</cc>
    
    <cc>j.r.jurman</cc>
    
    <cc>koivisto</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>willow4</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2063329</commentid>
    <comment_count>0</comment_count>
    <who name="Hans Krywalsky">hanskrywaa</who>
    <bug_when>2024-09-26 02:38:08 -0700</bug_when>
    <thetext>Hey there,

this is the first bug i report here. If you need any more info or help from me, please let me know.

We mentioned a strange bug on our website, after we updated to ios18/macOS15: After an element renders a conditionally `slot` element, other `slot` elements on the same page gets removed.

We use lit webcomponents and i also was able to create a very simple reproduction. I started a new default lit project and added simple components.
Link: https://github.com/EinfachHans/ios18-slot-bug
The steps to make it run are described in there.

When you press on &quot;toggle&quot; another slot element is added to the page. In the same moment the slot from the headline component just gets hidden.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2064473</commentid>
    <comment_count>1</comment_count>
    <who name="Mathias R.">willow4</who>
    <bug_when>2024-10-01 02:33:08 -0700</bug_when>
    <thetext>Hi, 
we&apos;re facing the same Bug in a Project with conditionally rendered slots. 

In addition to Hans&apos; explanation, I would like to add that this only seems to occur with elements whose slots have display: contents and contain text nodes. If you set the slot to e.g. display: block or wrap the text in an element such as span, p or div, the error does not occur. 

In his example that would mean using &lt;my-headline&gt;&lt;span&gt;Headline&lt;/span&gt;&lt;/my-headline&gt; in my-app.ts would work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2065104</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-10-03 02:39:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/137191304&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2159507</commentid>
    <comment_count>3</comment_count>
    <who name="">j.r.jurman</who>
    <bug_when>2025-11-17 22:50:00 -0800</bug_when>
    <thetext>This came up in a recent Web Awesome issue (see https://github.com/shoelace-style/webawesome/issues/1771).
I was able to recreate a minimal codepen that does not use lit here - https://codepen.io/JRJurman/pen/vEGmWoZ

I&apos;m going to attempt to build a web platform test for this next. I&apos;ll follow up here when that exists.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2159533</commentid>
    <comment_count>4</comment_count>
    <who name="">j.r.jurman</who>
    <bug_when>2025-11-18 01:07:17 -0800</bug_when>
    <thetext>PR is here - https://github.com/web-platform-tests/wpt/pull/56083
In the process of putting that together, I noticed that the bug is not reproducible in the latest Safari Technology Preview - Release 232 (WebKit 21624.1.2.19.2).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>