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

Regression in :is() pseudo class function #1333

Closed
asamuzaK opened this issue Mar 20, 2024 · 1 comment · Fixed by #1341
Closed

Regression in :is() pseudo class function #1333

asamuzaK opened this issue Mar 20, 2024 · 1 comment · Fixed by #1341
Assignees
Labels
question Further information is requested

Comments

@asamuzaK
Copy link

Things that used to be handled correctly with :is() are regressed in happy-com v14.

document.body.innerHTML = `<div id="parent">
  <p id="child">child</p>
</div>`;
const node = document.getElementById('child');

console.log(node.matches(':is(:last-child, :only-child)'));
// expects `true`, but gets `false`

console.log(node.matches(':is(:invalid-nth-child, :only-child)'));
// expects `true`, but gets `false`

Actual logs:
Last good (Mar 9, 2024): https://github.com/asamuzaK/domSelector/actions/runs/8213032502/job/22463958026#step:5:17
First bad (Mar 16, 2024): https://github.com/asamuzaK/domSelector/actions/runs/8307223087/job/22736188722#step:5:17
NOTE: Empty result means that unexpected value, i.e. false in this case, is returned.

@asamuzaK asamuzaK added the question Further information is requested label Mar 20, 2024
@capricorn86 capricorn86 self-assigned this Mar 20, 2024
capricorn86 added a commit that referenced this issue Mar 20, 2024
…o-class-function-1

feat: [#1333] Adds support for the pseudo selectors :is() and :where()
@capricorn86
Copy link
Owner

Thank you for reporting @asamuzaK! 🙂

Happy DOM actually didn't have support for the :is() pseudo selector. The reason for why it was passing before is probably because Happy DOM matched unsupported pseudo selectors as a positive match, which was fixed in v13.8.5.

I have added support for the :is() pseudo selector now.

You can read more about the release here:
https://github.com/capricorn86/happy-dom/releases/tag/v14.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
2 participants