Skip to content

Releases: jsdom/jsdom

Version 14.1.0

27 Sep 06:34
Compare
Choose a tag to compare
  • Added activation behavior for <a> and <area> elements whose href="" points to a javascript: URL or fragment.
  • Added the <datalist> element's options property.
  • Added the <input> element's list property.
  • Added PageTransitionEvent, and the firing of pageshow events during loading.
  • Exposed the External class as a property of window.
  • Fixed HTML fragment parsing (via innerHTML and outerHTML) to be spec-compliant. (pmdartus)
  • Fixed HTML serialization (e.g. via innerHTML) breaking after setting certain properties to non-string values.
  • Fixed how disabling an element would cause its activation behavior to forever be null, even if it were re-enabled.
  • Fixed all access to attributes to ignore attributes with namespaces, per the spec.
  • Fixed <style>s to no longer apply to documents without a browsing context. This includes fixing a crash that would occur with such styles if they had an @import rule.
  • Fixed <option>'s label and value properties to return correct values in various edge cases.
  • Fixed the load event during document loading to target the Document, not the Window.
  • Fixed the pretendToBeVisual option to propagate to child subframes, as well as the main Window. (pyrho)
  • Updated the minimum nwsapi version from v2.1.1 to v2.1.3, bringing along a few fixes in our selector engine.

Version 14.0.0

27 Sep 06:35
Compare
Choose a tag to compare

Breaking changes:

  • JSDOM.fragment() now creates fragments whose document has no browsing context, i.e. no associated Window. This means the defaultView property will be null, resources will not load, etc.
  • JSDOM.fragment(), called with no arguments, now creates a DocumentFragment with no children, instead of with a single child text node whose data was "undefined".

Other changes:

  • Fixed a regression in v13.2.0 when calling element.blur() on a focused element.
  • Fixed inserting <link> elements into documents with no browsing context to no longer crash if the originating JSDOM was configured to fetch the resource. Now, per spec, <link> elements only attempt to fetch if they are browsing-context connected.
  • Fixed <template> elements to have the correct semantics, of using a separate browsing-context-less document to store its contents. In particular this means resources will not be fetched for elements inside the <template>, as per spec.

Version 13.2.0

27 Sep 06:35
Compare
Choose a tag to compare
  • Added support for MutationObservers! (pmdartus)
  • Added support for XML documents loaded in frames and iframes; previously this would error.
  • Added the <progress> element's value, max, and position properties.
  • Added navigator.plugins and navigator.mimeTypes. (But, they are always empty.)
  • Fixed <summary> elements respond to click events by toggling their parent <details>.
  • Fixed <summary> elements to be focusable.
  • Fixed XML document DOCTYPE parsing to preserve any custom name values.
  • Fixed XML documents to default to UTF-8, not windows-1252 like HTML documents do.
  • Fixed all events fired by jsdom to have isTrusted set to true.
  • Fixed DOMParser-created documents to have their readyState set to "complete".
  • Fixed how nested <fieldset>s get disabled.
  • Fixed getComputedStyle() to throw a sensible exception when passed the wrong argument, instead of one that exposes jsdom internals.
  • Upgraded our saxes dependency, so that it now correctly errors on XML fragments like <foo bar:="1"/>.

Version 13.1.0

27 Sep 06:36
Compare
Choose a tag to compare
  • Added el.insertAdjacentElement() and el.insertAdjacentText().
  • Added the firing of a cancelable reset event to form.reset(). (epfremmer)
  • Added the type, value, and defaultValue properties to <output> elements, including their form reset behavior. (epfremmer)
  • Added the outputEl.htmlFor property.
  • Fixed the performance of parsing large text nodes, particularly noticeable for large inline <style> or <script> elements. This regressed in v11.6.0. To learn more, see V8 issue #6730.
  • Fixed the style property on <a> and <area> elements. This regressed in v13.0.0.
  • Fixed node.isConnected to not always return false for nodes inside a shadow tree. (pmdartus)
  • Fixed <button type="reset"> and <input type="reset"> elements to actually perform a form reset when clicked, instead of doing nothing. (epfremmer)
  • Fixed el.setCustomValidity() for <output> and <fieldset>.
  • Fixed activation behavior when dispatching bubbling click events, so that for example calling el.click() on the child of a submit button element will submit the form.
  • Fixed our XML parsing code to ignore text outside the root element, instead of treating it as an error. (lddubeau)
  • Fixed XML serialization when elements had an unknown prefix.
  • Fixed radio button group name matching to be case-sensitive, per a spec update.
  • Fixed focus/blur events to be composed.
  • Fixed mediaElement.duration to default to NaN.
  • Fixed olEl.start to default to 1.
  • Fixed using XMLHttpRequest against non-existant file: URLs to treat that as a network error, instead of crashing. (pascalbayer) Note that in the future we may completely disable XMLHttpRequest usage against file: URLs to follow the browser security model.
  • Fixed document.title in SVG documents.
  • Fixed titleElement.text to return the child text content, instead of being the same as titleElement.innerHTML.
  • Fixed <textarea>s to properly account for child CDATA section nodes changing.
  • Fixed the value of Element.prototype[Symbol.unscopables].

Version 13.0.0

27 Sep 06:36
Compare
Choose a tag to compare

Breaking change:

  • Removed support for v1.x of the canvas package, in favor of v2.x. This also removes support for canvas-prebuilt, since canvas v2.x has a built-in prebuilt version.

Other changes:

  • Added proper XML serialization, based on the w3c-xmlserializer package. Previously we were just using the HTML serialization, even in XML documents.
  • Added the storageEvent.initStorageEvent() method.
  • Added support for the passive option to addEventListener().
  • Added the relList property to <a>, <area>, and <link> elements.
  • Fixed our implementation of the node tree modification constraints (for example the ensure pre-insertion validity algorithm). It is no longer possible to add, remove, or move nodes to create impossible DOM trees. (pmdartus)

Version 12.2.0

27 Sep 06:36
Compare
Choose a tag to compare
  • Added support for shadow DOM! This includes shadow roots, slots, composed events, and more. (pmdartus)
  • Added the element.toggleAttribute() method.
  • Fixed XMLHttpRequest sometimes sending an empty request body after a preflight request. (andreasf)
  • Fixed the formElement.form property to use an algorithm that also checks the form="" attribute, instead of always looking for the closest ancestor <form> element. (jamietre)
  • Stopped swallowing errors when the canvas or canvas-prebuilt packages were installed, but failed to load. (joscha)

Version 12.1.0

27 Sep 06:36
Compare
Choose a tag to compare
  • Dramatically upgraded our XML parser, from the unmaintained sax package to the well-maintained saxes replacement. This increases our specification conformance, including rejecting certain ill-formed XML documents that were previously accepted, and properly handling other constructs like empty comments, CDATA sections, and <script> elements. (lddubeau)
  • Added fieldsetEl.elements and fieldsetEl.type properties.
  • Added the options parameter to dom.runVMScript(). (SimenB)
  • Added the ability for custom resource loader fetch() implementations to see what element initiated the fetch. (sarvaje)
  • Fixed input and change events for <input> elements to be trusted and uncancelable.
  • "Fixed" <script>s with the async attribute to not execute before sync <script>s that precede them. We still do not, in general, have proper execution of scripts during the initial parsing of a document, so this fix is more of a reduction of badness than an alignment with the specification. This behavior regressed in v12.0.0. (sarvaje)

Version 12.0.0

27 Sep 06:37
Compare
Choose a tag to compare

This major release brings along our new resource loader API, finally bringing all the capabilities from jsdom v9 to the new (jsdom v10+) API. Thanks very much to @sarvaje for his work to make this possible!

Breaking changes:

  • jsdom now requires Node.js v8.
  • Removed the old jsdom API, as the new API now has all the capabilities you need.
  • Updated our parse5 dependency to v5, which changes the format of the node locations returned by dom.nodeLocation().
  • Updated our whatwg-url dependency to v7, which changes the origin of file: URLs to be an opaque origin (and thus file: URLs are no longer same origin to each other).

Other changes:

  • Added countReset(), dir() and dirxml() methods to console.
  • Added the InputEvent class.
  • Added window.status.
  • Added htmlElement.draggable.
  • Fixed window.frameElement to correctly return an actual HTMLElement instance, instead of a jsdom internal class.
  • Fixed cloning of textarea elements to preserve their values.
  • Fixed select.selectedOptions sometimes returning outdated results.
  • Fixed CSS selection APIs sometimes returning outdated results, especially for state pseudo-class selectors like :checked.
  • Fixed CSS selection APIs to throw an error for invalid selectors even when used on empty nodes.
  • Fixed window.name to default to the empty string, per spec, instead of "nodejs".
  • Fixed the default User-Agent to say "unknown OS" instead of "undefined" when jsdom is used in web browsers.