Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upHTMLStyleElement can apply CSS even when not in a document #2107
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Follow-up from #1959:
StyleElementHelpers::parse_own_cssshould check whether the element is in a document before parsing and applying CSS. Currently it applies CSS whenever a child is added, even if the element is not in a document.To handle the case when a text node is added to the
<style>element before it is inserted into a document, we should check for CSS inbind_to_tree.We still need to check for CSS in
child_insertedalso, to handle the case where a text node is added to the<style>element after it is inserted into a document, but we should do so only if the element has an owner document.