Skip to content
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

Implement HTMLElement.attachInternals() #3561

Closed
wants to merge 1 commit into from

Conversation

zjffun
Copy link
Contributor

@zjffun zjffun commented Jun 2, 2023

Comment on lines +84 to +90
this._attachedInternals = ElementInternals.new(this._globalObject);
const attachedInternalsImpl = wrapperForImpl(this._attachedInternals);

// https://html.spec.whatwg.org/multipage/custom-elements.html#internals-target
attachedInternalsImpl._targetElement = this;

return attachedInternalsImpl;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether there should use ElementInternals.new and wrapperForImpl, or use other method.

@zmullett
Copy link

zmullett commented Jan 2, 2024

+1 Can confirm anecdotally that this PR permits unit-testing Lit elements with jsdom 👍

domenic added a commit that referenced this pull request Jan 5, 2024
It only supports the shadowRoot property for now.

This extracts the basic infrastructure from #3561, leaving the ARIAMixin work for later (to be reconciled with #3586).

Co-authored-by: Jufeng Zhang <zjffun@gmail.com>
@domenic
Copy link
Member

domenic commented Jan 5, 2024

I am incorporating a smaller version of this in #3654, with only basic ElementInternals. Then I will try to build a version with ARIAMixin on top, that includes both the changes here and in #3586.

domenic added a commit that referenced this pull request Jan 5, 2024
It only supports the shadowRoot property for now.

This extracts the basic infrastructure from #3561, leaving the ARIAMixin work for later (to be reconciled with #3586).

Co-authored-by: Jufeng Zhang <zjffun@gmail.com>
domenic added a commit that referenced this pull request Jan 5, 2024
For both Element and ElementInternals. Closes #3561. Closes #3586. Partially addresses #3323.
domenic added a commit that referenced this pull request Jan 5, 2024
For both Element and ElementInternals. Closes #3561. Closes #3586. Partially addresses #3323.
@domenic domenic closed this in #3655 Jan 5, 2024
domenic added a commit that referenced this pull request Jan 5, 2024
For both Element and ElementInternals. Closes #3561. Closes #3586. Partially addresses #3323.
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.

None yet

3 participants