Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Merge pull request #442 from arv/normalize-typo
Browse files Browse the repository at this point in the history
Fix typo in normalize
  • Loading branch information
dfreedm committed May 22, 2014
2 parents 9d2bdaa + 2382e91 commit 41b5434
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/wrappers/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@
} else {
if (modNode && remNodes.length) {
modNode.data += s;
cleanUpNodes(remNodes);
cleanupNodes(remNodes);
}
remNodes = [];
s = '';
Expand Down
15 changes: 14 additions & 1 deletion test/js/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ suite('Node', function() {
assert.equal(span.firstChild.textContent, 'buzzquux');
assert.equal(span.nextSibling, div.lastChild);
assert.equal(div.lastChild.textContent, 'bar\n');

});

test('normalize with shadowroot', function() {
Expand All @@ -392,6 +391,20 @@ suite('Node', function() {
assert.equal(sr.firstChild.nextSibling.textContent, 'quux');
});

test('normalize - issue 441', function() {
var div = document.createElement('div');
div.appendChild(document.createTextNode('a'));
div.appendChild(document.createTextNode('b'));
div.appendChild(document.createElement('span'));
div.appendChild(document.createTextNode('c'));
div.appendChild(document.createTextNode('d'));

div.normalize();

assert.equal(div.textContent, 'abcd');
assert.equal(div.childNodes.length, 3);
});

test('appendChild last and first', function() {
var a = document.createElement('a');
a.innerHTML = '<b></b>';
Expand Down

0 comments on commit 41b5434

Please sign in to comment.