UNPKG

orionsoft-react-scripts

Version:

Orionsoft Configuration and scripts for Create React App.

584 lines (419 loc) 92.8 kB
## 9.8.3 * Fixed syntax errors in node v4. ## 9.8.2 * Fixed `DOMTokenList` and `getElementsByClassName` to only split on ASCII whitespace, not all Unicode whitespace. ## 9.8.1 * Fixed an error that occurred when passing no class names to `getElementsByClassName`, e.g. `getElementsByClassName("")` or `getElementsByClassName(" ")`. ## 9.8.0 * 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. ## 9.7.1 * Fixed a performance regression introduced in 9.5.0 for modifying the DOM. It was particularly noticable during initial parsing of a document with many elements; for example, one test showed parsing ten thousand elements taking 36.4 seconds, whereas after this fix it is back to a more reasonable 0.4 seconds. ## 9.7.0 * Added `EventListenerOptions` support to `addEventListener` and `removeEventListener`, including both the `once` and `capture` options. (GianlucaGuarini) * Added `document.hasFocus()` (acusti) * Fixed the focus management to ensure that focusing something inside an `iframe` will also focus the `iframe` itself (acusti) ## 9.6.0 * Added `HTMLCollection.prototype[Symbol.iterator]`, so you can use `for`-`of` loops over `HTMLCollection`s now. (i8-pi) * Fixed `file.lastModified` to return the current time as the default, instead of `0`. * Fixed cloning of `Attr`s to properly clone the namespace prefix. * Tweaked `XMLHttpRequest` progress event ordering slightly to better match the spec and browsers. * Tweaked the behavior of calling `event.stopPropagation` and `event.stopImmediatePropagation` on already-dispatched events, per [the latest changes to the DOM Standard](https://github.com/whatwg/dom/commit/806d4aab584f6fc38c21f8e088b51b8ba3e27e20). ## 9.5.0 * Added `document.scripts`, `document.embeds`, and `document.plugins`. * Fixed `document.getElementsByTagName` and `document.getElementsByTagNameNS` to return `HTMLCollection`s instead of `NodeList`s, and to follow the spec algorithms more exactly. * Fixed various `HTMLCollection`-returning getters such as `document.applets` or `table.cells` to be more spec-compliant. * Fixed the resource loader to respect the `agent` and `agentClass` options, not just the `agentOptions` one. * Fixed `console.groupCollapse` to be `console.groupCollapsed` (and changed the virtual console accordingly). ## 9.4.5 * Fixed `"error"` events from failed resource loads going missing since 9.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. ## 9.4.3 * Fixed spurious `"jsdomError"`s occuring when closing a window, due to aborted resource loads. ## 9.4.2 * Fixed what would happen when inline event handlers (such as `element.onclick`) would return non-boolean values (such as `undefined`); it would previously erroneously cancel the event, in many cases. (dmethvin) * Upgraded the minimum tough-cookie version to ensure all installations are protected against [a security advisory](https://nodesecurity.io/advisories/130). ## 9.4.1 * Implemented the cloning steps for `<input>` elements, so that cloned inputs properly copy over their value, checkedness, dirty value flag, and dirty checkedness flag. (matthewp) ## 9.4.0 * Added the `DOMParser` API. It is spec-compliant, including producing `<parsererror>` elements, except that the produced documents do not have the same URL as the creating document (they instead always have `"about:blank"`). * Added strict XML parsing when using `parsingMode: "xml"`. Creating documents will now fail, just like in a browser, when ill-formed XHTML markup is used. * Added some rudimentary application of XML `<!ENTITY` declarations. * Added `window.frameElement`, although without appropriate cross-origin security checks. * Added the `jsdom.evalVMScript` public API. * Added more custom request agent support: you can now pass `agent` and `agentClass` in addition to `agentOptions`. (frarees) * Updated our elements-being-disabled semantics to more closely match the spec, in particular with regard to being descendants of `<fieldset disabled>`. * Updated `FormData` for [recent spec fixes](https://github.com/whatwg/xhr/commit/1a75845e67792418a7721d516266ad01a90f2062): blobs, files, and filenames should now all work like you'd expect. * Updated the `FormData` constructor to use the proper, rather-complex, [constructing the form data set](https://html.spec.whatwg.org/multipage/forms.html#constructing-form-data-set) algorithm. * Fixed all constructors that appears as globals on the jsdom `window` object to be non-enumerable. * Fixed `<script>` elements to load when they gain a `src` attribute while in a document. * Fixed `<link rel="stylesheet">` elements to load when their `href` attributes change while in a document. * Fixed the loading of external `<img>`s (when the `canvas` npm package is installed) that were specified via relative URL; this regressed in 9.2.1. * Fixed `<iframe>` documents to have the correct `referrer` value (viz. the URL of their parent). * Fixed the value of `input.checked` inside `click` events on checkboxes. * Fixed the window object's named properties to correctly return the `<iframe>` element or the `<iframe>`'s window in appropriate scenarios involving `name` vs. `id` attributes on the `<iframe>`. (matthewp) ## 9.3.0 * Added the `Audio` named constructor. * Fixed the `Image` named constructor to follow the spec more closely (e.g. `Image.prototype` is now equal to `HTMLImageElement.prototype`). * Fixed the `tabIndex` setter, which regressed in 9.1.0, to no longer cause errors. * Made submit buttons and labels respond to click event cancelation correctly, preventing form submission and re-dispatching to the relevant form control. (marcandre) * Fixed unhandled errors thrown in XHR event handlers being swallowed; they now properly are redirected to the virtual console. ## 9.2.1 * Fixed `<input>`'s `selectionStart`, `selectionEnd`, and `selectionDirection` getters to return null, instead of throwing, for elements that do not allow selection, per [a recent spec change](https://github.com/whatwg/html/pull/1006). * Fixed `<base>`'s `href` getter logic to return the attribute value instead of the empty string for unparseable URLs, per [a recent spec change](https://github.com/whatwg/html/pull/1064). * Fixed the referrer sent when retrieving external resources to be the document's URL, not the document's base URL. * Fixed suppression of all `error` events on `window` beyond the first one. * Fixed `new URL` to correctly throw for unparseable URLs, and all of `URL`'s setters to correctly ignore invalid input instead of throwing. * Fixed `StyleSheetList.prototype.item` to return `null` instead of `undefined` for out-of-bounds indices. (Ginden) * Updated `cssstyle` minimum version to ensure all jsdom installs (not just fresh ones) get the benefit of `cssstyle`'s recently-better `background` and `width` setters. ## 9.2.0 * Added `jsdom.changeURL(window, newURL)` for allowing you to override a window's existing URL. (mummybot) * Fixed the `proxy` option to be applied to all requests; previously it was not always passed through. (nicolashenry) * Fixed `XMLHttpRequest` response header filtering for cross-origin requests; this also fixes `ProgressEvent`s fired from such XHRs. (nicolashenry) ## 9.1.0 * Added a somewhat-reasonable implementation of focus and focus events. Although the full complexity of focus is not implemented, the following improvements have been made: - Only elements which are focusable can be focused. - Added the `FocusEvent` class, and now `focus` and `blur` events are fired appropriately. - `tabIndex` now returns `0` by default for focusable elements. * Reimplemented `navigator` to be to-spec: - Added `appCodeName`, `product`, `productSub`, `vendor`, and `vendorSub`; also changes `userAgent`, `appName`, `platform`, and `version` to be more browser-like instead of based on various Node.js information. - Added `language` and `languages`. - Added `onLine`. - Added `javaEnabled()`. - Removed `noUI`. * 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. ## 9.0.0 This major release removes jsdom's support for mutation events. Mutation events were never well-specified, and the modern DOM Standard omits them in the hopes that they can be removed from browsers (although this has not yet happened in major browser engines). We had hoped to implement their modern alternative, mutation observers, before performing this removal, to give jsdom users the same capabilities. 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. Your normal change log follows: * **Removed mutation events**, as discussed above. * Added the `DOMTokenList.prototype.replace` method. (nicolashenry) * Updated `DOMTokenList.prototype.contains` to no longer validate its arguments, as per the latest spec. (nicolashenry) * Made various improvements to XMLHttpRequest (nicolashenry): - Added the `responseURL` property. - Updated methods, headers, and header values to use the `ByteString` algorithm. - Fixed the default `statusText` to be `""` instead of `"OK"`. * Fixed the `Blob` constructor's `type` validation. (nicolashenry) ## 8.5.0 * Added encoding handling (nicolashenry) - `jsdom.env`, when given a URL or file, will decode the resulting bytes using signals like the `Content-Type` header, `<meta charset>` declaration, or presence of a BOM, in the same manner as web browsers. - Fetching external resources, via mechanisms such as XMLHttpRequest or `<script>`/`<link>`/`<iframe>` tags, will also account for such signals. - `jsdom.jsdom()`, which takes a string, still sets a "UTF-8" encoding by default, since there are no bytes or headers for it to sniff an encoding from. * Removed `iframe.sandbox` property, since it was not implemented and simply crashed when used. * Removed `element.sourceIndex` property, since it was nonstandard (Internet Explorer only). * Fixed setting proxied inline event handlers, such as `doc.body`'s `onload=""` attribute, for documents that do not have a browsing context. ## 8.4.1 * Fixed an issue where setting `selected` on an multi-select would clear all other selectedness. ## 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 issues with generated files in the published package, which seem to have impacted webpack users. ## 8.3.1 * Fixed an issue where if you modified `Object.prototype`, spurious attributes would show up on your jsdom nodes. (deckar01) ## 8.3.0 * Added image loading and decoding, when the `canvas` npm package is installed (lehni). In practice, this means that if you enable fetching `"img"` external resources, then: * `img.naturalWidth`, `img.naturalHeight`, `img.width`, `img.height`, `img.complete`, and `img.currentSrc` will update themselves correctly as the image loads * `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) ## 8.2.0 * Added correct click behavior for inputs (jeffcarp): - `change` and `input` events now fire appropriately - The "click in progress" flag is implemented, so you cannot click while a click is in progress - Canceling a click event appropriately resets radio buttons and checkboxes * Updated our XMLHttpRequest implementation with a variety of fixes and features, including preliminary CORS support. (nicolashenry) * Added a `strictSSL` top-level option to govern all requests jsdom makes. (nicolashenry) * XHTML frames and iframes are now parsed as XML instead of HTML. (nicolashenry) * Added `document.origin` and `document.lastModified`. (nicolashenry) * Fixed the `scriptEl.text` getter and setter to follow the spec. * Fixed script execution to check against the canonical list of JavaScript MIME types and only execute those scripts as JavaScript. ## 8.1.1 * Fixed input selection methods and properties to properly differentiate between inputs that can be selected outright vs. textual inputs which allow variable-length selection. (yaycmyk) ## 8.1.0 * Added `attr.nodeName`, which was [recently re-added to the spec](https://github.com/whatwg/dom/issues/171). * Added click-proxying behavior from `<label>`s to their labeled form elements. (yaycmyk) * Added a setter for `element.classList` per recent spec changes (it forwards to `element.classList.value`). * Updated our attributes implementation in a few ways for recent spec changes and to fix discovered bugs: - Added `element.getAttributeNames()`. ([spec addition](https://github.com/whatwg/dom/issues/115)) - `setAttributeNode` and `setAttributeNodeNS` can now replace an attribute node, instead of removing the old one and adding a new one; this avoids changing the order in the attribute list. ([spec change](https://github.com/whatwg/dom/issues/116)) - `NamedNodeMap` named properties are now lowercase (except in edge cases involving XML documents or non-HTML elements). ([spec change](https://github.com/whatwg/dom/issues/141)) - `NamedNodeMap` named properties are now non-enumerable. - The `"DOMAttrModified"` mutation event's `relatedNode` is now the new `Attr` object, not the `Node`, as per spec. * Updated `DOMTokenList` to have a `value` property per [recent spec changes](https://github.com/whatwg/dom/issues/119); its `toString` serialization also changed slightly. * Updated `tc.headers` to be a `DOMTokenList` that simply reflects the `headers` attribute; previously it was a string, with its computation doing some weird stuff. * Fixed `document.implementation.createDocument()` to create a document with its parsing mode set to XML, which affects a variety of DOM APIs in small ways. * Fixed `EventTarget.prototype.constructor` to be correct; it was previously `Window`. * Fixed `option.index` for `<option>`s not inside a `<select>` to no longer error. * Fixed `tc.cellIndex` for `<td>`s and `<th>`s not inside a `<tr>` to no longer error. * Fixed `tr.sectionRowIndex` for `<tr>`s not inside a `<table>`, `<tbody>`, `<thead>`, or `<tfoot>` to no longer error. * Removed the `"keyevents"` alias for `"keyboardevent"` when using `document.createEvent`, [per recent spec changes](https://github.com/whatwg/dom/issues/148). ## 8.0.4 * Fixed the `this` value when you pass a `{ handleEvent() { ... } }` object to `addEventListener`. (thetalecrafter) ## 8.0.3 * Fixed `HTMLOptionElement.prototype.label`; a typo was causing it to not work at all. (karlhorky) * Updated `cssstyle` minimum version to ensure all jsdom installs (not just fresh ones) get the benefit of `cssstyle`'s recently-better `padding` and `margin` parsing/CSSOM. ## 8.0.2 * Fixed an issue where custom user agents would not propagate to `navigator.userAgent` in frames and iframes. * Improved our `document.activeElement` implementation to be a bit smarter; we still don't have full focus/blur/active element semantics, but at least now it falls back to the `<body>` element when the active element is removed from the document or when no element has been focused yet. ## 8.0.1 * Fixed an issue where the `this` inside event handler callbacks was not equal to the event's current target. (Surprisingly there were no tests for this!) ## 8.0.0 This major release includes a large rewrite of most of the DOM and HTML classes exposed in jsdom. A lot of their behavior is generated from their specs' IDL syntax, taking care of many type conversions, attribute/property reflections, and much more. Many properties that were previously not present are now available, and almost everything behaves in a more spec-compliant way. Additionally, for these classes all of their implementation details are no longer available as underscore-prefixed properties, but instead are hidden behind a single symbol. Although normally jsdom does not mark a new major release for changes that simply update us to the latest specs or hide internal implementation details better, the magnitude of the changes is so extensive that we want to bump the major version in order to ensure that consumers perform adequate testing before upgrading. But, you should definitely upgrade! The new stuff is really awesome! * Reimplemented `Location`, `History`, and `HTMLHyperlinkElementUtils` (used by both `HTMLAnchorElement` and `HTMLAreaElement`) according to the latest specs, and using the latest [whatwg-url](https://github.com/jsdom/whatwg-url) package. This greatly improves our correctness on URL resolution and navigation (to the extent we support navigation, i.e. `pushState` and changing the hash). It should also improve parsing speed as we no longer parse and resolve URLs during parsing. * Added `Element.prototype.insertAdjacentHTML`. (kasperisager) * Added `Node.prototype.adoptNode`, and adopt nodes during insertion instead of throwing `"WrongDocumentError"`s. (dmethvin) * Added a stub `Element.prototype.getClientRects` to match our stub `getBoundingClientRect`. * Fixed `setTimeout` and `setInterval` to return numeric IDs, instead of objects. (alvarorahul) * Fixed `setTimeout` and `setInterval` to accept string arguments to eval, and to pass along extra arguments after the first two. * Fixed certain style shorthand properties not updating their component properties or parsing correctly. (dpvc) * Fixed `Event` object creation to always initialize the event objects, unless using `document.createEvent`, even for events with name `""`. * Fixed iframes to go through the custom resource loader. (chrmarti) * Removed ["DOM Load and Save"](http://www.w3.org/TR/2003/CR-DOM-Level-3-LS-20031107/load-save.html) stub implementation. That spec was never implemented in browsers, and jsdom only contained stubs. * Removed other minor unimplemented, stub, or no-longer-standard APIs from "DOM Level 3", like the user-data API, `DOMException`, `DOMConfiguration`, and `DOMStringList`. ## 7.2.2 * Fixed `canvasEl.toDataURL()`, with the `canvas` npm package installed; a recent update to the `canvas` package broke how we were passing arguments to do. * Fixed `data:` URL parsing to allow empty contents, e.g. `data:text/css;base64,`. (sebmck) ## 7.2.1 * Fixed a regression in XML parsing of attributes with a namespace URL but no prefix (e.g. `<math xmlns="http://www.w3.org/1998/Math/MathML">`). ## 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). * 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. * Made the task posted by `postMessage` use the inside-jsdom timer queue, instead of the Node.js one. This allows easier mocking. (cpojer) ## 7.1.1 * When `<iframe>`s have unresolvable URLs, jsdom will no longer crash, but will instead just load `about:blank` into them. (This is the spec behavior.) * Fixed `document.writeln` to correctly handle multiple arguments; previously it ignored all after the first. * Fixed `FileList` objects to no longer have a property named `"undefined"`. (jfremy) ## 7.1.0 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"` `DOMException`s 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. ## 7.0.2 * Fixed an issue where inside jsdom `<script>` code, `/regexpliteral/ instanceof RegExp` would be `false`. ## 7.0.1 * 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. ## 7.0.0 This major release has as its headlining feature a completely re-written `XMLHttpRequest` implementation, in a heroic effort by [@nicolashenry](https://github.com/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`. ## 6.5.1 * 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.) ## 6.5.0 * Added `NodeList.prototype[Symbol.iterator]`, so you can now use `for`-`of` loops with `NodeList`s. ## 6.4.0 * 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`. ## 6.3.0 * 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.jsom()` 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. ## 6.2.0 * 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) ## 6.1.0 * Added basic implementations of `HTMLMediaElement` and `HTMLVideoElement`, back-ported from Facebook's Jest project. (cpojer) ## 6.0.1 * Fixed `XMLHttpRequest.prototype.getAllResponseHeaders` to not crash when used with `file:` URLs. (justinmchase) * Fixed `XMLHttpRequest.prototype.response` to correctly return the response text even when `responseType` was unset. (justinmchase) ## 6.0.0 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! * **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: - Overhauled the named properties tracker to not walk the entire tree, thus greatly speeding up the setting of `id` and `name` attributes (including during parsing). - Overhauled everything dealing with tree traversal to use a new library, [symbol-tree](https://github.com/jsdom/js-symbol-tree), to turn many operations that were previously O(n^2) or O(n) into O(n) or O(1). - 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. - 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. - Nodes no longer have a nonstandard `errors` array, or a `raise` method used to put things in that array. * URL parsing and resolution was entirely overhauled to follow [the URL standard](http://url.spec.whatwg.org/)! - This fixes several long-standing bugs and hacks in the jsdom URL parser, which already had a mess of gross patches on top of the built-in io.js parser to be more web-compatible. - The new [`URL` class](https://url.spec.whatwg.org/#url) has been added to `window` - The interfaces for `HTMLAnchorElement.prototype` and `document.location` (as well as `URL`, of course) are now uniformized to follow the [`URLUtils` API](https://url.spec.whatwg.org/#api) (minus `searchParams` for now). - **As part of this change, you may need to start passing in `file:` URLs to `jsdom.env` where previously you were able to get away with passing in filenames.** * 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). * 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. ## 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. ## 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) ## 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)) - 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. * Fixed any virtual console output from iframes to be proxied to the parent window's virtual console. (jeffcarp) * Fixed the `type` property of `<button>` elements to correctly default to `submit`, and to stay within the allowed range. * 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! ## 5.4.3 * Incorporated upstream fix for setting `el.style.cssText` to an invalid value, which should be ignored instead of causing an error to be thrown. This same bug has also caused an error while setting the style attribute to an invalid value, ever since 5.4.0. (Joris-van-der-Wel; chad3814 upstream) ## 5.4.2 * Fixed license metadata to conform to latest npm standards. ## 5.4.1 * Fixed to work with browserify again (regression introduced in 5.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). * 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. `HTMLFormElement`s as well in the future. We also have a bunch more fixes and additions: * Implemented the [`NonDocumentTypeChildNode`](https://dom.spec.whatwg.org/#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](https://github.com/tmpvar/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) * Removed a few functions that were erroneously added to `window`: `mapper`, `mapDOMNodes`, and `visitTree`. (Joris-van-der-Wel) ## 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) ## 5.2.0 * Implemented much of the [`ParentNode`](https://dom.spec.whatwg.org/#interface-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) ## 5.1.0 * 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. ## 5.0.1 * 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>"`. ## 5.0.0 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](https://github.com/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](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. ## 4.5.1 * Removed unnecessary browserify dependency that was erroneously included in 4.5.0. ## 4.5.0 * Added `document.currentScript`. (jeffcarp) ## 4.4.0 * All resources are now loaded with the [request](https://www.npmjs.com/package/request) package, which means that e.g. GZIPped resources will be properly uncompressed, redirects will be followed, and more. This was previously the case only for URLs passed directly to `jsdom.env`, and not for sub-resources inside the resulting page. (ssesha) ## 4.3.0 * Made the click behavior for radio buttons and checkboxes work when doing `el.dispatchEvent(clickEvent)`, not just when doing `el.click()`. (brandon-bethke-neudesic) * Added `defaultPrevented` property to `Event` instances, reflecting whether `ev.preventDefault()` has been called. (brandon-bethke-neudesic) * Moved the `click()` method from `HTMLInputElement.prototype` to `HTMLElement.prototype`, per the latest spec. * Made the `click()` method trigger a `MouseEvent` instead of just an `Event`. ## 4.2.0 * Added a second parameter to `UIEvent`, `MouseEvent`, and `MutationEvent`, which for now just behaves the same as that for `Event`. (Rich-Harris) ## 4.1.0 * Added a second parameter to the `Event` constructor, which allows you to set the `bubbles` and `cancelable` properties. (brandon-bethke-neudesic) ## 4.0.5 * Added `HTMLUnknownElement` and fix the parser/`document.createElement` to create those instead of `HTMLElement` for unknown elements. * Fixed issues with named and indexed properties on `window`, as well as `window.length`, with regard to `<frame>`s/`<iframe>`s being added and removed from the document. _Note:_ this probably should have been a minor version number increment (i.e. 4.1.0 instead of 4.0.5), since it added `HTMLUnknownElement`. We apologize for the deviation from semver. ## 4.0.4 * Fixed parsing of doctypes by relying on the information provided by the html parser if possible. ## 4.0.3 * Fixed events fired from `EventTarget`s to execute their handlers in FIFO order, as per the spec. * Fixed a case where `childNodes` would not be correctly up to date in some cases. (medikoo) * Sped up window creation with `jsdom.env` by ~600%, for the special case when no scripts are to be executed. ## 4.0.2 * `EventTarget` is now correctly in the prototype chain of `Window`. * `EventTarget` argument validation is now correct according to the DOM Standard. * `DOMException` now behaves more like it should per Web IDL. In particular it has a more comprehensive set of constants, and instances now have `name` properties. * `new Event("click")` can now be dispatched. (lovebear) * `document.createEvent` now behaves more like it should according to the DOM Standard: it accepts a wider range of arguments, but will throw if an invalid one is given. (lovebear) * Fixed a regression in our browser support that required Chrome 41 as of 4.0.1; now Chrome 40 will work, as well as (in theory, although less well-tested) the latest stable versions of Firefox and IE. ## 4.0.1 * Fixed: `Node.prototype.contains` to always return a boolean. This was a regression in 3.1.1. (Joris-van-der-Wel) * Fixed: `Document.prototype` no longer contains its own `ownerDocument` getter, instead correctly delegating to `Node.prototype`. * Fixed: some edge cases regarding running `<script>`s in browserified jsdom. * A couple fixes from updated dependencies (although you would have gotten these anyway with a fresh install, due to floating version specifiers): - csstyle minimum version bumped from 0.2.21 to 0.2.23, fixing handling of `0` when setting numeric CSS properties and parsing of shorthand `font` declarations. - parse5 minimum version bumped from 1.3.1 to 1.3.2 to, fixing the parsing of `<form>` elements inside `<template>` elements. ## 4.0.0 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 welco