-
Notifications
You must be signed in to change notification settings - Fork 788
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
fix: ignore stylesheets fetching when is a inline style #4138
Conversation
Thanks for the pull request. I would think that the filter method <div id="shadow"></div>
<script>
const root = shadow.attachShadow({ mode: 'open' });
root.innerHTML = `
<!-- this is filtered out of the getStylesheetsFromDocumentFragment loop -->
<style>
a { color: red }
</style>
<a href="#">hello world</a>
`;
</script> |
@EduSantosBrito Quick ping, have you had a chance to look at Steve's comment? |
Hey! I have time this week to look at it. I was on holiday last week hahaha |
Ok, after debugging for some hours I found that document.implementation.createHTMLDocument breaks HTMLStyleElement.sheet. There's some issues opened related to that jsdom/jsdom#3179 This makes sense why the browser using Quick ping @WilcoFiers @straker |
That makes sense. Thanks for the looking into that for us. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just updating the comment to reflect the investigations on when and why this is needed.
Co-authored-by: Steven Lambert <2433219+straker@users.noreply.github.com>
Approved for security. |
Closes: #4137
This fixes the issue when there's a inline style tag inside the shadowRoot. Since the inline style doesn't have a href, there's no need to fetch it. This is usual on Lit components.