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

Changelog History
Page 10

  • v7.1.0 Changes

    ๐Ÿš€ This is a rather large release bringing with it several important re-implementations of DOM and HTML APIs.

    • Our EventTarget implementation has been rewritten from scratch to follow the spec exactly. This should improve any edge case misbehaviors.
    • Our Event class hierarchy has been rewritten and fleshed out, fixing many gaps in functionality.
      • Previously missing classes KeyboardEvent and TouchEvent are now implemented.
      • Almost all supported Event subclasses now have constructors. (TouchEvent does not yet, and MutationEvent is specified to not have one.)
      • All classes now have correct public APIs, e.g. getters instead of data properties, missing properties added, and constructors that correctly allow setting all the supported properties.
      • document.createEvent("customevent", ...) now correctly creates a CustomEvent instead of an Event, and CustomEvent.prototype.initProgressEvent has been replaced with CustomEvent.prototype.initCustomEvent.
    • โœ… The Attr class and related attribute-manipulating methods has been rewritten to follow the latest specification. In particular, Attr is no longer a subclass of Node, and no longer has child text nodes.
    • โœ… The <template> element implementation has been greatly improved, now passing most web platform tests. Its .content property no longer has an extra intermediate document fragment; it no longer has child nodes; and related parts of the parser and serializer have been fixed, including innerHTML and outerHTML, to now work as specified.
    • querySelector, querySelectorAll, and matches now correctly throw "SyntaxError" DOMExceptions for invalid selectors, instead of just Error instances.
    • Node.prototype's insertBefore, replaceChild, and appendChild methods now check their arguments more correctly.
    • ๐Ÿ— The browser builds now have regained the ability to fetch URLs for content and the like; this had been broken due to an issue with the browser-request package, which is no longer necessary anyway.
  • v7.0.2 Changes

    • ๐Ÿ›  Fixed an issue where inside jsdom <script> code, /regexpliteral/ instanceof RegExp would be false.
  • v7.0.1 Changes

    • ๐Ÿ›  Fixed two bugs with Node.prototype.isEqualNode:
      • It would previously always return true for comparing any two doctypes.
      • It would throw an error when trying to compare two elements that had attributes.
    • Enforced that document.implementation.createDocumentType requires all three of its arguments.
  • v7.0.0 Changes

    ๐Ÿš€ This major release has as its headlining feature a completely re-written XMLHttpRequest implementation, in a heroic effort by @nicolashenry. It includes a number of other smaller improvements and fixes. The breaking changes are highlighted in bold below.

    • Node.js 4.0 onward is now required, as we have begun using ES2015 features only present there.
    • Completely re-implemented XMLHttpRequest and related classes (nicolashenry):
      • Includes support for Blob, File, FileList, FileReader, FormData, ProgressEvent, and the supporting XMLHttpRequestUpload, and XMLHttpRequestEventTarget interfaces.
      • Includes support for synchronous XHRs.
      • Adds some new request-management abilities, documented in the readme. In short, the pool, agentOptions, and userAgent options are new, and resource loads can now be aborted.
      • These implementations are extremely complete and standards-compliant, passing 136 newly-introduced web platform tests.
    • โž• Added document.charset, an alias for document.characterSet.
    • โž• Added HTMLTemplateElement.prototype.content, for getting the contents of a <template> element as a document fragment. (rickychien)
    • ๐Ÿ“œ Implemented "loose" cookie parsing, giving correct execution of code like document.cookie = "foo".
    • Several fixes related to event dispatching and creation, including the addition of Event.prototype.stopImmediatePropagation and the constants NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. This accounted for another 15 newly-passing web platform tests. (nicolashenry)
    • ๐Ÿ›  Fixed document.styleSheets to correctly track the removal of stylesheets from the document. (AVGP)
    • ๐Ÿ›  Fixed the created jsdom lifecycle callback receiving a different window object than the loaded or done callbacks when scripting was enabled.
    • Invalid URLs are no longer allowed when creating a jsdom document; the URL must be parseable, or an error will be thrown.
    • ๐Ÿšš The { omitJsdomErrors } option of the virtual console has moved; it is no longer provided when creating the virtual console, but instead when calling sendTo.
  • v6.5.1 Changes

    • ๐Ÿ›  Fixed an issue where with jsdom.jsdom, you had to pass referrer and cookie options as top-level, whereas with jsdom.env, you had to nest them under a document option. This was unnecessarily confusing. Now both possibilities are allowed for both functions. (The readme only documents the top-level version, though.)
  • v6.5.0 Changes

    • โž• Added NodeList.prototype[Symbol.iterator], so you can now use for-of loops with NodeLists.
  • v6.4.0 Changes

    • โž• Added jsdom.nodeLocation(node) to get the location within the source text of a given node.
    • โž• Added jsdom.reconfigureWindow(window, { top }) to allow changing the value of a window's top property.
    • โž• Added the element argument to the custom resource loader, so you can customize resource loads depending on which element loaded them.
    • โšก๏ธ Updated getElementsByClassName to match the spec. It now correctly splits on whitespace to try to find elements with all the given classes; it returns a HTMLCollection instead of a NodeList; and it memoizes the result.
    • โšก๏ธ Updated NodeList and HTMLCollection to match the spec. The most noticable change is that HTMLCollection no longer inherits from NodeList.
  • v6.3.0 Changes

    • โž• Added a fully spec-compliant implementation of window.atob and window.btoa. (jeffcarp)
    • ๐Ÿ›  Fixed many issues with our <canvas> implementation:
      • With the canvas npm package installed, <canvas> elements are now properly instanceof HTMLCanvasElement and instanceof HTMLElement.
      • <canvas> elements now present the same uniform spec-compliant API both with and without the canvas npm package installed. If the package is not installed, some of the methods will cause not-implemented jsdomError events to be emitted on the virtual console.
      • The width and height properties now correctly reflect the width and height attributes, and have the appropriate default values of 300 and 150.
      • With the canvas npm package installed, <canvas> elements now generally play better with other parts of jsdom, e.g., document.getElementById actually works with them.
    • Introduced and upated many of our element classes, so that at least every tag name/element class pair is now correct, even if some of the classes are stubs. In particular:
      • Complete implementations were added for HTMLDataElement, HTMLSpanElement, and HTMLTimeElement.
      • Stubs were added for HTMLDataListElement, HTMLDialogElement, HTMLEmbedElement, HTMLMeterElement, HTMLOutputElement, HTMLProgressElement, HTMLSourceElement, HTMLTemplateElement, and HTMLTrackElement.
      • HTMLAudioElement was implemented in full, although its HTMLMediaElement base, where most of its functionality is, is still largely a stub.
      • HTMLTableSectionElement, HTMLTableRowElement, HTMLTableCellElement, HTMLTableDataCellElement, and HTMLTableHeaderCellElement were updated to the latest spec.
      • HTMLIsIndexElement was removed; it has never been produced by the parser since 1.0.0-pre.1, and so it has been just a vestigial global property.
      • Appropriate constants were added to HTMLMediaElement.
    • โšก๏ธ Updated everything having to do with base URLs to be per-spec:
      • Added Node.prototype.baseURI property to get the node's owner document's base URL.
      • HTMLBaseElement's href getter now contains appropriate fallbacks and always returns an absolute URL, per spec.
      • If there are no base elements in an "about:blank" iframe document, the base URL correctly falls back to the parent window's base URL.
    • When you provide a url: ... option to jsdom.jsdom() or jsdom.env(), the given string is now attempted to be resolved as a URL before it is installed as document.URL.
      • So for example, providing url: "http://example.com" will mean document.URL returns "http://example.com/", with a trailing slash.
      • In a future major release, we will start throwing if strings that cannot be parsed as valid absolute URL are provided for this option.
  • v6.2.0 Changes

    • โž• Added a full-featured, spec-compliant Element.prototype.classList, closing out a three-year old issue! (wacii)
    • Made virtualConsole.sendTo(console) forward "jsdomError"s to console by calling console.error. This can be turned off by doing virtualConsole.sendTo(console, { omitJsdomErrors: true }).
    • ๐Ÿ›  Fixed errors when trying to parse invalid doctype declarations, like <!DOCTYPE>.
    • ๐Ÿ›  Fixed spurious "jsdomError"s that were emitted after calling window.close().
    • ๐Ÿ›  Fixed the DOMSubtreeModified event to fire in more cases. Note that our mutation events implementation remains incomplete, and will eventually be removed (in a major release) once we implement mutation observers. (selam)
  • v6.1.0 Changes

    • โž• Added basic implementations of HTMLMediaElement and HTMLVideoElement, back-ported from Facebook's Jest project. (cpojer)