Skip to content

[scoped-custom-element-registry] Align patched HTMLElement with native inheritance #627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oscarmarina
Copy link

This change adds the same inheritance safety measures already implemented in native-shim.ts

  • Ensures that instances of the patched HTMLElement have a .constructor reference pointing to the patched constructor itself.

  • Preserves the prototype chain by setting the patched constructor’s [[Prototype]] to the native HTMLElement.

Context
This issue was discovered in a very specific case involving legacy applications still using custom-elements-es5-adapter.js, the old @open-wc/scoped-elements for Lit 1, and the new @open-wc/scoped-elements for Lit 3.

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.

1 participant