-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Changes from 0.11.1 to 1.0.0
domenic edited this page Sep 28, 2014
·
1 revision
jsdom finally got its 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. It also evolved over a series of seven prereleases, so the usual changelog can be a bit confusing to get a consolidated picture from.
Starting with the 1.0.0 release, we will be following semantic versioning, so that you can depend on stability within major version ranges.
This release owes a special thanks to @Sebmaster, for his amazing work taking on some of the hardest problems in jsdom and solving them with gusto.
- jsdom now can be browserified into a bundle that works in web workers! This is highly experimental, but also highly exciting! (lawnsea)
- An overhaul of the initialization lifecycle, to bring more control and address common use cases. (Sebmaster)
- The excellent parse5 HTML parser is now the default parser, fixing many parsing bugs and giving us full, official-test-suite-passing HTML parsing support. This especially impacts documents that didn't include optional tags like
<html>
,<head>
, or<body>
in their source. We also use parse5 for serialization, fixing many bugs there. (Sebmaster) - As part of the new parser story, we have a new
parsingMode
configuration, which allows you to manually specify XML or HTML parsing modes. (As such, jsdom will no longer use the presence of<?xml
or similar to attempt to auto-detect XHTML documents.) Note that our XHTML support is still very crude, and we will never be a general-purpose XML DOM; see #885 for more details. (Sebmaster)
-
jsdom.createWindow
: usedocument.parentWindow
after creating a document -
jsdom.html
: usejsdom.jsdom
-
jsdom.version
: userequire("jsdom/package.json").version
-
jsdom.level
: levels are deprecated and will probably be removed in 2.0.0 jsdom.dom
jsdom.browserAugmentation
jsdom.windowAugmentation
-
jsdom.jsdom
no longer takes a level as its second argument. -
jsdom.jQueryify
now requires a jQuery URL, since always picking the latest was a bad idea.
-
document.createWindow
: usedocument.parentWindow
-
document.outerHTML
: use the newjsdom.serializeDocument
to include the DOCTYPE, or usedocument.documentElement.outerHTML
to omit it -
document.innerHTML
: usedocument.documentElement.innerHTML
ordocument.write
-
EventTarget.getListeners
,EventTarget.forwardIterator
,EventTarget.backwardIterator
, andEventTarget.singleIterator
: most of these were useless, but if you need a counterpart togetListeners
, file an issue and we'll addjsdom.getEventTargetListeners
or something
- Same-named radio inputs should not be mutually exclusive unless they are in the same form. (stof)
- The
value
anddefaultValue
properties of aHTMLInputElement
are now correctly synced to thevalue=""
attribute. (Sebmaster) - Make event listeners in the capture phase also fire on the event target. (Joris-van-der-Wel)
- Correctly reset
eventPhase
andcurrentTarget
on events, before and after a dispatch. (Joris-van-der-Wel) - Attributes and elements now have their
prefix
,localName
, andnamespaceURI
properties set correctly in all cases, at least in the HTML parsing mode. (Sebmaster) - Fix
document.cookie = null
to not throw, but instead just do nothing. (kapouer) - Allow empty strings to be passed to
jsdom.env
. (michaelmior) - Fix for a memory leak in
EventTarget.prototype.dispatchEvent
. (Joris-van-der-Wel) - Fix
window.close()
to avoid the occassional segfault. - Memoized various DOM-querying functions (e.g.
getElementsByTagName
,querySelector
, etc.) to improve performance. (ccarpita)