Constructor
new DOMDiff(env)
Methods
dataMWEquals()
Test if two data-mw objects are identical.
- independent of order of attributes in data-mw
- html attributes are parsed to DOM and recursively compared
- for id attributes, the DOM fragments are fetched and compared.
- Source:
diff()
Diff two HTML documents, and add / update data-parsoid-diff attributes with change information.
Diff two HTML documents, and add / update data-parsoid-diff attributes with change information.
- Source:
doDOMDiff()
Diff two DOM trees by comparing them node-by-node.
TODO: Implement something more intelligent like http://gregory.cobena.free.fr/www/Publications/%5BICDE2002%5D%20XyDiff%20-%20published%20version.pdf, which uses hash signatures of subtrees to efficiently detect moves / wrapping.
Adds / updates a data-parsoid-diff structure with change information.
Returns true if subtree is changed, false otherwise.
TODO: Assume typical CSS white-space, so ignore ws diffs in non-pre content.
- Source: