UNPKG

87.2 kBMarkdownView Raw
1## 9.3.0
2
3* Added the `Audio` named constructor.
4* Fixed the `Image` named constructor to follow the spec more closely (e.g. `Image.prototype` is now equal to `HTMLImageElement.prototype`).
5* Fixed the `tabIndex` setter, which regressed in 9.1.0, to no longer cause errors.
6* Made submit buttons and labels respond to click event cancelation correctly, preventing form submission and re-dispatching to the relevant form control. (marcandre)
7* Fixed unhandled errors thrown in XHR event handlers being swallowed; they now properly are redirected to the virtual console.
8
9## 9.2.1
10
11* 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).
12* 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).
13* Fixed the referrer sent when retrieving external resources to be the document's URL, not the document's base URL.
14* Fixed suppression of all `error` events on `window` beyond the first one.
15* Fixed `new URL` to correctly throw for unparseable URLs, and all of `URL`'s setters to correctly ignore invalid input instead of throwing.
16* Fixed `StyleSheetList.prototype.item` to return `null` instead of `undefined` for out-of-bounds indices. (Ginden)
17* 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.
18
19## 9.2.0
20
21* Added `jsdom.changeURL(window, newURL)` for allowing you to override a window's existing URL. (mummybot)
22* Fixed the `proxy` option to be applied to all requests; previously it was not always passed through. (nicolashenry)
23* Fixed `XMLHttpRequest` response header filtering for cross-origin requests; this also fixes `ProgressEvent`s fired from such XHRs. (nicolashenry)
24
25## 9.1.0
26
27* 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:
28 - Only elements which are focusable can be focused.
29 - Added the `FocusEvent` class, and now `focus` and `blur` events are fired appropriately.
30 - `tabIndex` now returns `0` by default for focusable elements.
31* Reimplemented `navigator` to be to-spec:
32 - 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.
33 - Added `language` and `languages`.
34 - Added `onLine`.
35 - Added `javaEnabled()`.
36 - Removed `noUI`.
37* 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.
38* Sped up XPath execution. (vsemozhetbyt)
39* Fixed `window.close()` not correctly clearing event listeners on the document. (Ojek)
40* 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.
41
42## 9.0.0
43
44This 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.
45
46However, 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.
47
48Mutation 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.
49
50Your normal change log follows:
51
52* **Removed mutation events**, as discussed above.
53* Added the `DOMTokenList.prototype.replace` method. (nicolashenry)
54* Updated `DOMTokenList.prototype.contains` to no longer validate its arguments, as per the latest spec. (nicolashenry)
55* Made various improvements to XMLHttpRequest (nicolashenry):
56 - Added the `responseURL` property.
57 - Updated methods, headers, and header values to use the `ByteString` algorithm.
58 - Fixed the default `statusText` to be `""` instead of `"OK"`.
59* Fixed the `Blob` constructor's `type` validation. (nicolashenry)
60
61## 8.5.0
62
63* Added encoding handling (nicolashenry)
64 - `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.
65 - Fetching external resources, via mechanisms such as XMLHttpRequest or `<script>`/`<link>`/`<iframe>` tags, will also account for such signals.
66 - `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.
67* Removed `iframe.sandbox` property, since it was not implemented and simply crashed when used.
68* Removed `element.sourceIndex` property, since it was nonstandard (Internet Explorer only).
69* Fixed setting proxied inline event handlers, such as `doc.body`'s `onload=""` attribute, for documents that do not have a browsing context.
70
71## 8.4.1
72
73* Fixed an issue where setting `selected` on an multi-select would clear all other selectedness.
74
75## 8.4.0
76
77* Added an implementation of the `TreeWalker` class (and `document.createTreeWalker`). (garycourt)
78* Fixed a few minor bugs in URL parsing and the `URL` API, by upgrading to `whatwg-url` 2.0.1.
79* Fixed a few issues with generated files in the published package, which seem to have impacted webpack users.
80
81## 8.3.1
82
83* Fixed an issue where if you modified `Object.prototype`, spurious attributes would show up on your jsdom nodes. (deckar01)
84
85## 8.3.0
86
87* 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:
88 * `img.naturalWidth`, `img.naturalHeight`, `img.width`, `img.height`, `img.complete`, and `img.currentSrc` will update themselves correctly as the image loads
89 * `load` and `error` events will fire on the `<img>` element, according to how well image decoding goes.
90 * You can draw images onto canvases, using the newly-enabled `canvasContext.drawImage` API.
91* Added `canvasContext.createPattern` and `canvasContext.toBlob`, when the `canvas` npm package is installed. (lehni)
92* 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)
93
94## 8.2.0
95
96* Added correct click behavior for inputs (jeffcarp):
97 - `change` and `input` events now fire appropriately
98 - The "click in progress" flag is implemented, so you cannot click while a click is in progress
99 - Canceling a click event appropriately resets radio buttons and checkboxes
100* Updated our XMLHttpRequest implementation with a variety of fixes and features, including preliminary CORS support. (nicolashenry)
101* Added a `strictSSL` top-level option to govern all requests jsdom makes. (nicolashenry)
102* XHTML frames and iframes are now parsed as XML instead of HTML. (nicolashenry)
103* Added `document.origin` and `document.lastModified`. (nicolashenry)
104* Fixed the `scriptEl.text` getter and setter to follow the spec.
105* Fixed script execution to check against the canonical list of JavaScript MIME types and only execute those scripts as JavaScript.
106
107## 8.1.1
108
109* 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)
110
111## 8.1.0
112
113* Added `attr.nodeName`, which was [recently re-added to the spec](https://github.com/whatwg/dom/issues/171).
114* Added click-proxying behavior from `<label>`s to their labeled form elements. (yaycmyk)
115* Added a setter for `element.classList` per recent spec changes (it forwards to `element.classList.value`).
116* Updated our attributes implementation in a few ways for recent spec changes and to fix discovered bugs:
117 - Added `element.getAttributeNames()`. ([spec addition](https://github.com/whatwg/dom/issues/115))
118 - `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))
119 - `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))
120 - `NamedNodeMap` named properties are now non-enumerable.
121 - The `"DOMAttrModified"` mutation event's `relatedNode` is now the new `Attr` object, not the `Node`, as per spec.
122* Updated `DOMTokenList` to have a `value` property per [recent spec changes](https://github.com/whatwg/dom/issues/119); its `toString` serialization also changed slightly.
123* 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.
124* 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.
125* Fixed `EventTarget.prototype.constructor` to be correct; it was previously `Window`.
126* Fixed `option.index` for `<option>`s not inside a `<select>` to no longer error.
127* Fixed `tc.cellIndex` for `<td>`s and `<th>`s not inside a `<tr>` to no longer error.
128* Fixed `tr.sectionRowIndex` for `<tr>`s not inside a `<table>`, `<tbody>`, `<thead>`, or `<tfoot>` to no longer error.
129* Removed the `"keyevents"` alias for `"keyboardevent"` when using `document.createEvent`, [per recent spec changes](https://github.com/whatwg/dom/issues/148).
130
131## 8.0.4
132
133* Fixed the `this` value when you pass a `{ handleEvent() { ... } }` object to `addEventListener`. (thetalecrafter)
134
135## 8.0.3
136
137* Fixed `HTMLOptionElement.prototype.label`; a typo was causing it to not work at all. (karlhorky)
138* 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.
139
140## 8.0.2
141
142* Fixed an issue where custom user agents would not propagate to `navigator.userAgent` in frames and iframes.
143* 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.
144
145## 8.0.1
146
147* 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!)
148
149## 8.0.0
150
151This 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.
152
153Although 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!
154
155* 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.
156* Added `Element.prototype.insertAdjacentHTML`. (kasperisager)
157* Added `Node.prototype.adoptNode`, and adopt nodes during insertion instead of throwing `"WrongDocumentError"`s. (dmethvin)
158* Added a stub `Element.prototype.getClientRects` to match our stub `getBoundingClientRect`.
159* Fixed `setTimeout` and `setInterval` to return numeric IDs, instead of objects. (alvarorahul)
160* Fixed `setTimeout` and `setInterval` to accept string arguments to eval, and to pass along extra arguments after the first two.
161* Fixed certain style shorthand properties not updating their component properties or parsing correctly. (dpvc)
162* Fixed `Event` object creation to always initialize the event objects, unless using `document.createEvent`, even for events with name `""`.
163* Fixed iframes to go through the custom resource loader. (chrmarti)
164* 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.
165* Removed other minor unimplemented, stub, or no-longer-standard APIs from "DOM Level 3", like the user-data API, `DOMException`, `DOMConfiguration`, and `DOMStringList`.
166
167## 7.2.2
168
169* Fixed `canvasEl.toDataURL()`, with the `canvas` npm package installed; a recent update to the `canvas` package broke how we were passing arguments to do.
170* Fixed `data:` URL parsing to allow empty contents, e.g. `data:text/css;base64,`. (sebmck)
171
172## 7.2.1
173
174* 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">`).
175
176## 7.2.0
177
178* Added support for text selection APIs on `<input>` and `<textarea>`! (sjelin and yaycmyk)
179* 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).
180* 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.)
181* Fixed an issue where `HTMLCollection`s would get confused when they contained elements with numeric `id`s or `name`s.
182* Fixed an issue with doctype parsing confusing the system ID and public ID.
183* Made the task posted by `postMessage` use the inside-jsdom timer queue, instead of the Node.js one. This allows easier mocking. (cpojer)
184
185## 7.1.1
186
187* 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.)
188* Fixed `document.writeln` to correctly handle multiple arguments; previously it ignored all after the first.
189* Fixed `FileList` objects to no longer have a property named `"undefined"`. (jfremy)
190
191## 7.1.0
192
193This is a rather large release bringing with it several important re-implementations of DOM and HTML APIs.
194
195* Our `EventTarget` implementation has been rewritten from scratch to follow the spec exactly. This should improve any edge case misbehaviors.
196* Our `Event` class hierarchy has been rewritten and fleshed out, fixing many gaps in functionality.
197 - Previously missing classes `KeyboardEvent` and `TouchEvent` are now implemented.
198 - Almost all supported `Event` subclasses now have constructors. (`TouchEvent` does not yet, and `MutationEvent` is specified to not have one.)
199 - 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.
200 - `document.createEvent("customevent", ...)` now correctly creates a `CustomEvent` instead of an `Event`, and `CustomEvent.prototype.initProgressEvent` has been replaced with `CustomEvent.prototype.initCustomEvent`.
201* 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.
202* 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.
203* `querySelector`, `querySelectorAll`, and `matches` now correctly throw `"SyntaxError"` `DOMException`s for invalid selectors, instead of just `Error` instances.
204* `Node.prototype`'s `insertBefore`, `replaceChild`, and `appendChild` methods now check their arguments more correctly.
205* 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.
206
207## 7.0.2
208
209* Fixed an issue where inside jsdom `<script>` code, `/regexpliteral/ instanceof RegExp` would be `false`.
210
211## 7.0.1
212
213* Fixed two bugs with `Node.prototype.isEqualNode`:
214 - It would previously always return `true` for comparing any two doctypes.
215 - It would throw an error when trying to compare two elements that had attributes.
216* Enforced that `document.implementation.createDocumentType` requires all three of its arguments.
217
218## 7.0.0
219
220This 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.
221
222* **Node.js 4.0 onward is now required**, as we have begun using ES2015 features only present there.
223* Completely re-implemented `XMLHttpRequest` and related classes (nicolashenry):
224 - Includes support for `Blob`, `File`, `FileList`, `FileReader`, `FormData`, `ProgressEvent`, and the supporting `XMLHttpRequestUpload`, and `XMLHttpRequestEventTarget` interfaces.
225 - Includes support for synchronous XHRs.
226 - 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.
227 - These implementations are extremely complete and standards-compliant, passing 136 newly-introduced web platform tests.
228* Added `document.charset`, an alias for `document.characterSet`.
229* Added `HTMLTemplateElement.prototype.content`, for getting the contents of a `<template>` element as a document fragment. (rickychien)
230* Implemented "loose" cookie parsing, giving correct execution of code like `document.cookie = "foo"`.
231* 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)
232* Fixed `document.styleSheets` to correctly track the removal of stylesheets from the document. (AVGP)
233* Fixed the `created` jsdom lifecycle callback receiving a different `window` object than the `loaded` or `done` callbacks when scripting was enabled.
234* **Invalid URLs are no longer allowed when creating a jsdom document**; the URL must be parseable, or an error will be thrown.
235* **The `{ omitJsdomErrors }` option of the virtual console has moved**; it is no longer provided when creating the virtual console, but instead when calling `sendTo`.
236
237## 6.5.1
238
239* 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.)
240
241## 6.5.0
242
243* Added `NodeList.prototype[Symbol.iterator]`, so you can now use `for`-`of` loops with `NodeList`s.
244
245## 6.4.0
246
247* Added `jsdom.nodeLocation(node)` to get the location within the source text of a given node.
248* Added `jsdom.reconfigureWindow(window, { top })` to allow changing the value of a window's `top` property.
249* Added the `element` argument to the custom resource loader, so you can customize resource loads depending on which element loaded them.
250* 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.
251* Updated `NodeList` and `HTMLCollection` to match the spec. The most noticable change is that `HTMLCollection` no longer inherits from `NodeList`.
252
253## 6.3.0
254
255* Added a fully spec-compliant implementation of `window.atob` and `window.btoa`. (jeffcarp)
256* Fixed many issues with our `<canvas>` implementation:
257 - With the `canvas` npm package installed, `<canvas>` elements are now properly `instanceof HTMLCanvasElement` and `instanceof HTMLElement`.
258 - `<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.
259 - The `width` and `height` properties now correctly reflect the `width` and `height` attributes, and have the appropriate default values of `300` and `150`.
260 - 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.
261* 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:
262 - Complete implementations were added for `HTMLDataElement`, `HTMLSpanElement`, and `HTMLTimeElement`.
263 - Stubs were added for `HTMLDataListElement`, `HTMLDialogElement`, `HTMLEmbedElement`, `HTMLMeterElement`, `HTMLOutputElement`, `HTMLProgressElement`, `HTMLSourceElement`, `HTMLTemplateElement`, and `HTMLTrackElement`.
264 - `HTMLAudioElement` was implemented in full, although its `HTMLMediaElement` base, where most of its functionality is, is still largely a stub.
265 - `HTMLTableSectionElement`, `HTMLTableRowElement`, `HTMLTableCellElement`, `HTMLTableDataCellElement`, and `HTMLTableHeaderCellElement` were updated to the latest spec.
266 - `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.
267 - Appropriate constants were added to `HTMLMediaElement`.
268* Updated everything having to do with base URLs to be per-spec:
269 - Added `Node.prototype.baseURI` property to get the node's owner document's base URL.
270 - `HTMLBaseElement`'s `href` getter now contains appropriate fallbacks and always returns an absolute URL, per spec.
271 - 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.
272* 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`.
273 - So for example, providing `url: "http://example.com"` will mean `document.URL` returns `"http://example.com/"`, with a trailing slash.
274 - In a future major release, we will start throwing if strings that cannot be parsed as valid absolute URL are provided for this option.
275
276## 6.2.0
277
278* Added a full-featured, spec-compliant `Element.prototype.classList`, closing out a three-year old issue! (wacii)
279* 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 })`.
280* Fixed errors when trying to parse invalid doctype declarations, like `<!DOCTYPE>`.
281* Fixed spurious `"jsdomError"`s that were emitted after calling `window.close()`.
282* 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)
283
284## 6.1.0
285
286* Added basic implementations of `HTMLMediaElement` and `HTMLVideoElement`, back-ported from Facebook's Jest project. (cpojer)
287
288## 6.0.1
289
290* Fixed `XMLHttpRequest.prototype.getAllResponseHeaders` to not crash when used with `file:` URLs. (justinmchase)
291* Fixed `XMLHttpRequest.prototype.response` to correctly return the response text even when `responseType` was unset. (justinmchase)
292
293## 6.0.0
294
295This 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.
296
297This 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!
298
299* **io.js 2.0 onward is now required**, as we have begun using ES2015 features only present there.
300* Improved performance dramatically, by ~10000x in some cases, due to the following changes:
301 - 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).
302 - 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).
303 - 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.
304* Overhauled how error handling works in jsdom:
305 - `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.
306 - 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.
307 - 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:
308 + **The `load(errors, window)` callback was changed to `onload(window)`**, to reflect that it is now just sugar for setting a `window.onload` handler.
309 + **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.
310 - Nodes no longer have a nonstandard `errors` array, or a `raise` method used to put things in that array.
311* URL parsing and resolution was entirely overhauled to follow [the URL standard](http://url.spec.whatwg.org/)!
312 - 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.
313 - The new [`URL` class](https://url.spec.whatwg.org/#url) has been added to `window`
314 - 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).
315 - **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.**
316* Added the `XMLHttpRequest.prototype.response` getter.
317* Fixed `StyleSheetList.prototype.item` to actually work. (chad3814)
318* 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.
319* Fixed the `"hashchange"` event to correctly fire `HashChangeEvent` instances, with correct properties `newURL` and `oldURL` (instead of the incorrect `newUrl` and `oldUrl` used previously).
320* Removed usage of the setimmediate library, as it required `eval` and thus did not work in CSP scenarios.
321
322Finally, 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.
323
324## 5.6.1
325
326* Fixed an accidentally-created global `attribute` variable if you ever called `createAttributeNS`.
327* Dependency upgrades fixed a couple of bugs, although you would have gotten these anyway with a clean jsdom 5.6.0 install:
328 - Parsing of CSS properties that use `url("quoted string")` now works correctly, as of `cssstyle` 0.2.29.
329 - Selectors for the empty string, like `div[title=""]`, now work correctly, as of `nwmatcher` 1.3.6.
330
331## 5.6.0
332
333* `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)
334
335## 5.5.0
336
337* 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)
338* Rewrote cloning code (underlying `cloneNode` and `importNode`), fixing a number of issues:
339 - 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))
340 - Doctypes can now be cloned, per the latest spec.
341 - Attrs cannot be cloned, per the latest spec (although they still have a `cloneNode` method for now due to legacy).
342 - Document clones now correctly copy over the URL and content-type.
343* Fixed any virtual console output from iframes to be proxied to the parent window's virtual console. (jeffcarp)
344* Fixed the `type` property of `<button>` elements to correctly default to `submit`, and to stay within the allowed range.
345* Fixed clicking on submit `<button>`s to submit their containing form; previously only `<input type="submit">` worked. (rxgx)
346* Fixed `document.open()` to return `this`, per spec. (ryanseddon)
347
348Additionally, 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!
349
350## 5.4.3
351
352* 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)
353
354## 5.4.2
355
356* Fixed license metadata to conform to latest npm standards.
357
358## 5.4.1
359
360* Fixed to work with browserify again (regression introduced in 5.4.0).
361
362## 5.4.0
363
364This 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:
365
366* Added support for the default HTML stylesheet when using `window.getComputedStyle`! (akhaku)
367 - Notably, this makes jQuery's `show()` and `hide()` methods now work correctly; see [#994](https://github.com/tmpvar/jsdom/issues/994).
368* 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)
369 - 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.
370 - Previously, we only supported this for `<iframe>`s, and our implementation was quite buggy: e.g., `<iframe name="addEventListener">` would override `window.addEventListener`.
371 - 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.
372
373We also have a bunch more fixes and additions:
374
375* 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)
376* Updated `StyleSheetList` to inherit from `Array`, as per the latest CSSOM spec.
377* Overhauled the handling of attributes throughout the DOM, to follow the spec more exactly.
378 - 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.
379 - Some weirdnesses around the `style` attribute were fixed along the way; see e.g. [#1109](https://github.com/tmpvar/jsdom/issues/1109).
380 - However, `Attr` objects themselves are not yet spec-compliant (e.g., they still inherit from `Node`). That's coming soon.
381* Fixed an unfortunate bug where `getElementById` would fail to work correctly on `<img>` elements whose `id` attributes were modified. (Joris-van-der-Wel)
382* Fixed the `virtualConsole` option to work with `jsdom.env`, not just `jsdom.jsdom`. (jeffcarp)
383* Removed a few functions that were erroneously added to `window`: `mapper`, `mapDOMNodes`, and `visitTree`. (Joris-van-der-Wel)
384
385## 5.3.0
386
387* 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)
388
389## 5.2.0
390
391* Implemented much of the [`ParentNode`](https://dom.spec.whatwg.org/#interface-parentnode) mixin (Joris-van-der-Wel):
392 - Moved `children` from `Node` to `ParentNode`, i.e., made it available on `Document`, `DocumentFragment`, and `Element`, but not other types of nodes.
393 - Made `children` a `HTMLCollection` instead of a `NodeList`.
394 - Implemented `firstElementChild`, `lastElementChild`, and `childElementCount`.
395* Implemented the `outerHTML` setter. (Joris-van-der-Wel)
396* Fixed the `outerHTML` getter for `<select>` and `<form>`. (Joris-van-der-Wel)
397* 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)
398* Fixed relative stylesheet resolution when using `@import`. (dbo)
399
400## 5.1.0
401
402* Added support for the `NodeIterator` class from the DOM Standard. (Joris-van-der-Wel)
403* 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)
404* Updated tough-cookie to 0.13.0, bringing along many spec compliance fixes. (inikulin)
405* Added a fast failure in Node.js™ with a clear error message, so that people don't get confused by syntax errors.
406
407## 5.0.1
408
409* 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.)
410* 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.
411* Fixed the `innerHTML` setter to no longer ignore `undefined`; instead it correctly sets the innerHTML to `"undefined"`.
412* Fixed `document.write` to throw for XML documents as per the spec.
413* Fixed `document.write` to accept more than one argument (they get concatenated).
414* Fixed `document.write("")` to no longer try to write `"<html><head></head><body></body></html>"`.
415
416## 5.0.0
417
418This 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.
419
420You 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:
421
422* Removed `options.jar` and `options.document.cookieDomain` from the configuration for creating jsdom documents.
423* 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.
424* 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`.
425
426In addition to these changes to the public API, the following new cookie-related features came along for the ride:
427
428* Implemented automatic cookie-jar sharing with descendant `<iframe>`s. (So, if the iframe is same-domain, it can automatically access the appropriate cookies.)
429* Let `options.document.cookie` accept arrays, instead of just strings, for if you want to set multiple cookies at once.
430
431Finally, 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.
432
433## 4.5.1
434
435* Removed unnecessary browserify dependency that was erroneously included in 4.5.0.
436
437## 4.5.0
438
439* Added `document.currentScript`. (jeffcarp)
440
441## 4.4.0
442
443* 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)
444
445## 4.3.0
446
447* Made the click behavior for radio buttons and checkboxes work when doing `el.dispatchEvent(clickEvent)`, not just when doing `el.click()`. (brandon-bethke-neudesic)
448* Added `defaultPrevented` property to `Event` instances, reflecting whether `ev.preventDefault()` has been called. (brandon-bethke-neudesic)
449* Moved the `click()` method from `HTMLInputElement.prototype` to `HTMLElement.prototype`, per the latest spec.
450* Made the `click()` method trigger a `MouseEvent` instead of just an `Event`.
451
452## 4.2.0
453
454* Added a second parameter to `UIEvent`, `MouseEvent`, and `MutationEvent`, which for now just behaves the same as that for `Event`. (Rich-Harris)
455
456## 4.1.0
457
458* Added a second parameter to the `Event` constructor, which allows you to set the `bubbles` and `cancelable` properties. (brandon-bethke-neudesic)
459
460## 4.0.5
461
462* Added `HTMLUnknownElement` and fix the parser/`document.createElement` to create those instead of `HTMLElement` for unknown elements.
463* 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.
464
465_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.
466
467## 4.0.4
468
469* Fixed parsing of doctypes by relying on the information provided by the html parser if possible.
470
471## 4.0.3
472
473* Fixed events fired from `EventTarget`s to execute their handlers in FIFO order, as per the spec.
474* Fixed a case where `childNodes` would not be correctly up to date in some cases. (medikoo)
475* Sped up window creation with `jsdom.env` by ~600%, for the special case when no scripts are to be executed.
476
477## 4.0.2
478
479* `EventTarget` is now correctly in the prototype chain of `Window`.
480* `EventTarget` argument validation is now correct according to the DOM Standard.
481* `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.
482* `new Event("click")` can now be dispatched. (lovebear)
483* `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)
484* 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.
485
486## 4.0.1
487
488* Fixed: `Node.prototype.contains` to always return a boolean. This was a regression in 3.1.1. (Joris-van-der-Wel)
489* Fixed: `Document.prototype` no longer contains its own `ownerDocument` getter, instead correctly delegating to `Node.prototype`.
490* Fixed: some edge cases regarding running `<script>`s in browserified jsdom.
491* A couple fixes from updated dependencies (although you would have gotten these anyway with a fresh install, due to floating version specifiers):
492 - 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.
493 - parse5 minimum version bumped from 1.3.1 to 1.3.2 to, fixing the parsing of `<form>` elements inside `<template>` elements.
494
495## 4.0.0
496
497This 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!
498
499Note 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™.
500
501In the process of rewriting parts of jsdom to use `vm`, a number of related fixes were made regarding the `Window` object:
502
503* In some cases, state was implicitly shared between `Window` instances—especially parser- and serializer-related state. This is no longer the case, thankfully.
504* A number of properties of `Window` were updated for spec compliance: some data properties became accessors, and all methods moved from the prototype to the instance.
505* The non-standard `document.parentWindow` was removed, in favor of the standard `document.defaultView`. Our apologies for encouraging use of `parentWindow` in our README, tests, and examples.
506
507## 3.1.2
508
509* Some fixes to the `NOT_IMPLEMENTED` internal helper, which should eliminate the cases where calling e.g. `window.alert` crashes your application.
510* Fixed a global variable leak when triggering `NOT_IMPLEMENTED` methods, like `window.location.reload`.
511* Fixed the URL resolution algorithm to handle `about:blank` properly on all systems (previously it only worked on Windows). This is especially important since as of 3.0.0 the default URL is `about:blank`.
512* Fixed, at least partially, the ability to run `<script>`s inside a browserified jsdom instance. This is done by dynamically rewriting the source code so that global variable references become explicit references to `window.variableName`, so it is not foolproof.
513
514## 3.1.1
515
516* Updated `Node.prototype.isEqualNode` to the algorithm of the DOM Standard, fixing a bug where it would throw an error along the way.
517* Removed `Node.prototype.isSameNode`, which is not present in the DOM Standard (and was just a verbose `===` check anyway).
518* 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).
519
520## 3.1.0
521
522* Added support for [custom external resource loading](https://github.com/tmpvar/jsdom#custom-external-resource-loader). (tobie)
523
524## 3.0.3
525
526* Fixed some stray byte-order marks in a couple files, which incidentally [break Browserify](https://github.com/substack/node-browserify/issues/1095). (sterpe)
527
528## 3.0.2
529
530* Fixed another edge case where unchecking a radio button would incorrectly uncheck radio buttons outside the containing form. (zpao)
531
532## 3.0.1
533
534* Fixed errors when serializing text nodes (possibly only occurred when inside `<template>`).
535* Handle null bytes being passed to `jsdom.env`'s autodetecting capabilities. (fluffybunnies)
536* Handle empty HTML strings being passed to `jsdom.env`'s `html` option. (fluffybunnies)
537
538## 3.0.0
539
540This release updates large swathes of the DOM APIs to conform to the standard, mostly by removing old stuff. It also fixes a few bugs, introduces a couple new features, and changes some defaults.
541
5423.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!)
543
544* 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).
545* 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)
546* Added the named `new Image(width, height)` constructor. (vinothkr)
547* Fixed an exception when using `querySelector` with selectors like `div:last-child > span[title]`.
548* Removed all traces of entities, entity types, notations, default attributes, and CDATA sections.
549* Differentiated between XML and HTML documents better, for example in how they handle the casing of tag names and attributes.
550* Updated `DOMImplementation` to mostly work per-spec, including removing `addFeature` and `removeFeature` methods, the `ownerDocument` property, and making `hasFeature` always return `true`.
551* Re-did the `CharacterData` implementation to follow the algorithms in the DOM Standard; this notably removes a few exceptions that were previously thrown.
552* Re-did `Comment`, `Text`, and `ProcessingInstruction` to follow the DOM Standard and derive from `CharacterData`.
553* Re-did `DocumentType` to follow the DOM Standard and be much simpler, notably removing notations, entities, and default attributes.
554* Fixed a variety of accessors on `Node`, `Element`, `Attr`, and `Document`; some were removed that were nonstandard (especially setters); others were updated to reflect the spec; etc.
555* Re-did name/qname validation, which is done by various APIs, to work with the xml-name-validator package and some centralized algorithms.
556* Made the XML parser at least somewhat aware of processing instructions.
557* Cleaned up doctype parsing and association between doctypes and documents. More exotic doctypes should parse better now.
558* `document.contentType` now is generally inferred from the parsing mode of the document.
559* Moved some properties to `Document.prototype` and `Window.prototype` instead of setting them as own properties during the document/window creation. This should improve memory usage (as well as spec compliance).
560
561## 2.0.0
562
563This 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.
564
565* Removed: `jsdom.level`, and the `level` option from `jsdom.jsdom`.
566* Change: the nonstandard `Element.prototype.matchesSelector` method was replaced with the standard `Element.prototype.matches`. (KenPowers)
567* Fix: `querySelector` correctly coerces its argument to a string (1.2.2 previously fixed this for `querySelectorAll`).
568
569## 1.5.0
570
571* 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)
572* Tweak: make `childNodes`, and the many places in jsdom that use it, much faster. (Joris-van-der-Wel)
573
574## 1.4.1
575
576* Tweak: faster implementation of `NodeList.prototype.length`, which should speed up common operations like `appendChild` and similar. (Joris-van-der-Wel)
577
578## 1.4.0
579
580* Fix: `HTMLInputElement.prototype.checked` and `defaultChecked` now behave per the spec. (Joris-van-der-Wel)
581* Fix: `HTMLOptionElement.prototype.selected` now behaves per the spec. (Joris-van-der-Wel)
582* Fix: `HTMLInputElement.prototype.value` now behaves per the spec. (Joris-van-der-Wel)
583* Fix: `HTMLTextAreaElement.prototype.value` and `defaultValue` now behave per the spec. (Joris-van-der-Wel)
584* Add: `HTMLTextAreaElement.prototype.defaultValue` now has a setter, and `HTMLTextAreaElement.prototype.textLength` now exists. (Joris-van-der-Wel)
585* Fix: resetting a `<form>` now behaves per spec for all different types of form elements. (Joris-van-der-Wel)
586* Fix: radio buttons reset other radio buttons correctly now per the spec. (Joris-van-der-Wel)
587* Fix: `document.cloneNode` now works. (AVGP)
588* Fix: `hasAttribute` is now case-insensitive, as it should be. (AVGP)
589* Fix: `div.toString()` now returns `[object HTMLDivElement]`. (AVGP)
590
591## 1.3.2
592
593* Fix: check if `module.parent` exists before using it to construct a document's initial URL. Apparently some testing frameworks like Jest do not correctly emulate the module environment; this compensates. (SegFaultx64)
594
595## 1.3.1
596
597* Fix: changing attributes on `<option>` elements will now have the correct consequences. For example changing the `id` attribute now interacts correctly with `document.getElementById`. (Joris-van-der-Wel)
598
599## 1.3.0
600
601* Add: moved `focus` and `blur` methods to `HTMLElement.prototype`, instead of having them only be present on certain element prototypes. Our focus story is still not very spec-compliant, but this is a step in the right direction. (vincentsiao)
602
603## 1.2.3
604
605* Tweak: improve performance of `Node.prototype.insertBefore`, `Node.prototype.removeChild`, and several `AttributeList` methods. (Joris-van-der-Wel)
606
607## 1.2.2
608
609* Fix: `querySelectorAll` correctly coerces its argument to a string; notably this allows you to pass arrays. (jeffcarp)
610* Fix: the `data` setter on text nodes correctly coerces the new value to a string. (medikoo)
611* Fix: `document.toString()` now returns `[object HTMLDocument]`. (jeffcarp)
612
613## 1.2.1
614
615* Fix: handling of `<template>` element parsing and serialization, now that it is supported by parse5. (inikulin)
616
617## 1.2.0
618
619* Add: `NodeFilter`, in particular its constants. (fhemberger)
620* Fix: initial `history.length` should be `1`, not `0`. (rgrove)
621* Fix: `history.pushState` and `history.replaceState` should not fire the `popstate` event. (rgrove)
622
623## 1.1.0
624
625* Add: `document.implementation.createHTMLDocument()`. (fhemberger)
626* Fix: `localName` was sometimes `null` for elements when it should not be. (fhemberger)
627
628## 1.0.3
629
630* Update: no longer requiring separate `cssstyle` and `cssstyle-browserify` dependencies; now `cssstyle` can be used directly. This also un-pins the `cssstyle` dependency so that future fixes arrive as they appear upstream.
631
632## 1.0.2
633
634* Fix: temporarily pin `cssstyle` dependency to at most 0.2.18 until [chad3814/CSSStyleDeclaration#20](https://github.com/chad3814/CSSStyleDeclaration/issues/20) is fixed.
635* Fix: browserifying jsdom should work better now that the required packages are included as `dependencies` instead of `devDependencies`. (Sebmaster)
636* 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)
637
638## 1.0.1
639
640* Fix: the return value of `EventTarget.prototype.dispatchEvent` should be `true` when the default is *not* prevented; previously it was the opposite. (eventualbuddha)
641
642## 1.0.0
643
644For 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).
645
646* Remove: nonstandard `EventTarget.getListeners`; `EventTarget.forwardIterator`; `EventTarget.backwardIterator`; `EventTarget.singleIterator`.
647* Remove: nonstandard `document.innerHTML`. (jorendorff)
648* Fix: `value` and `defaultValue` properties of a `HTMLInputElement` are now correctly synced to the `value=""` attribute. (Sebmaster)
649
650## 1.0.0-pre.7
651
652* Remove: support for old, untested HTML and XML parsers, namely davglass/node-htmlparser and isaacs/sax-js. In the future we plan to work toward a standardized parsing interface that other parsers can implement, instead of adding custom code to jsdom for various parsers. This interface still is being decided though, as it needs to support complex things like pausing the parse stream (for `document.write`) and parsing disconnected fragments (for `document.innerHTML`). (Sebmaster)
653* Add: new `parsingMode` configuration, to allow you to manually specify XML or HTML. (Sebmaster)
654* Change: jsdom will no longer use the presence of `<?xml` or similar to attempt to auto-detect XHTML documents. Instead, it will by default treat them the same as browsers do, with the `<?xml` declaration just being a bogus comment. If you need your document interpreted as XHTML instead of HTML, use the `parsingMode` option. (Sebmaster)
655* Tweak: memoize various DOM-querying functions (e.g. `getElementsByTagName`, `querySelector`, etc.) to improve performance. (ccarpita)
656
657## 1.0.0-pre.6
658
659* Fix: another parsing issues with void elements and `innerHTML`, this time related to disconnected nodes. This was a regression between 0.11.1 and 1.0.0-pre.1. (paton)
660* Fix: same-named radio inputs should not be mutually exclusive unless they are in the same form. (stof)
661
662## 1.0.0-pre.5
663
664* Fix: sometimes calling `window.close()` would cause a segfault. (paton)
665
666## 1.0.0-pre.4
667
668* Fix: attributes and elements now have their `prefix`, `localName`, and `namespaceURI` properties set correctly in all cases. (Excepting `application/xhtml+xml` mode, which jsdom does not support yet.) (Sebmaster)
669
670## 1.0.0-pre.3
671
672* Fix: void elements no longer parsed correctly when using `innerHTML`. This was a regression between 0.11.1 and 1.0.0-pre.1. (Sebmaster)
673
674## 1.0.0-pre.2
675
676* Fix: parsing and serialization of attributes in the form `x:y`, e.g. `xmlns:xlink` or `xlink:href`. This was a regression between 0.11.1 and 1.0.0-pre.1. (Sebmaster)
677
678## 1.0.0-pre.1
679
680This 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.
681
682This 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.
683
684### Major changes
685
686* jsdom now can be browserified into a bundle that works in web workers! This is highly experimental, but also highly exciting! (lawnsea)
687* An overhaul of the [initialization lifecycle](https://github.com/tmpvar/jsdom#initialization-lifecycle), to bring more control and address common use cases. (Sebmaster)
688* 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)
689* 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).
690
691### Removed jsdom APIs
692
693* `jsdom.createWindow`: use `document.parentWindow` after creating a document
694* `jsdom.html`: use `jsdom.jsdom`
695* `jsdom.version`: use `require("jsdom/package.json").version`
696* `jsdom.level`: levels are deprecated and will probably be removed in 2.0.0
697* `jsdom.dom`
698* `jsdom.browserAugmentation`
699* `jsdom.windowAugmentation`
700
701### Changed jsdom APIs
702
703* `jsdom.jsdom` no longer takes a level as its second argument.
704* `jsdom.jQueryify` now requires a jQuery URL, since [always picking the latest was a bad idea](http://blog.jquery.com/2014/07/03/dont-use-jquery-latest-js/).
705
706### Removed non-standard DOM APIs
707
708* `document.createWindow`: use `document.parentWindow`
709* `document.innerHTML` and `document.outerHTML`: use the new `jsdom.serializeDocument` to include the DOCTYPE, or use `document.documentElement.outerHTML` to omit it.
710
711### Other fixes
712
713* Allow empty strings to be passed to `jsdom.env`. (michaelmior)
714* Fix for a memory leak in `EventTarget.prototype.dispatchEvent`. (Joris-van-der-Wel)
715* Make event listeners in the capture phase also fire on the event target. (Joris-van-der-Wel)
716* Correctly reset `eventPhase` and `currentTarget` on events, before and after a dispatch. (Joris-van-der-Wel)
717* Fix `document.cookie = null` to not throw, but instead just do nothing. (kapouer)
718
719## 0.11.1
720
721* Add: `Node.prototype.parentElement`. (lukasbuenger)
722* Fix: attributes that are reflected as properties should be `''` when not present, instead of `null`. (Note that `getAttribute` still returns `null` for them). (thejameskyle)
723* Fix: `textContent` now works for nodes that do not have children, like text nodes for example. (hayes)
724* Fix: `jsdom.jQueryify` was using the wrong URL for jQuery by default. (lukasbuenger)
725
726## 0.11.0
727
728* Add: new default level, `living`, reflecting our focus on the [DOM Living Standard](http://dom.spec.whatwg.org/) and the [HTML Living Standard](http://www.whatwg.org/specs/web-apps/current-work/multipage/), which are what browsers actually implement. This should open the door for more features of the modern DOM and HTML specs to be implemented in jsdom. (robotlovesyou)
729* Add: `Node.prototype.contains` now implemented. (robotlovesyou)
730* Add: `navigator.cookieEnabled` now implemented; it always returns `true`. (Sebmaster)
731* Change: DOCTYPEs no longer have their `name` property uppercased during parsing, and appear in the output of `document.innerHTML`.
732* Fix: `Node.prototype.compareDocumentPosition` implemented correctly; various document position constants added to the `Node` constructor. (robotlovesyou)
733* Fix: `DocumentType.prototype.parentNode` now returns the document node, not `null`. (robotlovesyou)
734* Fix: various `navigator` properties are now getters, not data properties. (Sebmaster)
735* Fix: a bug involving invalid script paths and `jsdom.jQueryify`. (Sebmaster)
736
737## 0.10.6
738
739* Add: remaining URL properties to `window.location` and `HTMLAnchorElement`.
740* Fix: the presence of `String.prototype.normalize`, which is available by default in Node 0.11.13 onwards, caused reflected attributes to break. (brock8503)
741* Fix: iframes now correctly load `about:blank` when the `src` attribute is empty or missing. (mcmathja)
742* Fix: documents containing only whitespace now correctly generate wrapper documents, just like blank documents do. (nikolas)
743* Tweak: lazy-load the request module, to improve overall jsdom loading time. (tantaman)
744
745## 0.10.5
746
747* Fix: the list of void elements has been updated to match the latest HTML spec.
748* Fix: when serializing void elements, don't include a ` /`: i.e. the result is now `<br>` instead of `<br />`.
749
750## 0.10.4
751
752* Fix: another case was found where jQuery 1.11's `show()` method would cause errors.
753* Add: `querySelector` and `querySelectorAll` methods to `DocumentFragment`s. (Joris-van-der-Wel)
754
755## 0.10.3
756
757* Fix: various defaults on `HTMLAnchorElement` and `window.location` should not be `null`; they should usually be the empty string.
758
759## 0.10.2
760
761* Fix: Using jQuery 1.11's `show()` method would cause an error to be thrown.
762* Fix: `window.location` properties were not updating correctly after using `pushState` or `replaceState`. (toomanydaves)
763
764## 0.10.1
765
766* Fix: `window.location.port` should default to `""`, not `null`. (bpeacock)
767
768## 0.10.0
769
770* Add: a more complete `document.cookie` implementation, that supports multiple cookies. Note that options like `path`, `max-age`, etc. are still ignored. (dai-shi)
771
772## 0.9.0
773
774* Add: implement attribute ordering semantics from WHATWG DOM spec, and in general overhaul attribute storage implementation to be much more awesome and accurate. (lddubeau)
775* Add: `port` and `protocol` to `HTMLAnchorElement`. (sporchia)
776* Fix: make `HTMLInputElement` not have a `type` *attribute* by default. It still has a default value for the `type` *property*, viz. `"text"`. (aredridel)
777* Fix: treat empty namespace URI as meaning "no namespace" with the `getAttributeNS`, `hasAttributeNS`, and `setAttributeNS` functions. (lddubeau)
778* Fix: reference typed arrays in a way that doesn't immediately break on Node 0.6. Node 0.6 isn't supported in general, though. (kangax)
779
780## 0.8.11
781
782* Add: store and use cookies between requests; customizable cookie jars also possible. (stockholmux)
783* Fix: attributes named the same as prototype properties of `NamedNodeMap` no longer break jsdom. (papandreou)
784* Fix: `removeAttributeNS` should not throw on missing attributes. (lddubeau)
785* Change: remove `__proto__`, `__defineGetter__`, and `__defineSetter__` usage, as part of a project to make jsdom work better across multiple environments. (lawnsea)
786
787## 0.8.10
788
789* Add: `hash` property to `HTMLAnchorElement`. (fr0z3nk0)
790
791## 0.8.9
792
793* Upgrade: `cssom` to 0.3.0, adding support for `@-moz-document` and fixing a few other issues.
794* Upgrade: `cssstyle` to 0.2.6, adding support for many shorthand properties and better unit handling.
795
796## 0.8.8
797
798* Fix: avoid repeated `NodeList.prototype.length` calculation, for a speed improvement. (peller)
799
800## 0.8.7
801
802* Add: `host` property to `HTMLAnchorElement`. (sporchia)
803
804## 0.8.6
805
806* Fix: stop accidentally modifying `Error.prototype`. (mitar)
807* Add: a dummy `getBoundingClientRect` method, that returns `0` for all properties of the rectangle, is now implemented. (F1LT3R)
808
809## 0.8.5
810
811* Add: `href` property on `CSSStyleSheet` instances for external CSS files. (FrozenCow)
812
813## 0.8.4
814
815 * Add: typed array constructors on the `window`. (nlacasse)
816 * Fix: `querySelector` and `querySelectorAll` should be on the prototypes of `Element` and `Document`, not own-properties. (mbostock)
817
818## 0.8.3
819
820 * Fix: when auto-detecting whether the first parameter to `jsdom.env` is a HTML string or a filename, deal with long strings correctly instead of erroring. (baryshev)
821
822## 0.8.2
823
824 * Add: basic `window.history` support, including `back`, `forward`, `go`, `pushState`, and `replaceState`. (ralphholzmann)
825 * Add: if an `<?xml?>` declaration starts the document, will try to parse as XML, e.g. not lowercasing the tags. (robdodson)
826 * Fix: tag names passed to `createElement` are coerced to strings before evaluating.
827
828## 0.8.1 (hotfix)
829
830 * Fix: a casing issue that prevented jsdom from loading on Unix and Solaris systems. (dai-shi)
831 * Fix: `window.location.replace` was broken. (dai-shi)
832 * Fix: update minimum htmlparser2 version, to ensure you get the latest parsing-related bugfixes.
833
834## 0.8.0
835
836 * Add: working `XMLHttpRequest` support, including cookie passing! (dai-shi)
837 * Add: there is now a `window.navigator.noUI` property that evaluates to true, if you want to specifically distinguish jsdom in your tests.
838
839## 0.7.0
840
841 * Change: the logic when passing `jsdom.env` a string is more accurate, and you can be explicit by using the `html`, `url`, or `file` properties. This is a breaking change in the behavior of `html`, which used to do the same auto-detection logic as the string-only version.
842 * Fix: errors raised in scripts are now passed to `jsdom.env`'s callback. (airportyh)
843 * Fix: set `window.location.href` correctly when using `jsdom.env` to construct a window from a URL, when that URL causes a redirect. (fegs)
844 * Add: a more complete and accurate `window.location` object, which includes firing `hashchange` events when the hash is changed. (dai-shi)
845 * Add: when using a non-implemented feature, mention exactly what it was that is not implemented in the error message. (papandreou)
846
847## 0.6.5
848
849 * Fix: custom attributes whose names were the same as properties of `Object.prototype`, e.g. `"constructor"`, would confuse jsdom massively.
850
851## 0.6.4
852
853 * Fix: CSS selectors which contain commas inside quotes are no longer misinterpreted. (chad3814)
854 * Add: `<img>` elements now fire `"load"` events when their `src` attributes are changed. (kapouer)
855
856## 0.6.3
857
858 * Fix: better automatic detection of URLs vs. HTML fragments when using `jsdom.env`. (jden)
859
860## 0.6.2
861
862 * Fix: URL resolution to be amazing and extremely browser-compatible, including the interplay between the document's original URL, any `<base>` tags that were set, and any relative `href`s. This impacts many parts of jsdom having to do with external resources or accurate `href` and `src` attributes. (deitch)
863 * Add: access to frames and iframes via named properties. (adrianlang)
864 * Fix: node-canvas integration, which had been broken since 0.5.7.
865
866## 0.6.1
867
868 * Make the code parseable with Esprima. (squarooticus)
869 * Use the correct `package.json` field `"repository"` instead of `"repositories"` to prevent npm warnings. (jonathanong)
870
871## 0.6.0
872
873Integrated a new HTML parser, [htmlparser2](https://npmjs.org/package/htmlparser2), from fb55. This is an actively maintained and much less buggy parser, fixing many of our parsing issues, including:
874
875 * Parsing elements with optional closing tags, like `<p>` or `<td>`.
876 * The `innerHTML` of `<script>` tags no longer cuts off the first character.
877 * Empty attributes now have `""` as their value instead of the attribute name.
878 * Multiline attributes no longer get horribly mangled.
879 * Attribute names can now be any value allowed by HTML5, including crazy things like `^`.
880 * Attribute values can now contain any value allowed by HTML5, including e.g. `>` and `<`.
881
882## 0.5.7
883
884 * Fix: make event handlers attached via `on<event>` more spec-compatible, supporting `return false` and passing the `event` argument. (adrianlang)
885 * Fix: make the getter for `textContent` more accurate, e.g. in cases involving comment nodes or processing instruction nodes. (adrianlang)
886 * Fix: make `<canvas>` behave like a `<div>` when the `node-canvas` package isn't available, instead of crashing. (stepheneb)
887
888## 0.5.6
889
890 * Fix: `on<event>` properties are correctly updated when using `setAttributeNode`, `attributeNode.value =`, `removeAttribute`, and `removeAttributeNode`; before it only worked with `setAttribute`. (adrianlang)
891 * Fix: `HTMLCollection`s now have named properties based on their members' `id` and `name` attributes, e.g. `form.elements.inputId` is now present. (adrianlang)
892
893## 0.5.5
894
895 * Fix: `readOnly` and `selected` properties were not correct when their attribute values were falsy, e.g. `<option selected="">`. (adrianlang)
896
897## 0.5.4
898
899This release, and all future releases, require at least Node.js 0.8.
900
901 * Add: parser can now be set via `jsdom.env` configuration. (xavi-)
902 * Fix: accessing `rowIndex` for table rows that are not part of a table would throw. (medikoo)
903 * Fix: several places in the code accidentally created global variables, or referenced nonexistant values. (xavi-)
904 * Fix: `<img>` elements' `src` properties now evaluate relative to `location.href`, just like `<a>` elements' `href` properties. (brianmaissy)
905
906## 0.5.3
907
908This release is compatible with Node.js 0.6, whereas all future releases will require at least Node.js 0.8.
909
910 * Fix: `getAttributeNS` now returns `null` for attributes that are not present, just like `getAttribute`. (mbostock)
911 * Change: `"request"` dependency pinned to version 2.14 for Node.js 0.6 compatibility.
912
913## 0.5.2
914
915 * Fix: stylesheets with `@-webkit-keyframes` rules were crashing calls to `getComputedStyle`.
916 * Fix: handling of `features` option to `jsdom.env`.
917 * Change: retain the value of the `style` attribute until the element's `style` property is touched. (papandreou)
918
919## 0.5.1
920
921 * Fix: `selectedIndex` now changes correctly in response to `<option>` elements being selected. This makes `<select>` elements actually work like you would want, especially with jQuery. (xcoderzach)
922 * Fix: `checked` works correctly on radio buttons, i.e. only one can be checked and clicking on one does not uncheck it. Previously they worked just like checkboxes. (xcoderzach)
923 * Fix: `click()` on `<input>` elements now fires a click event. (xcoderzach)
924
925## 0.5.0
926
927 * Fix: Make `contextify` a non-optional dependency. jsdom never worked without it, really, so this just caused confusion.
928
929## 0.4.2
930
931 * Fix: `selected` now returns true for the first `<option>` in a `<select>` if nothing is explicitly set.
932 * Fix: tweaks to accuracy and speed of the `querySelectorAll` implementation.
933
934## 0.4.1 (hotfix)
935
936 * Fix: crashes when loading HTML files with `<a>` tags with no `href` attribute. (eleith)
937
938## 0.4.0
939
940 * Fix: `getAttribute` now returns `null` for attributes that are not present, as per DOM4 (but in contradiction to DOM1 through DOM3).
941 * Fix: static `NodeList`-returning methods (such as `querySelectorAll`) now return a real `NodeList` instance.
942 * Change: `NodeList`s no longer expose nonstandard properties to the world, like `toArray`, without first prefixing them with an underscore.
943 * Change: `NodeList`s no longer inconsistently have array methods. Previously, live node lists would have `indexOf`, while static node lists would have them all. Now, they have no array methods at all, as is correct per the specification.
944
945## 0.3.4
946
947 * Fix: stylesheets with `@media` rules were crashing calls to `getComputedStyle`, e.g. those in jQuery's initialization.
948
949## 0.3.3
950
951 * Fix: make `document.write` calls insert new elements correctly. (johanoverip, kblomquist).
952 * Fix: `<input>` tags with no `type` attribute now return a default value of `"text"` when calling `inputEl.getAttribute("type")`.
953
954## 0.3.2
955
956 * Fix: stylesheets with "joining" rules (i.e. those containing comma-separated selectors) now apply when using `getComputedStyle`. (chad3814, godmar)
957 * Add: support for running the tests using @aredridel's [html5](https://npmjs.org/package/html5) parser, as a prelude toward maybe eventually making this the default and fixing various parsing bugs.
958
959## 0.3.1 (hotfix)
960
961 * Fix: crashes when invalid selectors were present in stylesheets.
962
963## 0.3.0
964
965 * Fix: a real `querySelector` implementation, courtesy of the nwmatcher project, solves many outstanding `querySelector` bugs.
966 * Add: `matchesSelector`, again via nwmatcher.
967 * Add: support for styles coming from `<style>` and `<link rel="stylesheet">` elements being applied to the results of `window.getComputedStyle`. (chad3814)
968 * Add: basic implementation of `focus()` and `blur()` methods on appropriate elements. More work remains.
969 * Fix: script filenames containing spaces will now work when passed to `jsdom.env`. (TomNomNom)
970 * Fix: elements with IDs `toString`, `hasOwnProperty`, etc. could cause lots of problems.
971 * Change: A window's `load` event always fires asynchronously now, even if no external resources are necessary.
972 * Change: turning off mutation events is not supported, since doing so breaks external-resource fetching.
973
974## 0.2.19
975
976 * Fix: URL resolution was broken on pages that included `href`-less `<base>` tags.
977 * Fix: avoid putting `attr` in the global scope when using node-canvas. (starsquare)
978 * Add: New `SkipExternalResources` feature accepts a regular expression. (fgalassi)
979
980## 0.2.18
981
982 * Un-revert: cssstyle has fixed its memory problems, so we get back accurate `cssText` and `style` properties again.
983
984## 0.2.17 (hotfix)
985
986 * Revert: had to revert the use of the cssstyle package. `cssText` and `style` properties are no longer as accurate.
987 * Fix: cssstyle was causing out-of-memory errors on some larger real-world pages, e.g. reddit.com.
988
989## 0.2.16
990 * Update: Sizzle version updated to circa September 2012.
991 * Fix: when setting a text node's value to a falsy value, convert it to a string instead of coercing it to `""`.
992 * Fix: Use the cssstyle package for `CSSStyleDeclaration`, giving much more accurate `cssText` and `style` properties on all elements. (chad3814)
993 * Fix: the `checked` property on checkboxes and radiobuttons now reflects the attribute correctly.
994 * Fix: `HTMLOptionElement`'s `text` property should return the option's text, not its value.
995 * Fix: make the `name` property only exist on certain specific tags, and accurately reflect the corresponding `name` attribute.
996 * Fix: don't format `outerHTML` (especially important for `<pre>` elements).
997 * Fix: remove the `value` property from `Text` instances (e.g. text nodes).
998 * Fix: don't break in the presence of a `String.prototype.normalize` method, like that of sugar.js.
999 * Fix: include level3/xpath correctly.
1000 * Fix: many more tests passing, especially related to file:/// URLs on Windows. Tests can now be run with `npm test`.
1001
1002## 0.2.15
1003 * Fix: make sure that doctypes don't get set as the documentElement (Aria Stewart)
1004 * Add: HTTP proxy support for jsdom.env (Eugene Ware)
1005 * Add: .hostname and .pathname properties to Anchor elements to comply with WHATWG standard (Avi Deitcher)
1006 * Fix: Only decode HTML entities in text when not inside a `<script>` or `<style>` tag. (Andreas Lind Petersen)
1007 * Fix: HTMLSelectElement single selection implemented its type incorrectly as 'select' instead of 'select-one' (John Roberts)
1008
1009## 0.2.14
1010 * Fix: when serializing single tags use ' />' instead of '/>' (kapouer)
1011 * Fix: support for contextify simulation using vm.runInContext (trodrigues)
1012 * Fix: allow jsdom.env's config.html to handle file paths which contain spaces (shinuza)
1013 * Fix: Isolate QuerySelector from prototype (Nao Iizuka)
1014 * Add: setting textContent to '' or clears children (Jason Davies)
1015 * Fix: jsdom.env swallows exceptions that occur in the callback (Xavi)
1016
1017## 0.2.13
1018 * Fix: remove unused style property which was causing explosions in 0.2.12 and node 0.4.7
1019
1020## 0.2.12
1021 * Fix: do not include gmon.out/v8.log/tests in npm distribution
1022
1023## 0.2.11
1024 * Add: allow non-unique element ids (Avi Deitcher)
1025 * Fix: make contexify an optional dependency (Isaac Schlueter)
1026 * Add: scripts injected by jsdom are now marked with a 'jsdom' class for serialization's sake (Peter Lyons)
1027 * Fix: definition for ldquo entity (Andrew Morton)
1028 * Fix: access NamedNodeMap items via property (Brian McDaniel)
1029 * Add: upgrade sizzle from 1.0 to [fe2f6181](https://github.com/jquery/sizzle/commit/fe2f618106bb76857b229113d6d11653707d0b22) which is roughly 1.5.1
1030 * Add: documentation now includes `jsdom.level(x, 'feature')`
1031 * Fix: make `toArray` and `item` on `NodeList` objects non-enumerable properties
1032 * Add: a reference to `window.close` in the readme
1033 * Fix: Major performance boost (Felix Gnass)
1034 * Fix: Using querySelector `:not()` throws a `ReferenceError` (Felix Gnass)
1035
1036## 0.2.10
1037 * Fix: problems with lax dependency versions
1038 * Fix: CSSOM constructors are hung off of the dom (Brian McDaniel)
1039 * Fix: move away from deprecated 'sys' module
1040 * Fix: attribute event handlers on bubbling path aren't called (Brian McDaniel)
1041 * Fix: setting textarea.value to markup should not be parsed (Andreas Lind Petersen)
1042 * Fix: content of script tags should not be escaped (Ken Sternberg)
1043 * Fix: DocumentFeatures for iframes with no src attribute. (Brian McDaniel) Closes #355
1044 * Fix: 'trigger' to 'raise' to be a bit more descriptive
1045 * Fix: When `ProcessExternalResources['script']` is disabled, do _not_ run inline event handlers. #355
1046 * Add: verbose flag to test runner (to show tests as they are running and finishing)
1047
1048## 0.2.9
1049 * Fix: ensure features are properly reset after a jsdom.env invocation. Closes #239
1050 * Fix: ReferenceError in the scanForImportRules helper function
1051 * Fix: bug in appendHtmlToElement with HTML5 parser (Brian McDaniel)
1052 * Add: jsonp support (lheiskan)
1053 * Fix: for setting script element's text property (Brian McDaniel)
1054 * Fix: for jsdom.env src bug
1055 * Add: test for jsdom.env src bug (multiple done calls)
1056 * Fix: NodeList properties should enumerate like arrays (Felix Gnass)
1057 * Fix: when downloading a file, include the url.search in file path
1058 * Add: test for making a jsonp request with jquery from jsdom window
1059 * Add: test case for issue #338
1060 * Fix: double load behavior when mixing jsdom.env's `scripts` and `src` properties (cjroebuck)
1061
1062## 0.2.8 (hotfix)
1063 * Fix: inline event handlers are ignored by everything except for the javascript context
1064
1065## 0.2.7 (hotfix)
1066 * Fix stylesheet loading
1067
1068## 0.2.6
1069 * Add: support for window.location.search and document.cookie (Derek Lindahl)
1070 * Add: jsdom.env now has a document configuation option which allows users to change the referer of the document (Derek Lindahl)
1071 * Fix: allow users to use different jsdom levels in the same process (sinegar)
1072 * Fix: removeAttributeNS no longer has a return value (Jason Davies)
1073 * Add: support for encoding/decoding all html entities from html4/5 (papandreou)
1074 * Add: jsdom.env() accepts the same features object seen in jsdom.jsdom and friends
1075
1076## 0.2.5
1077 * Fix: serialize special characters in Element.innerHTML/Element.attributes like a grade A browser (Jason Priestley)
1078 * Fix: ensure Element.getElementById only returns elements that are attached to the document
1079 * Fix: ensure an Element's id is updated when changing the nodeValue of the 'id' attribute (Felix Gnass)
1080 * Add: stacktrace to error reporter (Josh Marshall)
1081 * Fix: events now bubble up to the window (Jason Davies)
1082 * Add: initial window.location.hash support (Josh Marshall)
1083 * Add: Node#insertBefore should do nothing when both params are the same node (Jason Davies)
1084 * Add: fixes for DOMAttrModified mutation events (Felix Gnass)
1085
1086## 0.2.4
1087 * Fix: adding script to invalid/incomplete dom (document.documentElement) now catches the error and passes it in the `.env` callback (Gregory Tomlinson)
1088 * Cleanup: trigger and html tests
1089 * Add: support for inline event handlers (ie: `<div onclick='some.horrible.string()'>`) (Brian McDaniel)
1090 * Fix: script loading over https (Brian McDaniel) #280
1091 * Add: using style.setProperty updates the style attribute (Jimmy Mabey).
1092 * Add: invalid markup is reported as an error and attached to the associated element and document
1093 * Fix: crash when setChild() failes to create new DOM element (John Hurliman)
1094 * Added test for issue #287.
1095 * Added support for inline event handlers.
1096 * Moved frame tests to test/window/frame.js and cleaned up formatting.
1097 * Moved script execution tests to test/window/script.js.
1098 * Fix a crash when setChild() fails to create a new DOM element
1099 * Override CSSOM to update style attribute
1100
1101## 0.2.3
1102 * Fix: segfault due to window being garbage collected prematurely
1103 NOTE: you must manually close the window to free memory (window.close())
1104
1105## 0.2.2
1106 * Switch to Contextify to manage the window's script execution.
1107 * Fix: allow nodelists to have a length of 0 and toArray to return an empty array
1108 * Fix: style serialization; issues #230 and #259
1109 * Fix: Incomplete DOCTYPE causes JavaScript error
1110 * Fix: indentation, removed outdated debug code and trailing whitespace.
1111 * Prevent JavaScript error when parsing incomplete `<!DOCTYPE>`. Closes #259.
1112 * Adding a test from brianmcd that ensures that setTimeout callbacks execute in the context of the window
1113 * Fixes issue 250: make `document.parentWindow === window` work
1114 * Added test to ensure that timer callbacks execute in the window context.
1115 * Fixes 2 issues in ResourceQueue
1116 * Make frame/iframe load/process scripts if the parent has the features enabled
1117
1118## 0.2.1
1119 * Javascript execution fixes [#248, #163, #179]
1120 * XPath (Yonathan and Daniel Cassidy)
1121 * Start of cssom integration (Yonathan)
1122 * Conversion of tests to nodeunit! (Martin Davis)
1123 * Added sizzle tests, only failing 3/15
1124 * Set the title node's textContent rather than its innerHTML #242. (Andreas Lind Petersen)
1125 * The textContent getter now walks the DOM and extract the text properly. (Andreas Lind Petersen)
1126 * Empty scripts won't cause jsdom.env to hang #172 (Karuna Sagar)
1127 * Every document has either a body or a frameset #82. (Karuna Sagar)
1128 * Added the ability to grab a level by string + feature. ie: jsdom.level(2, 'html') (Aria Stewart)
1129 * Cleaned up htmlencoding and fixed character (de)entification #147, #177 (Andreas Lind Petersen)
1130 * htmlencoding.HTMLDecode: Fixed decoding of `&lt;`, `&gt;`, `&amp;`, and `&apos;`. Closes #147 and #177.
1131 * Require dom level as a string or object. (Aria Stewart)
1132 * JS errors ar triggered on the script element, not document. (Yonathan)
1133 * Added configuration property 'headers' for HTTP request headers. (antonj)
1134 * Attr.specified is readonly - Karuna Sagar
1135 * Removed return value from setAttributeNS() #207 (Karuna Sagar)
1136 * Pass the correct script filename to runInContext. (robin)
1137 * Add http referrer support for the download() function. (Robin)
1138 * First attempt at fixing the horrible memory leak via window.stopTimers() (d-ash)
1139 * Use vm instead of evals binding (d-ash)
1140 * Add a way to set the encoding of the jsdom.env html request.
1141 * Fixed various typos/lint problems (d-ash)
1142 * The first parameter download is now the object returned by URL.parse(). (Robin)
1143 * Fixed serialization of elements with a style attribute.
1144 * Added src config option to jsdom.env() (Jerry Sievert)
1145 * Removed dead code from getNamedItemNS() (Karuna Sagar)
1146 * Changes to language/javascript so jsdom would work on v0.5.0-pre (Gord Tanner)
1147 * Correct spelling of "Hierarchy request error" (Daniel Cassidy)
1148 * Node and Exception type constants are available in all levels. (Daniel Cassidy)
1149 * Use \n instead of \r\n during serialization
1150 * Fixed auto-insertion of body/html tags (Adrian Makowski)
1151 * Adopt unowned nodes when added to the tree. (Aria Stewart)
1152 * Fix the selected and defaultSelected fields of `option` element. - Yonathan
1153 * Fix: EventTarget.getListeners() now returns a shallow copy so that listeners can be safely removed while an event is being dispatched. (Felix Gnass)
1154 * Added removeEventListener() to DOMWindow (Felix Gnass)
1155 * Added the ability to pre-load scripts for jsdom.env() (Jerry Sievert)
1156 * Mutation event tests/fixes (Felix Gnass)
1157 * Changed HTML serialization code to (optionally) pretty print while traversing the tree instead of doing a regexp-based postprocessing. (Andreas Lind Petersen)
1158 * Relative and absolute urls now work as expected
1159 * setNamedItem no longer sets Node.parentNode #153 (Karuna Sagar)
1160 * Added missing semicolon after entity name - Felix Gnass
1161 * Added NodeList#indexOf implementation/tests (Karuna Sagar)
1162 * resourceLoader.download now works correctly with https and redirects (waslogic)
1163 * Scheme-less URLs default to the current protocol #87 (Alexander Flatter)
1164 * Simplification the prevSibling(), appendChild(), insertBefore() and replaceChild() code (Karuna Sagar)
1165 * Javascript errors use core.Node.trigger (Alexander Flatter)
1166 * Add core.Document.trigger in level1/core and level2/events; Make DOMWindow.console use it (Alexander Flatter)
1167 * Resource resolver fixes (Alexander Flatter)
1168 * Fix serialization of doctypes with new lines #148 (Karuna Sagar)
1169 * Child nodes are calculated immediately instead of after .length is called #169, #171, #176 (Karuna Sagar)