diff --git a/src/mini/shady.html b/src/mini/shady.html
index cfa5f938cc..0caa80eab4 100644
--- a/src/mini/shady.html
+++ b/src/mini/shady.html
@@ -300,7 +300,13 @@
// process removals
for (var i=0, d=0, s; (i
+
+
+
+
+
+
+
x-dist-inside-deep-tree
@@ -1171,6 +1182,73 @@
document.body.removeChild(h1);
});
+ test('moving children between distributing host with shallow insertion and fragment', function() {
+ var h1 = document.createElement('x-dist-simple');
+ var h2 = document.createDocumentFragment();;
+ document.body.appendChild(h1);
+ Polymer.dom.flush();
+ var d = document.createElement('div');
+ Polymer.dom(h1).appendChild(d);
+ Polymer.dom.flush();
+ assert.equal(Polymer.dom(h1).childNodes.length, 1);
+ assert.equal(Polymer.dom(h1).firstElementChild, d);
+ assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes(), [d]);
+ assert.equal(Polymer.dom(h2).childNodes.length, 0);
+ Polymer.dom(h2).appendChild(d);
+ Polymer.dom.flush();
+ assert.equal(Polymer.dom(h2).childNodes.length, 1);
+ assert.equal(Polymer.dom(h2).firstElementChild, d);
+ assert.equal(Polymer.dom(h1).childNodes.length, 0);
+ assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0);
+ Polymer.dom(h1).appendChild(d);
+ Polymer.dom.flush();
+ assert.equal(Polymer.dom(h1).childNodes.length, 1);
+ assert.equal(Polymer.dom(h1).firstElementChild, d);
+ assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes(), [d]);
+ assert.equal(Polymer.dom(h2).childNodes.length, 0);
+ Polymer.dom(h2).appendChild(d);
+ Polymer.dom.flush();
+ assert.equal(Polymer.dom(h2).childNodes.length, 1);
+ assert.equal(Polymer.dom(h2).firstElementChild, d);
+ assert.equal(Polymer.dom(h1).childNodes.length, 0);
+ assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0);
+ document.body.removeChild(h1);
+ });
+
+ test('moving children between distributing host with shallow insertion and fragment (parsed child)', function() {
+ var div = document.createElement('div');
+ div.innerHTML = '';
+ var h1 = div.firstChild;
+ var h2 = document.createDocumentFragment();;
+ document.body.appendChild(h1);
+ Polymer.dom.flush();
+ var d = Polymer.dom(h1).firstElementChild;
+ assert.equal(d.localName, 'div');
+ assert.equal(Polymer.dom(h1).childNodes.length, 1);
+ assert.equal(Polymer.dom(h1).firstElementChild, d);
+ assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes(), [d]);
+ assert.equal(Polymer.dom(h2).childNodes.length, 0);
+ Polymer.dom(h2).appendChild(d);
+ Polymer.dom.flush();
+ assert.equal(Polymer.dom(h2).childNodes.length, 1);
+ assert.equal(Polymer.dom(h2).firstElementChild, d);
+ assert.equal(Polymer.dom(h1).childNodes.length, 0);
+ assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0);
+ Polymer.dom(h1).appendChild(d);
+ Polymer.dom.flush();
+ assert.equal(Polymer.dom(h1).childNodes.length, 1);
+ assert.equal(Polymer.dom(h1).firstElementChild, d);
+ assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes(), [d]);
+ assert.equal(Polymer.dom(h2).childNodes.length, 0);
+ Polymer.dom(h2).appendChild(d);
+ Polymer.dom.flush();
+ assert.equal(Polymer.dom(h2).childNodes.length, 1);
+ assert.equal(Polymer.dom(h2).firstElementChild, d);
+ assert.equal(Polymer.dom(h1).childNodes.length, 0);
+ assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0);
+ document.body.removeChild(h1);
+ });
+
test('moving an element containing a dom-repeat that distributes items', function() {
var x1 = document.createElement('x-repeat');
var div = document.createElement('div');