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

DOMTokenList should be iterable #1342

Closed
silverwind opened this issue Mar 20, 2024 · 0 comments · Fixed by #1365
Closed

DOMTokenList should be iterable #1342

silverwind opened this issue Mar 20, 2024 · 0 comments · Fixed by #1365
Labels
bug Something isn't working

Comments

@silverwind
Copy link
Contributor

silverwind commented Mar 20, 2024

Describe the bug
DOMTokenList is currently not iterable in happy-dom while it is in jsdom, Firefox and Chrome.

The iterator should function exactly the same as DOMTokenList#values().

To Reproduce

const div = document.createElement("div");
div.classList.add("foo", "bar");
for (const cls of div.classList) console.log(cls);

Expected behavior
Outputs foo\nbar\n.

Actual behaviour
TypeError: div.classList is not iterable

@silverwind silverwind added the bug Something isn't working label Mar 20, 2024
silverwind added a commit to go-gitea/gitea that referenced this issue Mar 21, 2024
Use `happy-dom` again in vitest as it has caught up recently to `jsdom`
in terms of features and it is a much more lightweight solution.

I encountered [one
bug](capricorn86/happy-dom#1342), but it's an
easy workaround until fixed.

I regenerated the lockfile to get rid of the transitive dependencies so
that's why the diff also has some upgrades in it.

In total, this change removes 39 npm dependencies.
silverwind added a commit to silverwind/happy-dom that referenced this issue Mar 25, 2024
capricorn86 added a commit that referenced this issue Mar 25, 2024
fix: [#1342] Make `DOMTokenList` iterable
DennisRasey pushed a commit to DennisRasey/forgejo that referenced this issue Mar 26, 2024
Use `happy-dom` again in vitest as it has caught up recently to `jsdom`
in terms of features and it is a much more lightweight solution.

I encountered [one
bug](capricorn86/happy-dom#1342), but it's an
easy workaround until fixed.

I regenerated the lockfile to get rid of the transitive dependencies so
that's why the diff also has some upgrades in it.

In total, this change removes 39 npm dependencies.

(cherry picked from commit 82979588f4d8699097451ebb70c56a4bdd090c52)
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

Successfully merging a pull request may close this issue.

1 participant