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

Commit

Permalink
Fix issue with syncing render nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
arv committed Sep 27, 2013
1 parent efaafa3 commit d917377
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ShadowRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
}

for (var i = lastIndex; i < newChildren.length; i++) {
newChildren[i++].sync(added);
newChildren[i].sync(added);
}
}
};
Expand Down
15 changes: 15 additions & 0 deletions test/js/HTMLContentElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,21 @@ suite('HTMLContentElement', function() {
assertArrayEqual(content.getDistributedNodes(), fooRoot.firstChild.children);
});

test('Adding tree with content again', function() {
var host = document.createElement('div');
host.innerHTML = ' <p>Content</p> ';

var t = document.createElement('template');
t.innerHTML = ' <div> <div> [<content></content>] </div> </div> ';

var sr = host.createShadowRoot();
sr.appendChild(t.content.cloneNode(true));

host.offsetHeight;
assert.equal(unwrap(host).innerHTML,
' <div> <div> [ <p>Content</p> ] </div> </div> ');
});

test('adding a new content element to a shadow tree', function() {
var host = document.createElement('div');
host.innerHTML = '<a></a><b></b>';
Expand Down

0 comments on commit d917377

Please sign in to comment.