For this release we'd like to welcome @Zirro to the core team; his contributions over the course of this year have enhanced jsdom immensely.
- Added a rudimentary set of SVG element classes, namely
SVGElement,SVGGraphicsElement,SVGSVGElement,SVGTests,SVGAnimatedString,SVGNumber, andSVGStringList. The main impact here is that SVG elements are now instances ofSVGElement, instead of being simplyElement(as they were in v11.3.0) orHTMLUnknownElement(as they were in v11.2.0 and previously). The only concrete subclass that is implemented isSVGSVGElement, for<svg>itself; other tags will not map to their correct classes, because those classes are not yet implemented. - Added the new
pretendToBeVisualoption, which controls the presence of the newrequestAnimationFrame()andcancelAnimationFrame()methods, and the new values ofdocument.hidden/document.visibilityState. See the README for more information. (@SimenB) - Added the
append()andprepend()methods toDocument,DocumentFragment, andElement. (@caub) - Added the
before(),after(), andreplaceWith()methods toDocumentType,Element, andCharacterData. (@caub) - Added
node.isConnected. - Added
node.isSameNode(). - Added support for parsing CDATA sections in XML documents, including in
domParser.parseFromString(). (@myabc) - Added appropriate
input.valuegetter/setter logic for<input type="file">. - Significantly improved the spec-compliance of
NamedNodeMap, i.e. ofelement.attributes, such that retrieving named or indexed properties will now always work properly. - Fixed
domParser.parseFromString()to not parse HTML character entities in XML documents. (@myabc) - Fixed
xhr.abort()to clear any set headers. - Fixed
XMLHttpRequestto always decoded responses as UTF-8 whenresponseTypeis set to"json". - Fixed
XMLHttpRequestCORS header handling, especially with regard to preflights and Access-Control-Allow-Headers. (@ScottAlbertine) - Fixed the behavior of
radioButton.click()to fire appropriateinputandchangeevents. (@liqwid) - Fixed
querySelector()/querySelectorAll()behavior for SVG elements inside<template>contentsDocumentFragments, including those created byJSDOM.fragment(). (@caub) - Fixed the line number reporting in exception stack traces when using
<script>elements, whenincludeNodeLocationsis set. - Removed the
<applet>element, following the spec.