Bug 204559
Summary: | Dynamically inserting a slot element after the slot content does not work | ||
---|---|---|---|
Product: | WebKit | Reporter: | jogibear9988 <jochen.kuehner> |
Component: | New Bugs | Assignee: | 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
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
jogibear9988
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
<rdar://problem/57465685>
Ryosuke Niwa
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 ***