All Versions
224
Latest Version
Avg Release Cycle
36 days
Latest Release
-

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() and hide() methods now work correctly; see #994.
    • โž• Added support for named properties on window: any elements with an id attribute, or certain elements with a name attribute, will cause properties to show up on the window, 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 override window.addEventListener.
      • Now that we have the infrastructure in place, we anticipate expanding our support so that this works on e.g. HTMLFormElements as well in the future.

    ๐Ÿ›  We also have a bunch more fixes and additions:

    • Implemented the NonDocumentTypeChildNode mixin. Practically, this means adding nextElementSibling and previousElementSibling to Element and the various types of CharacterData. (brandon-bethke-neudesic)
    • ๐Ÿ’… Updated StyleSheetList to inherit from Array, 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 various Element 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 from Node). That's coming soon.
    • ๐Ÿ›  Fixed an unfortunate bug where getElementById would fail to work correctly on <img> elements whose id attributes were modified. (Joris-van-der-Wel)
    • ๐Ÿ›  Fixed the virtualConsole option to work with jsdom.env, not just jsdom.jsdom. (jeffcarp)
    • โœ‚ Removed a few functions that were erroneously added to window: mapper, mapDOMNodes, and visitTree. (Joris-van-der-Wel)
  • v5.3.0 Changes

    • โž• Added a virtualConsole option to the document creation methods, along with the jsdom.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)
  • v5.2.0 Changes

    • Implemented much of the ParentNode mixin (Joris-van-der-Wel):
      • Moved children from Node to ParentNode, i.e., made it available on Document, DocumentFragment, and Element, but not other types of nodes.
      • Made children a HTMLCollection instead of a NodeList.
      • Implemented firstElementChild, lastElementChild, and childElementCount.
    • 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)
  • 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.
  • v5.0.1 Changes

    • ๐Ÿ›  Fixed document.cookie setter to no longer ignore null; 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 calling jsdom.jsdom() with no arguments.
    • ๐Ÿ›  Fixed the innerHTML setter to no longer ignore undefined; 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>".
  • 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 and options.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 new jsdom.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 former options.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.

  • v4.5.1 Changes

    • โœ‚ Removed unnecessary browserify dependency that was erroneously included in 4.5.0.
  • v4.5.0 Changes

    • โž• Added document.currentScript. (jeffcarp)