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

Commit

Permalink
Fix typo in normalize
Browse files Browse the repository at this point in the history
Fixes #441
  • Loading branch information
arv committed May 21, 2014
1 parent 9d2bdaa commit 2382e91
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 2382e91

Please sign in to comment.