webcomponents / webcomponents/polyfills
[ShadowDOM] Implement moveBefore()
Open
Focus Area: Standards & Polyfills
Type: Feature
- Dominant language
- HTML
- Stars
- 1.2k
- Forks
- 168
- PR merge metrics
- No merged PRs in 30d
Description
## Description
`moveBefore()` is a new API similar to `insertBefore()`. I won't be possible to polyfill, but ShadyDOM could possibly wrap it when available to create the right DOM structure.
A good addition here would be to only patch `moveBefore()` when it's available natively so that feature detection in library code still works.
## Motivation
When working on `moveBefore()` support for lit-html, I hit an error with the polyfill tests: https://github.com/lit/lit/pull/4838
I haven't made a minimal reproduction yet, but the native function is complaining about an invalid hierarchy.
Contributor guide
Assessment
This issue has not been assessed yet.