Skip to content

Conversation

sorvell
Copy link
Collaborator

@sorvell sorvell commented Dec 19, 2024

Fixes: #603

New proposal: whatwg/html#10854

@sorvell sorvell changed the title Update to sport revamped proposal Update to support revamped proposal Dec 19, 2024
@sorvell
Copy link
Collaborator Author

sorvell commented Feb 27, 2025

To prevent future issues with conflicting with native implementations, let's consider offering a version of this that's more of a ponyfill. For example:

pony(document).createElement(tag, {customElements})
pony(element).customElements
pony(element).attachShadow({mode: 'open', customElements})

This might be fairly annoying in practice and there are some options:

  1. ponyfill or polyfill HTMLElement and CustomElementRegistry?
  2. ponyfill or polyfill relevant APIs, which include:
    • Node.customElements
    • Node.prototype.appendChild
    • Node.prototype.insertBefore
    • DocumentFragment.prototype.append
    • ShadowRoot,.prototype.setHTMLUnsafe
    • ShadowRoot.prototype.innerHTML
    • Element.prototype.insertAdjacentHTML
    • Element.prototype.setHTMLUnsafe
    • Element.prototype.append
    • Element.prototype.prepend
    • Element.prototype.insertAdjacentElement
    • Element.prototype.replaceChild
    • Element.prototype.replaceChildren
    • Element.prototype.replaceWith
    • Element.prototype.innerHTML
    • HTMLElement.prototype.attachShadow
    • HTMLElement.prototype.attachInternals
    • Document.prototype.createElement
    • Document.prototype.createElementNS
    • Document.prototype.importNode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[scoped-custom-element-registry] Update to match new revamped proposal
1 participant