Changelog History
Page 12
-
v5.4.2 Changes
- ๐ Fixed license metadata to conform to latest npm standards.
-
v5.4.1 Changes
- ๐ Fixed to work with browserify again (regression introduced in v5.4.0).
-
v5.4.0 Changes
๐ This is a pretty exciting release! It includes a couple features I never really anticipated jsdom being awesome enough to have, but our wonderful contributors powered through and made them happen anyway:
- โ Added support for the default HTML stylesheet when using
window.getComputedStyle
! (akhaku)- Notably, this makes jQuery's
show()
andhide()
methods now work correctly; see #994.
- Notably, this makes jQuery's
- โ Added support for named properties on
window
: any elements with anid
attribute, or certain elements with aname
attribute, will cause properties to show up on thewindow
, and thus as global variables within the jsdom. (Joris-van-der-Wel)- Although this is fairly unfortunate browser behavior, it's standardized and supported everywhere, so the fact that jsdom now supports this too means we can run a lot of scripts that would previously fail.
- Previously, we only supported this for
<iframe>
s, and our implementation was quite buggy: e.g.,<iframe name="addEventListener">
would overridewindow.addEventListener
. - Now that we have the infrastructure in place, we anticipate expanding our support so that this works on e.g.
HTMLFormElement
s as well in the future.
๐ We also have a bunch more fixes and additions:
- Implemented the
NonDocumentTypeChildNode
mixin. Practically, this means addingnextElementSibling
andpreviousElementSibling
toElement
and the various types ofCharacterData
. (brandon-bethke-neudesic) - ๐
Updated
StyleSheetList
to inherit fromArray
, as per the latest CSSOM spec. - Overhauled the handling of attributes throughout the DOM, to follow the spec more exactly.
- Our
NamedNodeMap
implementation is up to date, as are the variousElement
methods; other places in the code that deal with attributes now all go through a spec-compliant set of helpers. - Some weirdnesses around the
style
attribute were fixed along the way; see e.g. #1109. - However,
Attr
objects themselves are not yet spec-compliant (e.g., they still inherit fromNode
). That's coming soon.
- Our
- ๐ Fixed an unfortunate bug where
getElementById
would fail to work correctly on<img>
elements whoseid
attributes were modified. (Joris-van-der-Wel) - ๐ Fixed the
virtualConsole
option to work withjsdom.env
, not justjsdom.jsdom
. (jeffcarp) - โ Removed a few functions that were erroneously added to
window
:mapper
,mapDOMNodes
, andvisitTree
. (Joris-van-der-Wel)
- โ Added support for the default HTML stylesheet when using
-
v5.3.0 Changes
- โ Added a
virtualConsole
option to the document creation methods, along with thejsdom.createVirtualConsole
factory. (See examples in the readme.) With this option you can install a virtual console before the document is even created, thus allowing you to catch any virtual console events that occur during initialization. (jeffcarp)
- โ Added a
-
v5.2.0 Changes
- Implemented much of the
ParentNode
mixin (Joris-van-der-Wel):- Moved
children
fromNode
toParentNode
, i.e., made it available onDocument
,DocumentFragment
, andElement
, but not other types of nodes. - Made
children
aHTMLCollection
instead of aNodeList
. - Implemented
firstElementChild
,lastElementChild
, andchildElementCount
.
- Moved
- Implemented the
outerHTML
setter. (Joris-van-der-Wel) - ๐ Fixed the
outerHTML
getter for<select>
and<form>
. (Joris-van-der-Wel) - ๐ Fixed various issues with window-less documents, so that they no longer give incorrect results or blow up in strange ways. You can create such documents with e.g.
document.implementation.createHTMLDocument()
. (Joris-van-der-Wel) - ๐ Fixed relative stylesheet resolution when using
@import
. (dbo)
- Implemented much of the
-
v5.1.0 Changes
- โ Added support for the
NodeIterator
class from the DOM Standard. (Joris-van-der-Wel) - ๐ Fixed an issue with the initial request where it was not sharing its cookie jar with the subsequent requests, sometimes leading to a "possible EventEmitter memory leak detected" warning. (inikulin)
- โก๏ธ Updated tough-cookie to 0.13.0, bringing along many spec compliance fixes. (inikulin)
- โ Added a fast failure in Node.jsโข with a clear error message, so that people don't get confused by syntax errors.
- โ Added support for the
-
v5.0.1 Changes
- ๐ Fixed
document.cookie
setter to no longer ignorenull
; instead it correctly sets a cookie of"null"
. (Chrome is not compliant to the spec in this regard.) - ๐ Fixed documents created with
parsingMode: "xml"
to no longer get"<html><head></head><body></body></html>"
automatically inserted when callingjsdom.jsdom()
with no arguments. - ๐ Fixed the
innerHTML
setter to no longer ignoreundefined
; instead it correctly sets the innerHTML to"undefined"
. - ๐ Fixed
document.write
to throw for XML documents as per the spec. - ๐ Fixed
document.write
to accept more than one argument (they get concatenated). - ๐ Fixed
document.write("")
to no longer try to write"<html><head></head><body></body></html>"
.
- ๐ Fixed
-
v5.0.0 Changes
๐ This release overhauls how cookies are handled in jsdom to be less fiddly and more like-a-browser. The work for this was done by @inikulin, who is also our beloved parse5 maintainer.
๐ You should only need to worry about upgrading to this release if you use jsdom's cookie handling capabilities beyond the basics of reading and writing to
document.cookie
. If that describes you, here's what changed:- โ Removed
options.jar
andoptions.document.cookieDomain
from the configuration for creating jsdom documents. - Instead, there is now a new option,
options.cookieJar
, which accepts cookie jars created by the newjsdom.createCookieJar()
API. You should use this if you intend to share cookie jars among multiple jsdom documents. - ๐ป Within a given cookie jar, cookie access is now automatically handled on a domain basis, as the browser does, with the domain calculated from the document's URL (supplied as
options.url
when creating a document). This supplants the formeroptions.document.cookieDomain
.
In addition to these changes to the public API, the following new cookie-related features came along for the ride:
- Implemented automatic cookie-jar sharing with descendant
<iframe>
s. (So, if the iframe is same-domain, it can automatically access the appropriate cookies.) - Let
options.document.cookie
accept arrays, instead of just strings, for if you want to set multiple cookies at once.
๐ฆ Finally, it's worth noting that we now delegate our cookie handling in general to the tough-cookie package, which should hopefully mean that it now captures many of the behaviors that were previously missing (for example #1027). @inikulin is working on a large pull request to fix tough-cookie to be more spec compliant, which should automatically be picked up by jsdom installs once it is merged.
- โ Removed
-
v4.5.1 Changes
- โ Removed unnecessary browserify dependency that was erroneously included in 4.5.0.
-
v4.5.0 Changes
- โ Added
document.currentScript
. (jeffcarp)
- โ Added