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

document.styleSheets don't react to document.adoptedStyleSheets changes #1458

Open
aralroca opened this issue Jun 12, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@aralroca
Copy link
Contributor

Describe the bug

const sheet = new CSSStyleSheet();

sheet.insertRule("div { color: red; }");
document.adoptedStyleSheets = [sheet];

Modifies the document.styleSheets, but in the tests with happy-dom, this is not reflected.

To Reproduce

Just run:

const sheet = new CSSStyleSheet();

sheet.insertRule("div { color: red; }");
document.adoptedStyleSheets = [sheet];

expect(document.styleSheets).not.toBeEmpty()

Expected behavior

The document.styleSheets should be updated according the the changes with document.adoptedStyleSheets.

@aralroca aralroca added the bug Something isn't working label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant