Updating NPM dependencies

This commit is contained in:
Drew Heavner
2020-11-11 13:30:52 +00:00
committed by GitHub
parent 7a6fb66c63
commit bd487ef324
9068 changed files with 1400893 additions and 587661 deletions

397
node_modules/jsdom/Changelog.md generated vendored
View File

@@ -1,8 +1,305 @@
# jsdom Changelog
<!-- Style guide:
* Use past tense verbs to start the sentence, e.g. "Fixed", "Added", "Removed", ...
* Each bullet point is a sentence (or more), and so ends with a period.
* Package names are in `code`, sometimes [`linked`]().
* Prefer referring to methods and properties via `someInstance.prop`, instead of `ClassName.prototype.prop`. (Never use `ClassName.prop` except for statics.)
* Refer to attributes via `attr=""`.
* Refer to elements via `<element>`.
* Refer to events via `eventname`.
* Refer to CSS properties via `'propname'`.
* Never use the IDL terms "interface", "attribute", or "operation".
* URL schemes are in `code`, e.g. `data:`.
* Except in the headings, all version numbers get a "v" prefix, e.g. v12.2.0.
* Follow the bullet point with parenthetical GitHub usernames when contributed by a non-core team member, e.g. "Fixed foo. (person)"
Other guidelines:
* Commit messages are primarily for jsdom developers. Changelog entries are primarily for users. Usually you cannot reuse the commit message.
* Sometimes a single commit may expand to multiple changelog entries.
* Do not include commits that have no user-facing impact, e.g. test rolls, refactorings, benchmark additions, etc.
* For regression fixes, note the version in which something regressed.
* Breaking changes get their own section.
* Group in the order "Added", "Removed", "Changed", "Fixed".
* Roughly order changes within those groupings by impact.
-->
## 16.4.0
* Added a not-implemented warning if you try to use the second pseudo-element argument to `getComputedStyle()`, unless you pass a `::part` or `::slotted` pseudo-element, in which case we throw an error per the spec. (ExE-Boss)
* Improved the performance of repeated access to `el.tagName`, which also indirectly improves performance of selector matching and style computation. (eps1lon)
* Fixed `form.elements` to respect the `form=""` attribute, so that it can contain non-descendant form controls. (ccwebdesign)
* Fixed `el.focus()` to do nothing on disconnected elements. (eps1lon)
* Fixed `el.focus()` to work on SVG elements. (zjffun)
* Fixed removing the currently-focused element to move focus to the `<body>` element. (eps1lon)
* Fixed `imgEl.complete` to return true for `<img>` elements with empty or unset `src=""` attributes. (strager)
* Fixed `imgEl.complete` to return true if an error occurs loading the `<img>`, when canvas is enabled. (strager)
* Fixed `imgEl.complete` to return false if the `<img>` element's `src=""` attribute is reset. (strager)
* Fixed the `valueMissing` validation check for `<input type="radio">`. (zjffun)
* Fixed `translate=""` and `draggable=""` attribute processing to use ASCII case-insensitivity, instead of Unicode case-insensitivity. (zjffun)
## 16.3.0
* Added firing of `focusin` and `focusout` when using `el.focus()` and `el.blur()`. (trueadm)
* Fixed elements with the `contenteditable=""` attribute to be considered as focusable. (jamieliu386)
* Fixed `window.NodeFilter` to be per-`Window`, instead of shared across all `Window`s. (ExE-Boss)
* Fixed edge-case behavior involving use of objects with `handleEvent` properties as event listeners. (ExE-Boss)
* Fixed a second failing image load sometimes firing a `load` event instead of an `error` event, when the `canvas` package is installed. (strager)
* Fixed drawing an empty canvas into another canvas. (zjffun)
## 16.2.2
* Updated `StyleSheetList` for better spec compliance; notably it no longer inherits from `Array.prototype`. (ExE-Boss)
* Fixed `requestAnimationFrame()` from preventing process exit. This likely regressed in v16.1.0.
* Fixed `setTimeout()` to no longer leak the closures passed in to it. This likely regressed in v16.1.0. (AviVahl)
* Fixed infinite recursion that could occur when calling `click()` on a `<label>` element, or one of its descendants.
* Fixed `getComputedStyle()` to consider inline `style=""` attributes. (eps1lon)
* Fixed several issues with `<input type="number">`'s `stepUp()` and `stepDown()` functions to be properly decimal-based, instead of floating point-based.
* Fixed various issues where updating `selectEl.value` would not invalidate properties such as `selectEl.selectedOptions`. (ExE-Boss)
* Fixed `<input>`'s `src` property, and `<ins>`/`<del>`'s `cite` property, to properly reflect as URLs.
* Fixed `window.addEventLister`, `window.removeEventListener`, and `window.dispatchEvent` to properly be inherited from `EventTarget`, instead of being distinct functions. (ExE-Boss)
* Fixed errors that would occur if attempting to use a DOM object, such as a custom element, as an argument to `addEventListener`.
* Fixed errors that would occur when closing a window with outstanding requests to `data:` URLs.
* Fixed sporadic issues with the value of `<input type="month">` that could occur in some time zones and for some times.
* Fixed `document.implementation.createDocument()` to return an `XMLDocument`, instead of a `Document`. (ExE-Boss)
* Fixed running jsdom in a browser to detect globals more reliably. (ExE-Boss)
## 16.2.1
* Updated `saxes`, to bring in some BOM-related fixes.
* Updated Acorn-related packages to squelch `npm audit` warnings.
## 16.2.0
* Added support for custom elements! Congratulations and thanks to [@pmdartus](https://github.com/jsdom/jsdom/commits?author=pmdartus) for making this happen, after ten months of hard work and lots of effort poured into the complex architectural prerequisites in jsdom and supporting packages.
* Fixed some issues when trying to use `Attr` as a `Node`, e.g. by checking its `baseURI` property or calling `attr.cloneNode()`.
* Fixed a memory leak during parsing that was introduced in v14.0.0.
* Fixed edge cases in number/string conversion used for certain element properties that reflected integer attributes.
## 16.1.0
* Added `console.timeLog()`.
* Changed `Attr` to extend `Node`, to align with specifications. (ExE-Boss)
* Changed `<noscript>` children to be parsed as nodes, instead of as text, when `runScripts` is left as the default of `undefined`. (ACHP)
* Upgraded `cssstyle` to v2.1.0, which brings along fixes to handling of `rgba()` and `hsl()` colors. (kraynel)
* Fixed some selection-related issues when manipulating the value of `<input>`s and `<textarea>`s. (Matthew-Goldberg)
* Fixed various issues with `setTimeout()`, `setInterval()`, and `requestAnimationFrame()`, particularly around window closing and recursive calls.
## 16.0.1
* Fixed Node v10 and v11 support when `runScripts` was set.
* Fixed the behavior when changing an `<input>`'s `type=""` attribute.
* Fixed input validation behavior for `<input type="range">` when `max=""` is less than `min=""`.
## 16.0.0
For this release we'd like to welcome [@pmdartus](https://github.com/jsdom/jsdom/commits?author=pmdartus) to the core team. Among other work, he's driven the heroic effort of constructor prototype and reform in jsdom and its dependencies over the last few months, to allow us to move away from shared constructors and prototypes, and set the groundwork for custom elements support ([coming soon](https://github.com/jsdom/jsdom/pull/2548)!).
Breaking changes:
* Node v10 is now the minimum supported version.
* The `dom.runVMScript()` API has been replaced with the more general `dom.getInternalVMContext()` API.
* Each jsdom `Window` now creates new instances of all the web platform globals. That is, our old [shared constructor and prototypes](https://github.com/jsdom/jsdom/blob/35894a6703ed1f4de98942780bd99244ac27f600/README.md#shared-constructors-and-prototypes) caveat is no longer in play.
* Each jsdom `Window` now exposes all JavaScript-spec-defined globals uniformly. When `runScripts` is disabled, it exposes them as aliases of the ones from the outer Node.js environment. Whereas when `runScripts` is enabled, it exposes fresh copies of each global from the new scripting environment. (Previously, a few typed array classes would always be aliased, and with `runScripts` disabled, the other classes would not be exposed at all.)
Other changes:
* Added the `AbstractRange`, `Range`, `StaticRange`, `Selection`, and `window.getSelection()` APIs.
* Added working constructors for `Comment`, `Text`, and `DocumentFragment`.
* Added `valueAsDate`, `valueAsNumber`, `stepUp()` and `stepDown()` to `<input>` elements. (kraynel)
* Added `window.origin`.
* Removed `document.origin`.
* Fixed `<template>` to work correctly inside XML documents.
* Fixed some bugs which would cause jsdom to choose the wrong character encoding because it was failing to detect `<meta charset>` or `<meta http-equiv="charset">` elements.
* Fixed `input.type` to default to `"text"`. (connormeredith)
* Fixed incorrect validation errors for `<input>` with fractional values for their `step=""` attribute. (kontomondo)
* Fixed incorrect validation errors on readonly `<input>` elements.
* Fixed `<input type="email" multiple pattern="...">` validation.
* Fixed `fileReader.readAsDataURL()` to always base64-encode the result. (ytetsuro)
* Fixed inserting `<img>` elements into documents without a browsing context to no longer crash when the `canvas` package is installed.
* Fixed a memory leak when using `window.setTimeout()` or `window.setInterval()`.
* Improved the performance of `getComputedStyle()`. (eps1lon)
## 15.2.1
* Fixed `JSDOM.fromURL()` handling of URLs with hashes in them, to no longer send the hash to the server and append an extra copy of it when constructing the `Document`. (rchl)
* Fixed focusing an already-focused element to correctly do nothing, instead of firing additional `focus` events. (eps1lon)
* Fixed typo in the not-implemented message for `mediaElement.addTextTrack()`. (mtsmfm)
* Upgraded `nwsapi` minimum version to 2.2.0, which fixes issues with `::-webkit-` prefixed pseudo-elements and namespaced attribute selectors.
## 15.2.0
* Added basic style inheritance in `getComputedStyle()` for the `'visibility'` property. This sets the foundation for further work on inheritance, cascading, and specificity. (eps1lon)
* Added `shadowRoot.activeElement`.
* Added `readystatechange` events during document loading.
* Added a stub for `form.requestSubmit()`, to match our existing stub for `form.submit()`.
* Changed `el.tabIndex`'s default value, when no `tabindex=""` attribute was set, to reflect the updated specification.
* Changed the exception thrown by `el.attachShadow()` on something that's already a shadow host, to reflect the updated specification.
* Fixed the validation logic for `<input type="range">`.
* Fixed `selectEl.value` when no `<option>` is selected to return the empty string, instead of the value of the first option. (tgohn)
* Fixed various correctness issues with `new FormData(formElement)`. (brendo)
* Fixed error messages when parsing XML to include the filename, instead of using `"undefined"`. (papandreou)
* Fixed the logic for reflected properties to not be affected by overwriting of `el.getAttributeNS()` or `el.setAttributeNS()`.
* Set `canvas` as an optional ``peerDependency`, which apparently helps with Yarn PnP support.
## 15.1.1
* Moved the `nonce` property from `HTMLScriptElement` and `HTMLStyleElement` to `HTMLElement`. Note that it is still just a simple reflection of the attribute, and has not been updated for the rest of the changes in [whatwg/html#2373](https://github.com/whatwg/html/pull/2373).
* Fixed the `style` and `on<event>` properties to properly track their related attributes for SVG elements. (kbruneel)
* Fixed `XMLHttpRequest` merging preflight and response headers. (thiagohirata)
* Fixed `XMLHttpRequest` reserializing `content-type` request headers unnecessarily. See [whatwg/mimesniff#84](https://github.com/whatwg/mimesniff/issues/84) for more details. (thiagohirata)
* Fixed `element.tagName` to be the ASCII uppercase of the element's qualified name, instead of the Unicode uppercase.
## 15.1.0
* Added the `Headers` class from the Fetch standard.
* Added the `element.translate` getter and setter.
* Fixed synchronous `XMLHttpRequest` on the newly-released Node.js v12.
* Fixed `form.elements` to exclude `<input type="image">` elements.
* Fixed event path iteration in shadow DOM cases, following spec fixes at [whatwg/dom#686](https://github.com/whatwg/dom/pull/686) and [whatwg/dom#750](https://github.com/whatwg/dom/pull/750).
* Fixed `pattern=""` form control validation to apply the given regular expression to the whole string. (kontomondo)
## 15.0.0
Several potentially-breaking changes, each of them fairly unlikely to actually break anything:
* `JSDOM.fromFile()` now treats `.xht` files as `application/xhtml+xml`, the same as it does for `.xhtml` and `.xml`. Previously, it would treat them as `text/html`.
* If the `JSDOM` constructor's `contentType` option has a `charset` parameter, and the first argument to the constructor is a binary data type (e.g. `Buffer` or `ArrayBuffer`), then the `charset` will override any sniffed encoding in the same way as a `Content-Type` header would in browser scenarios. Previously, the `charset` parameter was ignored.
* When using the `Blob` or `File` constructor with the `endings: "native"` option, jsdom will now convert line endings to `\n` on all operating systems, for consistency. Previously, on Windows, it would convert line endings to `\r\n`.
## 14.1.0
* 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`](https://www.npmjs.com/package/nwsapi) version from v2.1.1 to v2.1.3, bringing along a few fixes in our selector engine.
## 14.0.0
Breaking changes:
* `JSDOM.fragment()` now creates fragments whose document has no [browsing context](https://html.spec.whatwg.org/multipage/#concept-document-bc), 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.
## 13.2.0
* Added support for `MutationObserver`s! (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`](https://github.com/lddubeau/saxes) dependency, so that it now correctly errors on XML fragments like `<foo bar:="1"/>`.
## 13.1.0
* 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](https://bugs.chromium.org/p/v8/issues/detail?id=6730#c4).
* 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](https://github.com/whatwg/html/commit/6acdb2122298d2bb7bb839c0a61b4e1f9b0f9bc9).
* 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]`.
## 13.0.0
Breaking change:
* Removed support for v1.x of the [`canvas`](https://github.com/Automattic/node-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`](https://github.com/jsdom/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](https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity) algorithm). It is no longer possible to add, remove, or move nodes to create impossible DOM trees. (pmdartus)
## 12.2.0
* 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)
## 12.1.0
* Dramatically upgraded our XML parser, from the unmaintained [`sax`](https://github.com/isaacs/sax-js) package to the well-maintained [`saxes`](https://github.com/lddubeau/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)
## 12.0.0
This major release brings along our [new resource loader API](https://github.com/jsdom/jsdom#loading-subresources), finally bringing all the capabilities from jsdom v9 to the new (jsdom v10+) API. Thanks very much to [@sarvaje](https://github.com/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`](https://github.com/inikulin/parse5/) dependency to v5, which changes the format of the node locations returned by `dom.nodeLocation()`.
* Updated our [`whatwg-url`](https://github.com/jsdom/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.
## 11.12.0
* Added `window.localStorage`, `window.sessionStorage`, and `StorageEvent` support. These are currently only stored in-memory; file an issue if you need persistent (on-disk) storage capability so we can discuss adding that. This feature includes the new `storageQuota` option for controlling how much can be stored.
* Added `element.closest()`. (caub)
* Changed `"hashchange"` and `"popstate"` events to no longer bubble, per a specification update.
* Changed `hashchange` and `popstate` events to no longer bubble, per a specification update.
* Fixed the old API in Node.js v10 to not throw, when given input that is not a valid file path (such as a typical HTML string).
* Upgraded `cssstyle` to v1.0.0, bringing along various fixes to our CSS parser and object model. (eddies)
* Upgraded `nwsapi` to v2.0.7, bringing along various fixes to our selector engine.
@@ -43,14 +340,14 @@
* Added `FileReader`'s `readAsBinaryString()` method, as it has been added back to the specification.
* Fixed event handlers to be own properties of each `Window`, instead of on `Window.prototype`. (Fetz)
* Fixed an exception that would sometimes get raised when removing an `<img>` element's `src=""` attribute. (atsikov)
* Fixed `"abort"` events on `AbortSignal`s to have their `isTrusted` set to true.
* Fixed `abort` events on `AbortSignal`s to have their `isTrusted` set to true.
* Fixed some argument conversions in `XMLHttpRequest`'s `open()` method.
* Improved MIME type and data: URL parsing throughout jsdom, by using the new [`whatwg-mimetype`](https://www.npmjs.com/package/whatwg-mimetype) and [`data-urls`](https://www.npmjs.com/package/data-urls) packages.
* Improved MIME type and `data:` URL parsing throughout jsdom, by using the new [`whatwg-mimetype`](https://www.npmjs.com/package/whatwg-mimetype) and [`data-urls`](https://www.npmjs.com/package/data-urls) packages.
* Removed some unnecessary `.webidl` files that were included in the npm package.
## 11.6.2
* Fixed another regression (since v11.6.0) in `<style>` elements, where they would omit a series of parsing `"jsdomError"`s for any style sheet text containing spaces.
* Fixed another regression (since v11.6.0) in `<style>` elements, where they would omit a series of parsing `jsdomError` events for any style sheet text containing spaces.
* Generally improved the spec-conformance of when `<style>` and `<script>` elements are evaluated; for example, `<script>` elements inserted by `innerHTML` are no longer evaluated.
## 11.6.1
@@ -58,7 +355,7 @@
* Fixed one regression (since v11.6.0) in `<style>` elements, where their `sheet` property would sometimes be `null` when it should not be.
* Fixed a case where a `<style>` element's `sheet` property would be left as a `CSSStyleSheet` despite it not being in the document.
Another regression remains where we are emitting spurious CSS-parsing `"jsdomError"` events; see [#2123](https://github.com/tmpvar/jsdom/issues/2123). We also discovered a large amount of preexisting brokenness around `<style>`, `<link>`, and `@import`; see [#2124](https://github.com/tmpvar/jsdom/issues/2124) for more details.
Another regression remains where we are emitting spurious CSS-parsing `jsdomError` events; see [#2123](https://github.com/jsdom/jsdom/issues/2123). We also discovered a large amount of preexisting brokenness around `<style>`, `<link>`, and `@import`; see [#2124](https://github.com/jsdom/jsdom/issues/2124) for more details.
We'll try to fix these soon, especially the regression.
@@ -77,7 +374,7 @@ We'll try to fix these soon, especially the regression.
* Fixed the firing of `popstate` and `hashchange` events during fragment navigation to make them trusted events.
* Fixed `data:` URL parsing to not include the fragment portions.
* Fixed all URL-accepting properties to properly perform [scalar value string conversion](https://infra.spec.whatwg.org/#javascript-string-convert) and URL resolution.
* Fixed many other small edge-case conformance issues in the API surface of various web APIs; see [#2053](https://github.com/tmpvar/jsdom/pull/2053) and [#2081](https://github.com/tmpvar/jsdom/pull/2081) for more information.
* Fixed many other small edge-case conformance issues in the API surface of various web APIs; see [#2053](https://github.com/jsdom/jsdom/pull/2053) and [#2081](https://github.com/jsdom/jsdom/pull/2081) for more information.
* Fixed various APIs to use ASCII lowercasing, instead of Unicode lowercasing, for element and attribute names.
* Fixed the encoding of a document created via `new Document()` to be UTF-8.
* Fixed event handler properties behavior when given non-callable objects.
@@ -94,10 +391,10 @@ We'll try to fix these soon, especially the regression.
## 11.4.0
For this release we'd like to welcome [@Zirro](https://github.com/tmpvar/jsdom/commits?author=Zirro) to the core team; his contributions over the course of this year have enhanced jsdom immensely.
For this release we'd like to welcome [@Zirro](https://github.com/jsdom/jsdom/commits?author=Zirro) to the core team; his contributions over the course of this year have enhanced jsdom immensely.
* Added a rudimentary set of SVG element classes, namely `SVGElement`, `SVGGraphicsElement`, `SVGSVGElement`, `SVGTests`, `SVGAnimatedString`, `SVGNumber`, and `SVGStringList`. The main impact here is that SVG elements are now instances of `SVGElement`, instead of being simply `Element` (as they were in v11.3.0) or `HTMLUnknownElement` (as they were in v11.2.0 and previously). The only concrete subclass that is implemented is `SVGSVGElement`, for `<svg>` itself; other tags will not map to their correct classes, because those classes are not yet implemented.
* Added the new `pretendToBeVisual` option, which controls the presence of the new `requestAnimationFrame()` and `cancelAnimationFrame()` methods, and the new values of `document.hidden`/`document.visibilityState`. [See the README](https://github.com/tmpvar/jsdom#pretending-to-be-a-visual-browser) for more information. (SimenB)
* Added the new `pretendToBeVisual` option, which controls the presence of the new `requestAnimationFrame()` and `cancelAnimationFrame()` methods, and the new values of `document.hidden`/`document.visibilityState`. [See the README](https://github.com/jsdom/jsdom#pretending-to-be-a-visual-browser) for more information. (SimenB)
* Added the `append()` and `prepend()` methods to `Document`, `DocumentFragment`, and `Element`. (caub)
* Added the `before()`, `after()`, and `replaceWith()` methods to `DocumentType`, `Element`, and `CharacterData`. (caub)
* Added `node.isConnected`.
@@ -116,7 +413,7 @@ For this release we'd like to welcome [@Zirro](https://github.com/tmpvar/jsdom/c
## 11.3.0
For this release we'd like to formally welcome [@TimothyGu](https://github.com/tmpvar/jsdom/commits?author=TimothyGu) to the core team, as a prolific contributor. He will join the illustrious ranks of those who do so much work on jsdom that we no longer note their names in the changelog.
For this release we'd like to formally welcome [@TimothyGu](https://github.com/jsdom/jsdom/commits?author=TimothyGu) to the core team, as a prolific contributor. He will join the illustrious ranks of those who do so much work on jsdom that we no longer note their names in the changelog.
* Added `table.tHead`, `table.tFoot`, and `table.caption` setters, and the `table.createTBody()` method.
* Added `CompositionEvent` and `WheelEvent` classes.
@@ -147,7 +444,7 @@ This release brings with it a much-awaited infrastructure change, as part of [we
* Added suport for `FileList` indexed properties, i.e. `fileList[i]`.
* Made `select.options` an instance of the newly-implemented `HTMLOptionsCollection`, instead of just a `HTMLCollection`.
This infrastructure will allow us to improve and implement many other similar behaviors; that work is being tracked in [#1129](https://github.com/tmpvar/jsdom/issues/1129).
This infrastructure will allow us to improve and implement many other similar behaviors; that work is being tracked in [#1129](https://github.com/jsdom/jsdom/issues/1129).
In addition to these improvements to the object model, we have more work to share:
@@ -213,7 +510,7 @@ Other changes:
* Changed `XMLHttpRequest` to pre-allocate a 1 MiB buffer, which it grows exponentially as needed, in order to avoid frequent buffer allocation and concatenation. (skygon)
* Fixed a variety of properties that were meant to always return the same object, to actually do so. (Zirro)
* Fixed inheritance of the `runScripts` and `resources` options into iframes.
* Fixed an uncaught exception that occurred if you called `xhr.abort()` during a `"readystatechange"` event.
* Fixed an uncaught exception that occurred if you called `xhr.abort()` during a `readystatechange` event.
## 10.0.0
@@ -227,7 +524,7 @@ Apart from the new API, the following changes were made, with breaking changes b
* **Changed the `omitJsdomErrors` option to `omitJSDOMErrors`**, for consistency [with web platform APIs](https://w3ctag.github.io/design-principles/#casing-rules).
* Added `document.dir`. (Zirro)
* Updated the `<a>` and `<area>` APIs to the latest specification, and fixed a few bugs with them. (makana)
* Fixed `<img>` elements to no longer fire `"load"` events unless their image data is actually loaded (which generally only occurs when the `canvas` package is installed).
* Fixed `<img>` elements to no longer fire `load` events unless their image data is actually loaded (which generally only occurs when the `canvas` package is installed).
* Fixed `XMLHttpRequest` preflights to forward approved preflight headers to the actual request. (mbroadst)
* Fixed `htmlElement.dir` to properly restrict its values to `"ltr"`, `"rtl"`, or `"auto"`. (Zirro)
* Fixed setting `innerHTML` to the empty string to no longer be a no-op. (Zirro)
@@ -293,7 +590,7 @@ Apart from the new API, the following changes were made, with breaking changes b
* Added the `blob.isClosed` property. (TimothyGu)
* Fixed the `file.lastModified` property to be on `File` instead of on `Blob`. (TimothyGu)
* Fixed the `file.lastModified` property to default to the time of the `File` object's creation, not the time that the property is accessed. (TimothyGu)
* Fixed a minor edge-case regression where non-HTML elements with the name `"iframe"` became focusable in 9.7.0.
* Fixed a minor edge-case regression where non-HTML elements with the name `"iframe"` became focusable in v9.7.0.
## 9.7.1
@@ -323,11 +620,11 @@ Apart from the new API, the following changes were made, with breaking changes b
## 9.4.5
* Fixed `"error"` events from failed resource loads going missing since 9.4.3. I really should have tested that release better.
* Fixed `error` events from failed resource loads going missing since v9.4.3. I really should have tested that release better.
## 9.4.4
* Fixed a leftover `console.log` introduced in the error handling path in 9.4.3.
* Fixed a leftover `console.log` introduced in the error handling path in v9.4.3.
## 9.4.3
@@ -400,7 +697,7 @@ Apart from the new API, the following changes were made, with breaking changes b
* Fixed `formEl.action` to return a value resolved relative to the document URL, or to return the document URL if the corresponding attribute is missing or empty.
* Sped up XPath execution. (vsemozhetbyt)
* Fixed `window.close()` not correctly clearing event listeners on the document. (Ojek)
* Fixed a regression introduced in 9.0.0 where invalid CSS would cause a crash while attempting to parse it. Instead, a `"jsdomError"` will now be emitted to the virtual console.
* Fixed a regression introduced in v9.0.0 where invalid CSS would cause a crash while attempting to parse it. Instead, a `"jsdomError"` will now be emitted to the virtual console.
## 9.0.0
@@ -408,7 +705,7 @@ This major release removes jsdom's support for mutation events. Mutation events
However, recent performance investigations revealed that mutation events were the major bottleneck in most jsdom operations; tools like [ecmarkup](https://github.com/bterlson/ecmarkup) which make heavy use of jsdom had their running time halved by removing mutation events, which add serious overhead to every DOM mutation. As such, we are doing a major release with them removed, so that jsdom users can benefit from this massive performance gain.
Mutation observer support is [in progress](https://github.com/tmpvar/jsdom/issues/639); please use the GitHub reactions feature to vote on that issue if you are impacted by this removal and are hoping for mutation observer support to replace it.
Mutation observer support is [in progress](https://github.com/jsdom/jsdom/issues/639); please use the GitHub reactions feature to vote on that issue if you are impacted by this removal and are hoping for mutation observer support to replace it.
Your normal change log follows:
@@ -438,7 +735,7 @@ Your normal change log follows:
## 8.4.0
* Added an implementation of the `TreeWalker` class (and `document.createTreeWalker`). (garycourt)
* Fixed a few minor bugs in URL parsing and the `URL` API, by upgrading to `whatwg-url` 2.0.1.
* Fixed a few minor bugs in URL parsing and the `URL` API, by upgrading to `whatwg-url` v2.0.1.
* Fixed a few issues with generated files in the published package, which seem to have impacted webpack users.
## 8.3.1
@@ -452,7 +749,7 @@ Your normal change log follows:
* `load` and `error` events will fire on the `<img>` element, according to how well image decoding goes.
* You can draw images onto canvases, using the newly-enabled `canvasContext.drawImage` API.
* Added `canvasContext.createPattern` and `canvasContext.toBlob`, when the `canvas` npm package is installed. (lehni)
* Added a basic implementation of the [Page Visibility API](https://w3c.github.io/page-visibility/), in particular a `document.hidden` property that always returns `true`, and a `document.visibilityState` property that always returns `"prerender"`. This is a more standard alternative to our proprietary `navigator.noUI`, which will be removed whenever we release 9.0.0. (kapouer)
* Added a basic implementation of the [Page Visibility API](https://w3c.github.io/page-visibility/), in particular a `document.hidden` property that always returns `true`, and a `document.visibilityState` property that always returns `"prerender"`. This is a more standard alternative to our proprietary `navigator.noUI`, which will be removed whenever we release v9.0.0. (kapouer)
## 8.2.0
@@ -539,7 +836,7 @@ Although normally jsdom does not mark a new major release for changes that simpl
## 7.2.0
* Added support for text selection APIs on `<input>` and `<textarea>`! (sjelin and yaycmyk)
* Replaced our default XML parser with [sax](https://www.npmjs.com/package/sax), thus fixing many (but not all) issues with XML and XHTML parsing. To get a flavor of the issues fixed, check out these now-closed bugs: [#393](https://github.com/tmpvar/jsdom/issues/393), [#651](https://github.com/tmpvar/jsdom/issues/651), [#415](https://github.com/tmpvar/jsdom/issues/415), [#1276](https://github.com/tmpvar/jsdom/issues/1276).
* Replaced our default XML parser with [sax](https://www.npmjs.com/package/sax), thus fixing many (but not all) issues with XML and XHTML parsing. To get a flavor of the issues fixed, check out these now-closed bugs: [#393](https://github.com/jsdom/jsdom/issues/393), [#651](https://github.com/jsdom/jsdom/issues/651), [#415](https://github.com/jsdom/jsdom/issues/415), [#1276](https://github.com/jsdom/jsdom/issues/1276).
* Fixed the `<canvas>` tag to reset its contents when its width or height changed, including the change from the default 300 × 150 canvas. (Applies only when using the `canvas` npm package.)
* Fixed an issue where `HTMLCollection`s would get confused when they contained elements with numeric `id`s or `name`s.
* Fixed an issue with doctype parsing confusing the system ID and public ID.
@@ -618,7 +915,7 @@ This major release has as its headlining feature a completely re-written `XMLHtt
* 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.
- `<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:
@@ -632,7 +929,7 @@ This major release has as its headlining feature a completely re-written `XMLHtt
- 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.jsom()` or `jsdom.env()`, the given string is now attempted to be resolved as a URL before it is installed as `document.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.
@@ -642,7 +939,7 @@ This major release has as its headlining feature a completely re-written `XMLHtt
* 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)
* 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)
## 6.1.0
@@ -657,7 +954,7 @@ This major release has as its headlining feature a completely re-written `XMLHtt
This major release is focused on massive improvements in speed, URL parsing, and error handling. The potential breaking changes are highlighted in bold below; the largest ones are around the `jsdom.env` error-handling paradigm.
This release also welcomes [long-time contributer](https://github.com/tmpvar/jsdom/commits/master?author=Joris-van-der-Wel) [@Joris-van-der-Wel](https://github.com/Joris-van-der-Wel/) to the core team. You may recognize him from earlier changelogs. We're very happy to have his help in making jsdom awesome!
This release also welcomes [long-time contributer](https://github.com/jsdom/jsdom/commits/master?author=Joris-van-der-Wel) [@Joris-van-der-Wel](https://github.com/Joris-van-der-Wel/) to the core team. You may recognize him from earlier changelogs. We're very happy to have his help in making jsdom awesome!
* **io.js 2.0 onward is now required**, as we have begun using ES2015 features only present there.
* Improved performance dramatically, by ~10000x in some cases, due to the following changes:
@@ -666,7 +963,7 @@ This release also welcomes [long-time contributer](https://github.com/tmpvar/jsd
- Sped up `node.compareDocumentPosition` and anything that used it (like `node.contains`) by doing more intelligent tree traversal instead of directly implementing the specced algorithm.
* Overhauled how error handling works in jsdom:
- `window.onerror` (or `window.addEventListener("error", ...)`) now work, and will catch all script errors, similar to in browsers. This also introduces the `ErrorEvent` class, incidentally.
- The virtual console is now the destination for several types of errors from jsdom, using [the new event `"jsdomError"`](https://github.com/tmpvar/jsdom#virtual-console-jsdomerror-error-reporting). This includes: errors loading external resources; script execution errors unhandled by `window.onerror`; and not-implemented warnings resulting from calling methods like `window.alert` which jsdom explicitly does not support.
- The virtual console is now the destination for several types of errors from jsdom, using [the new event `"jsdomError"`](https://github.com/jsdom/jsdom#virtual-console-jsdomerror-error-reporting). This includes: errors loading external resources; script execution errors unhandled by `window.onerror`; and not-implemented warnings resulting from calling methods like `window.alert` which jsdom explicitly does not support.
- Since script errors are now handled by `window.onerror` and the virtual console, they are no longer included in the initialization process. This results in two changes to `jsdom.env` and the initialization lifecycle:
+ **The `load(errors, window)` callback was changed to `onload(window)`**, to reflect that it is now just sugar for setting a `window.onload` handler.
+ **The `done(errors, window)` callback (i.e., the default callback for `jsdom.env`) has become `done(error, window)`**, and like every other io.js callback now simply gives you a single error object, instead of an array of them.
@@ -679,27 +976,27 @@ This release also welcomes [long-time contributer](https://github.com/tmpvar/jsd
* Added the `XMLHttpRequest.prototype.response` getter.
* Fixed `StyleSheetList.prototype.item` to actually work. (chad3814)
* Fixed the browser `vm` shim to properly add the built-in global properties (`Object`, `Array`, etc.) to the sandbox. If you were running jsdom inside a web worker and most of your scripts were broken, this should fix that.
* Fixed the `"hashchange"` event to correctly fire `HashChangeEvent` instances, with correct properties `newURL` and `oldURL` (instead of the incorrect `newUrl` and `oldUrl` used previously).
* Fixed the `hashchange` event to correctly fire `HashChangeEvent` instances, with correct properties `newURL` and `oldURL` (instead of the incorrect `newUrl` and `oldUrl` used previously).
* Removed usage of the setimmediate library, as it required `eval` and thus did not work in CSP scenarios.
Finally, if you're a loyal jsdom fan whose made it this far into the changelog, I'd urge you to come join us in [#1139](https://github.com/tmpvar/jsdom/issues/1139), where we are brainstorming a modernized jsdom API that could get rid of many of the warts in the current one.
Finally, if you're a loyal jsdom fan whose made it this far into the changelog, I'd urge you to come join us in [#1139](https://github.com/jsdom/jsdom/issues/1139), where we are brainstorming a modernized jsdom API that could get rid of many of the warts in the current one.
## 5.6.1
* Fixed an accidentally-created global `attribute` variable if you ever called `createAttributeNS`.
* Dependency upgrades fixed a couple of bugs, although you would have gotten these anyway with a clean jsdom 5.6.0 install:
- Parsing of CSS properties that use `url("quoted string")` now works correctly, as of `cssstyle` 0.2.29.
- Selectors for the empty string, like `div[title=""]`, now work correctly, as of `nwmatcher` 1.3.6.
* Dependency upgrades fixed a couple of bugs, although you would have gotten these anyway with a clean jsdom v5.6.0 install:
- Parsing of CSS properties that use `url("quoted string")` now works correctly, as of `cssstyle` v0.2.29.
- Selectors for the empty string, like `div[title=""]`, now work correctly, as of `nwmatcher` v1.3.6.
## 5.6.0
* `virtualConsole.sendTo` now returns `this`, allowing for [a nice shorthand](https://github.com/tmpvar/jsdom/tree/60ccb9b318d0bae8fe37e19af5af444b9c98ddac#forward-a-windows-console-output-to-the-iojs-console). (jeffcarp)
* `virtualConsole.sendTo` now returns `this`, allowing for [a nice shorthand](https://github.com/jsdom/jsdom/tree/60ccb9b318d0bae8fe37e19af5af444b9c98ddac#forward-a-windows-console-output-to-the-iojs-console). (jeffcarp)
## 5.5.0
* Added `postMessage` support, for communicating between parent windows, iframes, and combinations thereof. It's missing a few semantics, especially around origins, as well as MessageEvent source. Objects are not yet structured cloned, but instead passed by reference. But it's working, and awesome! (jeffcarp)
* Rewrote cloning code (underlying `cloneNode` and `importNode`), fixing a number of issues:
- Elements with weird tag names, of the type that only the parser can normally create, can now be cloned ([#1142](https://github.com/tmpvar/jsdom/issues/1142))
- Elements with weird tag names, of the type that only the parser can normally create, can now be cloned ([#1142](https://github.com/jsdom/jsdom/issues/1142))
- Doctypes can now be cloned, per the latest spec.
- Attrs cannot be cloned, per the latest spec (although they still have a `cloneNode` method for now due to legacy).
- Document clones now correctly copy over the URL and content-type.
@@ -708,7 +1005,7 @@ Finally, if you're a loyal jsdom fan whose made it this far into the changelog,
* Fixed clicking on submit `<button>`s to submit their containing form; previously only `<input type="submit">` worked. (rxgx)
* Fixed `document.open()` to return `this`, per spec. (ryanseddon)
Additionally, Joris-van-der-Wel added [a benchmarking framework](https://github.com/tmpvar/jsdom/blob/master/Contributing.md#running-the-benchmarks), and a number of benchmarks, which should help us avoid performance regressions going forward, and also make targeted performance fixes. We're already investigating [some real-world issues](https://github.com/tmpvar/jsdom/issues/1156) using this framework. Very exciting!
Additionally, Joris-van-der-Wel added [a benchmarking framework](https://github.com/jsdom/jsdom/blob/master/Contributing.md#running-the-benchmarks), and a number of benchmarks, which should help us avoid performance regressions going forward, and also make targeted performance fixes. We're already investigating [some real-world issues](https://github.com/jsdom/jsdom/issues/1156) using this framework. Very exciting!
## 5.4.3
@@ -720,14 +1017,14 @@ Additionally, Joris-van-der-Wel added [a benchmarking framework](https://github.
## 5.4.1
* Fixed to work with browserify again (regression introduced in 5.4.0).
* Fixed to work with browserify again (regression introduced in v5.4.0).
## 5.4.0
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](https://github.com/tmpvar/jsdom/issues/994).
- Notably, this makes jQuery's `show()` and `hide()` methods now work correctly; see [#994](https://github.com/jsdom/jsdom/issues/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`.
@@ -739,7 +1036,7 @@ We also have a bunch more fixes and additions:
* 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](https://github.com/tmpvar/jsdom/issues/1109).
- Some weirdnesses around the `style` attribute were fixed along the way; see e.g. [#1109](https://github.com/jsdom/jsdom/issues/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)
@@ -747,7 +1044,7 @@ We also have a bunch more fixes and additions:
## 5.3.0
* Added a `virtualConsole` option to the document creation methods, along with the `jsdom.createVirtualConsole` factory. (See [examples in the readme](https://github.com/tmpvar/jsdom/blob/dbf88666d1152576237ed1c741263f5516bb4005/README.md#capturing-console-output).) 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 `virtualConsole` option to the document creation methods, along with the `jsdom.createVirtualConsole` factory. (See [examples in the readme](https://github.com/jsdom/jsdom/blob/dbf88666d1152576237ed1c741263f5516bb4005/README.md#capturing-console-output).) 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)
## 5.2.0
@@ -791,7 +1088,7 @@ In addition to these changes to the public API, the following new cookie-related
* 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](https://www.npmjs.com/package/tough-cookie) package, which should hopefully mean that it now captures many of the behaviors that were previously missing (for example [#1027](https://github.com/tmpvar/jsdom/issues/1027)). @inikulin is working on [a large pull request to fix tough-cookie to be more spec compliant](https://github.com/goinstant/tough-cookie/pull/30), which should automatically be picked up by jsdom installs once it is merged.
Finally, it's worth noting that we now delegate our cookie handling in general to the [tough-cookie](https://www.npmjs.com/package/tough-cookie) package, which should hopefully mean that it now captures many of the behaviors that were previously missing (for example [#1027](https://github.com/jsdom/jsdom/issues/1027)). @inikulin is working on [a large pull request to fix tough-cookie to be more spec compliant](https://github.com/goinstant/tough-cookie/pull/30), which should automatically be picked up by jsdom installs once it is merged.
## 4.5.1
@@ -859,7 +1156,7 @@ _Note:_ this probably should have been a minor version number increment (i.e. 4.
This release relies on the newly-overhauled `vm` module of io.js to eliminate the Contextify native module dependency. jsdom should now be much easier to use and install, without requiring a C++ compiler toolchain!
Note that as of this release, jsdom no longer works with Node.js™, and instead requires io.js. You are still welcome to install a release in [the 3.x series](https://github.com/tmpvar/jsdom/tree/3.x) if you are stuck on legacy technology like Node.js™.
Note that as of this release, jsdom no longer works with Node.js™, and instead requires io.js. You are still welcome to install a release in [the 3.x series](https://github.com/jsdom/jsdom/tree/3.x) if you are stuck on legacy technology like Node.js™.
In the process of rewriting parts of jsdom to use `vm`, a number of related fixes were made regarding the `Window` object:
@@ -878,11 +1175,11 @@ In the process of rewriting parts of jsdom to use `vm`, a number of related fixe
* Updated `Node.prototype.isEqualNode` to the algorithm of the DOM Standard, fixing a bug where it would throw an error along the way.
* Removed `Node.prototype.isSameNode`, which is not present in the DOM Standard (and was just a verbose `===` check anyway).
* Fixed a couple small issues while browserifying, mainly around `jsdom.env`. However, while doing so discovered that `<script>`s in general don't work too well in a browserified jsdom; see [#1023](https://github.com/tmpvar/jsdom/issues/1023).
* Fixed a couple small issues while browserifying, mainly around `jsdom.env`. However, while doing so discovered that `<script>`s in general don't work too well in a browserified jsdom; see [#1023](https://github.com/jsdom/jsdom/issues/1023).
## 3.1.0
* Added support for [custom external resource loading](https://github.com/tmpvar/jsdom#custom-external-resource-loader). (tobie)
* Added support for [custom external resource loading](https://github.com/jsdom/jsdom#custom-external-resource-loader). (tobie)
## 3.0.3
@@ -905,7 +1202,7 @@ This release updates large swathes of the DOM APIs to conform to the standard, m
3.0.x will be the last release of jsdom to support Node.js. All future releases (starting with 4.0.0) will require [io.js](https://iojs.org/), whose [new `vm` module](https://github.com/iojs/io.js/blob/v1.x/CHANGELOG.md#vm) will allow us to remove our contextify native-module dependency. (Given that I submitted the relevant patch to joyent/node [1.5 years ago](https://github.com/joyent/node/commit/7afdba6e0bc3b69c2bf5fdbd59f938ac8f7a64c5), I'm very excited that we can finally use it!)
* By default documents now use `about:blank` as their URL, instead of trying to infer some type of file URL from the call site (in Node.js) or using `location.href` (in browsers).
* Introduced a new "virtual console" abstraction for capturing console output from inside the page. [See the readme for more information.](https://github.com/tmpvar/jsdom#capturing-console-output) Note that `console.error` will no longer contribute to the (non-standard, and likely dying in the future) `window.errors` array. (jeffcarp)
* Introduced a new "virtual console" abstraction for capturing console output from inside the page. [See the readme for more information.](https://github.com/jsdom/jsdom#capturing-console-output) Note that `console.error` will no longer contribute to the (non-standard, and likely dying in the future) `window.errors` array. (jeffcarp)
* Added the named `new Image(width, height)` constructor. (vinothkr)
* Fixed an exception when using `querySelector` with selectors like `div:last-child > span[title]`.
* Removed all traces of entities, entity types, notations, default attributes, and CDATA sections.
@@ -923,7 +1220,7 @@ This release updates large swathes of the DOM APIs to conform to the standard, m
## 2.0.0
This release is largely a refactoring release to remove the defunct concept of "levels" from jsdom, in favor of the [living standard model](https://wiki.whatwg.org/wiki/FAQ#What_does_.22Living_Standard.22_mean.3F) that browsers follow. Although the code is still organized that way, that's now [noted as a historical artifact](https://github.com/tmpvar/jsdom/blob/2ff5747488ad4b518fcef97a026c82eab42a0a14/lib/README.md). The public API changes while doing so were fairly minimal, but this sets the stage for a cleaner jsdom code structure going forward.
This release is largely a refactoring release to remove the defunct concept of "levels" from jsdom, in favor of the [living standard model](https://wiki.whatwg.org/wiki/FAQ#What_does_.22Living_Standard.22_mean.3F) that browsers follow. Although the code is still organized that way, that's now [noted as a historical artifact](https://github.com/jsdom/jsdom/blob/2ff5747488ad4b518fcef97a026c82eab42a0a14/lib/README.md). The public API changes while doing so were fairly minimal, but this sets the stage for a cleaner jsdom code structure going forward.
* Removed: `jsdom.level`, and the `level` option from `jsdom.jsdom`.
* Change: the nonstandard `Element.prototype.matchesSelector` method was replaced with the standard `Element.prototype.matches`. (KenPowers)
@@ -931,7 +1228,7 @@ This release is largely a refactoring release to remove the defunct concept of "
## 1.5.0
* Add: missing `window.console` methods, viz. `assert`, `clear`, `count`, `debug`, `group`, `groupCollapse`, `groupEnd`, `table`, `time`, `timeEnd`, and `trace`. All except `assert` do nothing for now, but see [#979](https://github.com/tmpvar/jsdom/issues/979) for future plans. (jeffcarp)
* Add: missing `window.console` methods, viz. `assert`, `clear`, `count`, `debug`, `group`, `groupCollapse`, `groupEnd`, `table`, `time`, `timeEnd`, and `trace`. All except `assert` do nothing for now, but see [#979](https://github.com/jsdom/jsdom/issues/979) for future plans. (jeffcarp)
* Tweak: make `childNodes`, and the many places in jsdom that use it, much faster. (Joris-van-der-Wel)
## 1.4.1
@@ -996,7 +1293,7 @@ This release is largely a refactoring release to remove the defunct concept of "
* Fix: temporarily pin `cssstyle` dependency to at most 0.2.18 until [chad3814/CSSStyleDeclaration#20](https://github.com/chad3814/CSSStyleDeclaration/issues/20) is fixed.
* Fix: browserifying jsdom should work better now that the required packages are included as `dependencies` instead of `devDependencies`. (Sebmaster)
* Fix: using `jsom.env` in a browser environment now correctly defaults `options.url` to `location.href` instead of trying to infer a reasonable `fil://` URL using techniques that fail in the browser. (rattrayalex)
* Fix: using `jsdom.env` in a browser environment now correctly defaults `options.url` to `location.href` instead of trying to infer a reasonable `fil://` URL using techniques that fail in the browser. (rattrayalex)
## 1.0.1
@@ -1004,7 +1301,7 @@ This release is largely a refactoring release to remove the defunct concept of "
## 1.0.0
For a consolidated list of changes from 0.11.1 to 1.0.0, see [this wiki page](https://github.com/tmpvar/jsdom/wiki/Changes-from-0.11.1-to-1.0.0).
For a consolidated list of changes from 0.11.1 to 1.0.0, see [this wiki page](https://github.com/jsdom/jsdom/wiki/Changes-from-0.11.1-to-1.0.0).
* Remove: nonstandard `EventTarget.getListeners`; `EventTarget.forwardIterator`; `EventTarget.backwardIterator`; `EventTarget.singleIterator`.
* Remove: nonstandard `document.innerHTML`. (jorendorff)
@@ -1040,16 +1337,16 @@ For a consolidated list of changes from 0.11.1 to 1.0.0, see [this wiki page](ht
## 1.0.0-pre.1
This is a prerelease of jsdom's first major version. It incorporates several great additions, as well as a general cleanup of the API surface, which make it more backward-incompatible than usual. Starting with the 1.0.0 release, we will be following semantic versioning, so that you can depend on stability within major version ranges. But we still have [a few more issues](https://github.com/tmpvar/jsdom/issues?q=is%3Aopen+is%3Aissue+milestone%3A1.0) before we can get there, so I don't want to do 1.0.0 quite yet.
This is a prerelease of jsdom's first major version. It incorporates several great additions, as well as a general cleanup of the API surface, which make it more backward-incompatible than usual. Starting with the 1.0.0 release, we will be following semantic versioning, so that you can depend on stability within major version ranges. But we still have [a few more issues](https://github.com/jsdom/jsdom/issues?q=is%3Aopen+is%3Aissue+milestone%3A1.0) before we can get there, so I don't want to do 1.0.0 quite yet.
This release owes a special thanks to [@Sebmaster](https://github.com/Sebmaster), for his amazing work taking on some of the hardest problems in jsdom and solving them with gusto.
### Major changes
* jsdom now can be browserified into a bundle that works in web workers! This is highly experimental, but also highly exciting! (lawnsea)
* An overhaul of the [initialization lifecycle](https://github.com/tmpvar/jsdom#initialization-lifecycle), to bring more control and address common use cases. (Sebmaster)
* An overhaul of the [initialization lifecycle](https://github.com/jsdom/jsdom#initialization-lifecycle), to bring more control and address common use cases. (Sebmaster)
* The excellent [parse5](https://npmjs.org/package/parse5) HTML parser is now the default parser, fixing many parsing bugs and giving us full, official-test-suite-passing HTML parsing support. This especially impacts documents that didn't include optional tags like `<html>`, `<head>`, or `<body>` in their source. We also use parse5 for serialization, fixing many bugs there. (Sebmaster)
* As part of the new parser story, we are not supporting XML for now. It might work if you switch to a different parser (e.g. htmlparser2), but in the end, HTML and XML are very different, and we are not attempting to be an XML DOM. That said, we eventually want to support XML to the same extent browsers do (i.e., support XHTML and SVG, with an appropriate MIME type switch); this is being planned in [#820](https://github.com/tmpvar/jsdom/issues/820).
* As part of the new parser story, we are not supporting XML for now. It might work if you switch to a different parser (e.g. htmlparser2), but in the end, HTML and XML are very different, and we are not attempting to be an XML DOM. That said, we eventually want to support XML to the same extent browsers do (i.e., support XHTML and SVG, with an appropriate MIME type switch); this is being planned in [#820](https://github.com/jsdom/jsdom/issues/820).
### Removed jsdom APIs
@@ -1214,7 +1511,7 @@ This release owes a special thanks to [@Sebmaster](https://github.com/Sebmaster)
## 0.6.4
* Fix: CSS selectors which contain commas inside quotes are no longer misinterpreted. (chad3814)
* Add: `<img>` elements now fire `"load"` events when their `src` attributes are changed. (kapouer)
* Add: `<img>` elements now fire `load` events when their `src` attributes are changed. (kapouer)
## 0.6.3