Parsoid
A bidirectional parser between wikitext and HTML5
|
A DOM diff helper class. More...
Public Member Functions | |
__construct (Env $env) | |
diff (Element $nodeA, Element $nodeB) | |
Diff two HTML documents, and add / update data-parsoid-diff attributes with change information. | |
treeEquals (Node $nodeA, Node $nodeB, bool $deep) | |
Test if two DOM nodes are equal. | |
doDOMDiff (Node $baseParentNode, Node $newParentNode) | |
Diff two DOM trees by comparing them node-by-node. | |
Public Attributes | |
$env | |
$extApi | |
$specializedAttribHandlers | |
bool | $skipEncapsulatedContent = true |
A DOM diff helper class.
Compares two DOMs and annotates a copy of the passed-in DOM with change information for the selective serializer.
Diff two HTML documents, and add / update data-parsoid-diff attributes with change information.
Element | $nodeA | |
Element | $nodeB |
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.
Node | $baseParentNode | |
Node | $newParentNode |
Test if two DOM nodes are equal.
Node | $nodeA | |
Node | $nodeB | |
bool | $deep |