-
-
Notifications
You must be signed in to change notification settings - Fork 210
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.sheet returns null in v16 #1647
Labels
bug
Something isn't working
Comments
capricorn86
added a commit
that referenced
this issue
Dec 27, 2024
…ng considered as connected to the DOM that was introduced in v16
capricorn86
added a commit
that referenced
this issue
Dec 27, 2024
Thank you for reporting @matmannion! 🙂 I believe that I have fixed the issue now in v16.0.1. |
Amazing, can confirm fixed in 16.0.1. Thanks so much @capricorn86 |
Great to hear @matmannion! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In 16.0.0, calling the following:
Returns
null
. Before v16, this was returning the same as a browser would; i.e. it allows parsing the CSS rules so they can then be iterated over withstyleElement.sheet.cssRules
. We use this in our application to scope CSS that comes from (trusted) upstream, and at the moment this is breaking the unit tests.A full unit test reproducing this, which passes with vitest/happy-dom 15 but fails with happy-dom 16:
The test output describes the behaviour in (e.g. 15.11.7). In 16 the <style> tag isn't output at all because it doesn't find any rules.
The text was updated successfully, but these errors were encountered: