diffDOM

This library allows the abstraction of differences between DOM elements as a "diff" object, representing the sequence of modifications that must be applied to one element in order to turn it into the other element. This diff is non-destructive, meaning that relocations of DOM nodes are preferred over remove-insert operations.

This project is licensed under the LGPL v. 3. For details see the license.

Tests

There is a test of random elements, one of basic elements, one that tests the extents of diffs to help generate the least number of changes, and of form elements that tended to throw errors in previous versions of this library.

There is also a version of the random tests that reloads if no errors have been found, mainly useful for finding errors.

The input value modification test, contributed by user matthewwolfe, tests diffing changes to input fields.

The site integration test, contributed by user unbug, allows for testing for speed on a 170kb site real-world-like site where it is integrated with jQuery.

Demo

Check out the interactive demo!

Usage/Download

Usage instructions and download available on github.