jsdom v6.3.0 Release Notes
-
- ➕ Added a fully spec-compliant implementation of
window.atob
andwindow.btoa
. (jeffcarp) - 🛠 Fixed many issues with our
<canvas>
implementation:- With the
canvas
npm package installed,<canvas>
elements are now properlyinstanceof HTMLCanvasElement
andinstanceof HTMLElement
. <canvas>
elements now present the same uniform spec-compliant API both with and without thecanvas
npm package installed. If the package is not installed, some of the methods will cause not-implementedjsdomError
events to be emitted on the virtual console.- The
width
andheight
properties now correctly reflect thewidth
andheight
attributes, and have the appropriate default values of300
and150
. - 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.
- 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
. HTMLAudioElement
was implemented in full, although itsHTMLMediaElement
base, where most of its functionality is, is still largely a stub.HTMLTableSectionElement
,HTMLTableRowElement
,HTMLTableCellElement
,HTMLTableDataCellElement
, andHTMLTableHeaderCellElement
were updated to the latest spec.HTMLIsIndexElement
was removed; it has never been produced by the parser since 1.0.0-pre.1, and so it has been just a vestigial global property.- Appropriate constants were added to
HTMLMediaElement
.
- Complete implementations were added for
- ⚡️ Updated everything having to do with base URLs to be per-spec:
- Added
Node.prototype.baseURI
property to get the node's owner document's base URL. HTMLBaseElement
'shref
getter now contains appropriate fallbacks and always returns an absolute URL, per spec.- If there are no
base
elements in an"about:blank"
iframe document, the base URL correctly falls back to the parent window's base URL.
- 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.URL
returns"http://example.com/"
, with a trailing slash. - In a future major release, we will start throwing if strings that cannot be parsed as valid absolute URL are provided for this option.
- So for example, providing
- ➕ Added a fully spec-compliant implementation of