- Added a fully spec-compliant implementation of
window.atobandwindow.btoa. (@jeffcarp) - Fixed many issues with our
<canvas>implementation:- With the
canvasnpm package installed,<canvas>elements are now properlyinstanceof HTMLCanvasElementandinstanceof HTMLElement. <canvas>elements now present the same uniform spec-compliant API both with and without thecanvasnpm package installed. If the package is not installed, some of the methods will cause not-implementedjsdomErrorevents to be emitted on the virtual console.- The
widthandheightproperties now correctly reflect thewidthandheightattributes, and have the appropriate default values of300and150. - With the
canvasnpm package installed,<canvas>elements now generally play better with other parts of jsdom, e.g.,document.getElementByIdactually works with them.
- With the
- Introduced and upated many of our element classes, so that at least every tag name/element class pair is now correct, even if some of the classes are stubs. In particular:
- Complete implementations were added for
HTMLDataElement,HTMLSpanElement, andHTMLTimeElement. - Stubs were added for
HTMLDataListElement,HTMLDialogElement,HTMLEmbedElement,HTMLMeterElement,HTMLOutputElement,HTMLProgressElement,HTMLSourceElement,HTMLTemplateElement, andHTMLTrackElement. HTMLAudioElementwas implemented in full, although itsHTMLMediaElementbase, where most of its functionality is, is still largely a stub.HTMLTableSectionElement,HTMLTableRowElement,HTMLTableCellElement,HTMLTableDataCellElement, andHTMLTableHeaderCellElementwere updated to the latest spec.HTMLIsIndexElementwas removed; it has never been produced by the parser since 1.0.0-pre.1, and so it has been just a vestigial global property.- Appropriate constants were added to
HTMLMediaElement.
- Complete implementations were added for
- Updated everything having to do with base URLs to be per-spec:
- Added
Node.prototype.baseURIproperty to get the node's owner document's base URL. HTMLBaseElement'shrefgetter now contains appropriate fallbacks and always returns an absolute URL, per spec.- If there are no
baseelements in an"about:blank"iframe document, the base URL correctly falls back to the parent window's base URL.
- Added
- When you provide a
url: ...option tojsdom.jsdom()orjsdom.env(), the given string is now attempted to be resolved as a URL before it is installed asdocument.URL.- So for example, providing
url: "http://example.com"will meandocument.URLreturns"http://example.com/", with a trailing slash. - In a future major release, we will start throwing if strings that cannot be parsed as valid absolute URL are provided for this option.
- So for example, providing