webcomponents / webcomponents/polyfills
[ShadyDOM] Node.prototype.replaceChild removes node when same ref_node is used
- Dominant language
- HTML
- Stars
- 1.2k
- Forks
- 168
- PR merge metrics
- No merged PRs in 30d
Description
### Description
When using `Node.prototype.replaceChild` with the same node as ref_node, the node gets cleaned. (eg. removed from its parent)
### Example
https://jsbin.com/qajapuxupa/1/edit?html,console,output
### Steps to reproduce
1. Create a `div` and a `span` within
2. Get a reference to both elements.
3. Execute `replaceChild` on `div`, but use `span` for both the node as the ref_node
4. The `span` element is not connected anymore.
#### Expected behavior
The `span` element is untouched. (check other browsers)
#### Actual behavior
The `span` element has been cleaned
### Version
@webcomponents/webcomponentsjs@2.4.3
### Browsers affected
- [ ] Chrome
- [ ] Firefox
- [x] Edge (non Chromium versions)
- [ ] Safari
- [x] IE 11
Contributor guide
Assessment
This issue has not been assessed yet.