webcomponents / webcomponents/polyfills

[ShadowDOM] Implement moveBefore()

Open
#631 0 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.