Skip to content

:not selector followed by Brackets in next attribute selector value triggers selector validation error #2077

@jotoh98

Description

@jotoh98

Describe the bug
A css selector string is triggering an error when it is not faulty.

To Reproduce
Steps to reproduce the behavior:
Try to evaluate the code

document.querySelector(':not([attr2="val2"])[attr3="(val3)"]')

in a happy-dom environment.

Expected behavior
The selector should be valid, there should be no error.

Screenshots

SyntaxError: Failed to execute 'querySelectorAll' on 'Element': ':not([attr2="val2"])[attr3="(val3)"]' is not a valid selector.

Additional context
The issue surfaced upon using happy-dom v20.6.3 in combination with fela-dom v12.2.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions