jsdom v11.0.0 Release Notes
-
๐ฅ Breaking changes:
- ๐ง Custom parsers, via the
parser
option to the old API, can no longer be specified. They were never tested, often broken, and a maintenance burden. The defaults, of parse5 for HTML and sax for XML, now always apply. - โฌ๏ธ Due to a parse5 upgrade, the location info objects returned by
dom.nodeLocation()
or the old API'sjsdom.nodeLocation()
now have a different structure. - Fixed how
runScripts
applies to event handler attributes; now they will no longer be converted into event handler functions unlessrunScripts: "dangerously"
is set. However, event handler properties will now work with anyrunScripts
option value, instead of being blocked.
Other changes:
- Overhauled how event handler properties and attributes work to follow the spec. In particular, this adds various
oneventname
properties to various prototypes, ensures the correct order when interleaving event handlers and other event listeners, and ensures that event handlers are evaluated with the correct values in scope. - โฌ๏ธ Upgraded parse5 from v1 to v3, bringing along several correctness improvements to HTML parsing. (Zirro)
- โก๏ธ Updated
Location
properties to be on the instance, instead of the prototype, and to be non-configurable. - ๐ Significantly improved the performance of
HTMLCollection
, and thus of parsing large documents. (Zirro) - ๐ Significantly improved the performance of
getComputedStyle()
by removing unsupported selectors from the default style sheet. (flaviut) - ๐ Fixed all web platform methods that accepted web platform objects to perform proper type checks on them, throwing a
TypeError
when given invalid values. (TimothyGu) - ๐ Fixed the
Symbol.toStringTag
properties to be non-writable and non-enumerable. (TimothyGu) - ๐ Fixed
tokenList.remove()
when theDOMTokenList
corresponded to a non-existant attribute. (Zirro) - ๐ Fixed
fileReader.abort()
to terminate ongoing reads properly. - ๐ Fixed
xhr.send()
to support array buffer views, not justArrayBuffer
s. (ondras) - ๐ Fixed non-
GET
requests todata:
URLs usingXMLHttpRequest
. (Zirro) - ๐ Fixed form submission to no longer happen for disconnected forms.
- ๐ Fixed body event handler attributes to be treated like all others in terms of how they interact with
runScripts
. - โก๏ธ Many updates per recent spec changes: (Zirro)
- Updated
tokenList.replace()
edge-case behavior. - Invalid qualified names now throw
"InvalidCharacterError"
DOMException
s, instead of"NamespaceError"
DOMException
s. - Changed
input.select()
to no longer throw on types where selection does not apply. - Updated
event.initEvent()
and various related methods to have additional defaults. - Stopped lowercasing headers in
XMLHttpRequest
responses. - Started lowercasing headers in
xhr.getAllResponseHeaders()
, and separating the header values with a comma-space (not just a comma). - Allow a redirect after a CORS preflight when using
XMLHttpRequest
. - Tweaked username/password CORS treatment when using
XMLHttpRequest
. - Changed
xhr.overrideMimeType()
to no longer throw for invalid input. - Removed
blob.close()
andblob.isClosed()
.
- Updated
- โ Removed some remaining not-per-spec
toString()
methods on various prototypes, which were made redundant in v10.1.0 but we forgot to remove.
- ๐ง Custom parsers, via the