jsdom / jsdom

A JavaScript implementation of various web standards, for use with Node.js

Repository from Github https://github.comjsdom/jsdomRepository from Github https://github.comjsdom/jsdom

Selecting HTML elements became case sensitive

ge-ku opened this issue · comments

Basic info:

  • Node.js version: 20.13.1
  • jsdom version: 24.1.1

Minimal reproduction case

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

const dom = new JSDOM(`<!DOCTYPE html><myElement>Hello world</myElement>`);
console.log(dom.window.document.querySelector("myelement").textContent); // works in 24.1.1, 23.2.0 and 23.1.0
console.log(dom.window.document.querySelector("myElement").textContent); // error in 24.1.1, works in 23.2.0 and 23.1.0

How does similar code behave in browsers?

In browser case doesn't matter, document.querySelector('div') or document.querySelector('dIV') leads to the same result.

This happened previously, incidentally.