8000 selector not work when use uppercase node name · Issue #3612 · jsdom/jsdom · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

selector not work when use uppercase node name #3612

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

Closed
flybywind opened this issue Oct 24, 2023 · 3 comments · Fixed by #3854
Closed

selector not work when use uppercase node name #3612

flybywind opened this issue Oct 24, 2023 · 3 comments · Fixed by #3854
Labels
has to-upstream test This bug has a failing to-upstream web platform test waiting to be fixed selectors CSS Selectors support

Comments

@flybywind
Copy link

Basic info:

  • Node.js version: v20.6.1
  • jsdom version: 22.1.0

Minimal reproduction case

test("check jsdom uppercase nodeName", () => {
  const mockDocument = new JSDOM(`
  <!DOCTYPE html>
  <html lang="en">
  <body>
    <h1>test mask solution</h1>
    <div class='box'>
      <div>
        <p id="p1"></p>
        <p id="p2"></p>
      </div>
    </div>
  </body>
  </html> `);
  const { document } = mockDocument.window;

  const result = document.querySelector("div.box");
  expect(result).not.null;
  const result1 = document.querySelector("DIV.box");
  expect(result1).to.null;
});

if I use div.box then the result was expected, but DIV.box yield a null

How does similar code behave in browsers?

works in both case

(Link to a jsbin or similar strongly suggested.)

@sqs
Copy link
sqs commented Oct 25, 2023

I am seeing this as well. It causes https://github.com/gmmorris/simmerjs to fail when using the latest version of jsdom. (Just posting that in case anyone searches and ends up here.)

@DiogoDoreto
Copy link

I found out that the issue comes from nwsapi dependency. On my tests, v2.2.3 introduced the bug.

@dormesica
Copy link

I also experience this. It used to work on v21.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has to-upstream test This bug has a failing to-upstream web platform test waiting to be fixed selectors CSS Selectors support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
0