HTMLDOMDiff
Import :
const HTMLDOMDiff = brackets.getModule("language/HTMLDOMDiff")
domdiff(oldNode, newNode) ⇒ Array.<Object>
Generate a list of edits that will mutate oldNode to look like newNode. Currently, there are the following possible edit operations:
- elementInsert
- elementDelete
- elementMove
- textInsert
- textDelete
- textReplace
- attrDelete
- attrChange
- attrAdd
- rememberNodes (a special instruction that reflects the need to hang on to moved nodes)
Kind: global function
Returns: Array.<Object>
- - List of edit operations.
Param | Type | Description |
---|---|---|
oldNode | Object | SimpleDOM node with the original content. |
newNode | Object | SimpleDOM node with the new content. |
- domdiff(oldNode, newNode) ⇒
Array.<Object>
domdiff.queuePush()
Adds elements to the queue for generateChildEdits. Only elements (and not text nodes) are added. New nodes (ones that aren't in the old nodeMap), are not added here because they will be added when generateChildEdits creates the elementInsert edit.
Kind: inner method of domdiff
domdiff.addEdits(delta)
Aggregates the child edits in the proper data structures.
Kind: inner method of domdiff
Param | Type | Description |
---|---|---|
delta | Object | edits, moves and newElements to add |