Skip to content

Releases: bwrrp/slimdom.js

2.2.1

19 Dec 08:30
Compare
Choose a tag to compare

This is a bugfix release:

  • Prevent a stack overflow error when serializing very large text nodes (with millions of characters).

2.2.0

10 Oct 11:59
Compare
Choose a tag to compare

This release improves compliance with the DOM living standard:

  • Before, if mutation observer callbacks needed to run asynchronously, they were scheduled using either setImmediate or setTimeout (depending on availability). This could allow other tasks to run before the callback, which could be unexpected. This release changes the scheduling to use an actual microtask, courtesy of Promise#then.
  • The newly introduced Element#toggleAttribute method has been implemented.

...as well as some other improvements:

  • Typings for several methods are now generic to avoid the need to cast the return value to the appropriate Node subclass.
  • A number of "unsafe" mutation / creation functions have been added that are necessary for parsing HTML documents. These bypass some checks performed by the standard DOM APIs. An example has been added showing how to integrate slimdom with the parse5 HTML5 parser.
  • Updated devDependencies to their latest versions.

2.1.3

16 Mar 12:33
Compare
Choose a tag to compare

This is a bugfix release:

  • Fix an issue where the names of public types were accidentally minified, making slimdom objects harder to identify when debugging.

2.1.2

22 Feb 09:55
Compare
Choose a tag to compare

This is a bugfix release:

  • Fix duplicate namespace declarations being generated if an element contains multiple attributes in the same non-null namespace.

2.1.1

22 Feb 09:54
Compare
Choose a tag to compare

This is a bugfix release:

  • Fix a stack overflow error that may occur when serializing large documents.

2.1.0

16 Aug 10:11
Compare
Choose a tag to compare

This release adds XML serialization support:

  • Use new slimdom.XMLSerializer() to get an object implementing the XMLSerializer interface, as defined in the DOM Parsing and Serialization W3C Editor's Draft.
  • slimdom.serializeToWellFormedString provides a convenient way to serialize while enforcing XML well-formedness.
  • The innerHTML and outerHTML properties have been added on elements (currently read-only).

2.0.1

23 Jun 07:32
Compare
Choose a tag to compare

This is a bugfix release:

  • Fix Range collapsing when the end position is moved inward (#34).

2.0.0

21 Jun 11:33
Compare
Choose a tag to compare

This release pretty much rewrites the entire codebase to align its behavior with the DOM living standard, as last updated 15 June 2017. Please refer to the README.md for details on what's included and what isn't.

For those upgrading from 1.0:

  • slimdom.createDocument() has been removed in favor of new slimdom.Document()
  • The library now includes an ES module, which does not have a default export. Use import * as slimdom from 'slimdom' instead of import slimdom from 'slimdom'
  • All methods are a lot less forgiving, and now throw errors as defined by the spec
  • documentNode.ownerDocument is now null, as required by the spec