Skip to content

:active always matching #3610

@SantoJambit

Description

@SantoJambit

Basic info:

  • Node.js version: 16.20.0
  • jsdom version: 22.1.0

Minimal reproduction case

const { JSDOM } = require("jsdom");

const dom = new JSDOM('<div>hello</div>');

const element = dom.window.document.querySelector('div');

console.log('active', element.matches(':active'));

It logs active true, but should log active false. This behaves correctly in the browser.

edit: I first thought it was due to the update from 21 to 22, but it might not be related. Investigating further
edit2: After some digging, I found nwsapi 2.2.7 to be the culprit. The fix (a revert) seems to be already in the master branch, but it has not been released yet. I can locally override to 2.2.6 to make this work again. You might want to as well until the next version is released.

How does similar code behave in browsers?

https://jsbin.com/monetalayo/edit?html,js,console

Metadata

Metadata

Assignees

No one assigned

    Labels

    has to-upstream testThis bug has a failing to-upstream web platform test waiting to be fixedmetr upliftA candidate for the METR Uplift experimentselectorsCSS Selectors support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions