<?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>204559</bug_id>
          
          <creation_ts>2019-11-24 14:33:51 -0800</creation_ts>
          <short_desc>Dynamically inserting a slot element after the slot content does not work</short_desc>
          <delta_ts>2019-11-25 14:09:36 -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>New Bugs</component>
          <version>Safari 13</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.15</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>199733</dup_id>
          
          <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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="jogibear9988">jochen.kuehner</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1593289</commentid>
    <comment_count>0</comment_count>
    <who name="jogibear9988">jochen.kuehner</who>
    <bug_when>2019-11-24 14:33:51 -0800</bug_when>
    <thetext>Webcomponents dynamic added slots do not work

see code on https://jsfiddle.net/t2z4kp3n/1/

Result is

DivA
DivB
DivC

but should be

DivA
DivB
DivC
DivD

If you change order of 16-18 from

    let slot = document.createElement(&quot;slot&quot;);
    slot.name = &quot;d&quot;;
    shadowRoot.appendChild(slot);

to

    let slot = document.createElement(&quot;slot&quot;);
    shadowRoot.appendChild(slot);
    slot.name = &quot;d&quot;;

it works as expected.

Also look in chrome, it works as it should</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1593294</commentid>
    <comment_count>1</comment_count>
    <who name="jogibear9988">jochen.kuehner</who>
    <bug_when>2019-11-24 14:52:39 -0800</bug_when>
    <thetext>If you add the slot in the same cycle as you add the content but after it, the content will not be shown in the slot.

If you assign the name to the slot after adding it, it would work</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1593326</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-11-24 22:34:30 -0800</bug_when>
    <thetext>&lt;rdar://problem/57465685&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1593508</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-11-25 14:06:12 -0800</bug_when>
    <thetext>Doesn&apos;t reproduce in STP96. I&apos;m pretty sure this is a duplicate of 199733.

*** This bug has been marked as a duplicate of bug 199733 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>