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

verify / ensure proper serialization of shadow roots excluding closed shadow roots from getInnerHTML #16

Open
thescientist13 opened this issue May 1, 2022 · 1 comment · May be fixed by #178
Labels
0.16.0 enhancement Improvement to existing functionality question Further information is requested
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented May 1, 2022

Type of Change

  • New Feature Request

Summary

Just want to make sure I'm properly handling HTMLElement.getInnerHTML for?

getInnerHTML(options = {}) {
  return options.includeShadowRoots
    ? `
      <template shadowroot="${this.shadowRoot.mode}">
        ${this.shadowRoot.innerHTML}
      </template>
    `
    : this.shadowRoot.innerHTML;
}

Details

Coming out of #19 and made a repo for testing, since it appears I might be taking some serious liberties with the implementation here. 😅
https://github.com/thescientist13/get-inner-html


Somewhat related to this, not sure if there is value in having a way to opt-out at the top level for this, like if your page is a custom element? Perhaps you want your page as light DOM, but still keep the shadow DOM for all nested children?

edit: to the above, I just recently pulled a feature called lightMode since I realized a better way to output non shadow content was to just let user's opt-out by using innerHTML. But in relation to this, if say someone is using a third party library and wants that library rendered without Shadow DOM (obviously mileage will vary vastly on this from lib to lib) but then that's a way to bring that config back?

@thescientist13 thescientist13 added this to the 1.0 milestone May 1, 2022
@thescientist13 thescientist13 self-assigned this May 1, 2022
@thescientist13 thescientist13 changed the title verify / ensure proper serialization of shadow roots excluding closed shadow roots from getInnerHTML? verify / ensure proper serialization of shadow roots excluding closed shadow roots from getInnerHTML May 1, 2022
@thescientist13 thescientist13 added the feature New feature or request label May 1, 2022
@thescientist13 thescientist13 added question Further information is requested enhancement Improvement to existing functionality and removed feature New feature or request labels Jun 10, 2022
@thescientist13 thescientist13 moved this to 📋 Backlog in [WCC] General Activities Dec 28, 2022
@thescientist13 thescientist13 moved this from 📋 Backlog to 🔖 Ready in [WCC] General Activities Dec 2, 2024
@thescientist13 thescientist13 moved this from 🔖 Ready to 🏗 In progress in [WCC] General Activities Dec 2, 2024
@thescientist13
Copy link
Member Author

Looks like this will get full resolved between #171 and #178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.16.0 enhancement Improvement to existing functionality question Further information is requested
Projects
Status: 👀 In review
Development

Successfully merging a pull request may close this issue.

2 participants