fix: ignore stylesheets fetching when is a inline style#4138
fix: ignore stylesheets fetching when is a inline style#4138straker merged 3 commits intodequelabs:developfrom
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. |
straker
left a comment
There was a problem hiding this comment.
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.