diff --git a/src/lib/dom-tree-api.html b/src/lib/dom-tree-api.html index 296b6f579e..2195423611 100644 --- a/src/lib/dom-tree-api.html +++ b/src/lib/dom-tree-api.html @@ -195,7 +195,11 @@ // the act of setting this info can affect patched nodes // getters; therefore capture childNodes before patching. for (var n=node.firstChild; n; n=n.nextSibling) { - this._linkNode(n, container, ref_node); + // only link in the child iff it's not already in the container's + // logical tree. + if (this.getParentNode(n) !== container) { + this._linkNode(n, container, ref_node); + } } } else { this._linkNode(node, container, ref_node); diff --git a/src/lib/template/dom-repeat.html b/src/lib/template/dom-repeat.html index 3ab89abea8..04ec5c3788 100644 --- a/src/lib/template/dom-repeat.html +++ b/src/lib/template/dom-repeat.html @@ -254,15 +254,20 @@ }, detached: function() { + this.__isDetached = true; for (var i=0; i + + + + distribute dom-repeat + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/unit/polymer-dom-content.html b/test/unit/polymer-dom-content.html index be6f99aa33..45b59afba7 100644 --- a/test/unit/polymer-dom-content.html +++ b/test/unit/polymer-dom-content.html @@ -40,6 +40,11 @@ + + + + +