Skip to content

Commit

Permalink
Revert "for adobe#10634"
Browse files Browse the repository at this point in the history
This reverts commit d72b612.
  • Loading branch information
humphd committed May 15, 2015
1 parent e3a1477 commit a78a016
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions src/language/HTMLDOMDiff.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,13 +570,10 @@ define(function (require, exports, module) {
// Start at the root of the current tree.
queue.push(newNode);

var rootElemChanged = false, deltaID;

do {
newElement = queue.pop();
oldElement = oldNodeMap[newElement.tagID];


// Do we need to compare elements?
if (oldElement) {

Expand Down Expand Up @@ -604,29 +601,17 @@ define(function (require, exports, module) {
// because it isn't the child of any other node. The browser-side code doesn't
// care about parentage/positioning in this case, and will handle just setting the
// ID on the existing implied HTML tag in the browser without actually creating it.
if (!newElement.parent ) {
if (!newElement.parent) {
edits.push({
type: "elementInsert",
tag: newElement.tag,
tagID: newElement.tagID,
parentID: null,
attributes: newElement.attributes
});

// Since the root <html> tag has a new tag ID if the user copies and pastes the entire document,
// This checks if there is an old <root> node, and if there is, passes that node as a parameter to
// generateChildEdits instead of null.
if (Object.keys(oldNodeMap).length > 0){
addEdits(generateChildEdits(oldNodeMap[Object.keys(oldNodeMap)[0]], oldNodeMap, newElement, newNodeMap));
} else {
addEdits(generateChildEdits(null, oldNodeMap, newElement, newNodeMap));
}

} else {
addEdits(generateChildEdits(null, oldNodeMap, newElement, newNodeMap));
}


addEdits(generateChildEdits(null, oldNodeMap, newElement, newNodeMap));
}
} while (queue.length);

Expand Down

0 comments on commit a78a016

Please sign in to comment.