webcomponents / polyfills

Web Components Polyfills
BSD 3-Clause "New" or "Revised" License
1.13k stars 165 forks source link

[scoped-custom-element-registry] createElementNS is unsupported #563

Closed danwulff closed 3 weeks ago

danwulff commented 9 months ago

Description

With the scoped-custom-element-registry polyfill installed. When calling createElementNS() via a shadowRoot an error is thrown.

Example

<div id="app"></div>
const appDiv = document.getElementById('app');
const shadowRoot = appDiv.attachShadow({ mode: 'open' });
const div = shadowRoot.createElementNS('http://www.w3.org/1999/xhtml', 'div');

Steps to reproduce

  1. Install the scoped-custom-element-registry polyfill
  2. Attach a shadow root to an element
  3. Call shadowRoot.createElementNS()

Expected behavior

No error is thrown as the polyfill should support createElementNS as it is included in the spec.

Actual behavior

Error is thrown TypeError: .createElementNS is not a function

Version

@webcomponents/scoped-custom-element-registry@0.0.9

Browsers affected