Skip to content

selector not work when use uppercase node name #3612

@flybywind

Description

@flybywind

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.)

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