2.2.0
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.