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

HTMLStyleElement can apply CSS even when not in a document #2107

Closed
mbrubeck opened this issue Apr 14, 2014 · 1 comment
Closed

HTMLStyleElement can apply CSS even when not in a document #2107

mbrubeck opened this issue Apr 14, 2014 · 1 comment

Comments

@mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented Apr 14, 2014

Follow-up from #1959:

StyleElementHelpers::parse_own_css should 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 in bind_to_tree.

We still need to check for CSS in child_inserted also, 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.

@jdm
Copy link
Member

@jdm jdm commented Apr 14, 2014

Writing a reftest that ensures these bugs don't occur after fixing them would be useful, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.