jsdom: querySelector within a fragment doesn't return SVG elements

Basic info:

  • Node.js version: 6.11.2
  • jsdom version: 11.2.0

Minimal reproduction case

var {JSDOM} = require("jsdom")
var frag = JSDOM.fragment(`<svg></svg>`);
console.log(frag.querySelector("svg"));
console.log(frag.querySelector("*"));

frag.querySelector("svg") returns null, while the wildcard selector correctly returns the SVG element.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (9 by maintainers)

Commits related to this issue

Most upvoted comments

A fix has been included in version 1.4.3, which will be pushed to npm a.s.a.p.

Since it is an exception to the rules it will only be enabled by configuring the special flag SVG_LCASE using the following syntax:

NW.Dom.configure({ SVG_LCASE: true });

it is disabled (false) by default. Thank you for the report.