Bug 204559

Summary: Dynamically inserting a slot element after the slot content does not work
Product: WebKit Reporter: jogibear9988 <jochen.kuehner>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 13   
Hardware: Mac   
OS: macOS 10.15   

jogibear9988
Reported 2019-11-24 14:33:51 PST
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("slot"); slot.name = "d"; shadowRoot.appendChild(slot); to let slot = document.createElement("slot"); shadowRoot.appendChild(slot); slot.name = "d"; it works as expected. Also look in chrome, it works as it should
Attachments
jogibear9988
Comment 1 2019-11-24 14:52:39 PST
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
Radar WebKit Bug Importer
Comment 2 2019-11-24 22:34:30 PST
Ryosuke Niwa
Comment 3 2019-11-25 14:06:12 PST
Doesn't reproduce in STP96. I'm pretty sure this is a duplicate of 199733. *** This bug has been marked as a duplicate of bug 199733 ***
Note You need to log in before you can comment on or make changes to this bug.