From dfa6a44ac0b20f900ebd472d610d65970c59d931 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Mon, 7 Dec 2015 14:48:21 -0800 Subject: [PATCH] Correct test to avoid using `firstElementChild` on a documentFragment since it is not universally supported. --- test/unit/polymer-dom-content.html | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/test/unit/polymer-dom-content.html b/test/unit/polymer-dom-content.html index 0ab9a3efd2..be6f99aa33 100644 --- a/test/unit/polymer-dom-content.html +++ b/test/unit/polymer-dom-content.html @@ -1100,7 +1100,7 @@ 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(h2).firstChild, d); assert.equal(Polymer.dom(h1).childNodes.length, 0); assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0); Polymer.dom(h1).appendChild(d); @@ -1112,7 +1112,7 @@ 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(h2).firstChild, d); assert.equal(Polymer.dom(h1).childNodes.length, 0); assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0); document.body.removeChild(h1); @@ -1134,7 +1134,7 @@ 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(h2).firstChild, d); assert.equal(Polymer.dom(h1).childNodes.length, 0); assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0); Polymer.dom(h1).appendChild(d); @@ -1146,7 +1146,7 @@ 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(h2).firstChild, d); assert.equal(Polymer.dom(h1).childNodes.length, 0); assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0); document.body.removeChild(h1); @@ -1246,7 +1246,7 @@ 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(h2).firstChild, d); assert.equal(Polymer.dom(h1).childNodes.length, 0); assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0); Polymer.dom(h1).appendChild(d); @@ -1258,7 +1258,7 @@ 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(h2).firstChild, d); assert.equal(Polymer.dom(h1).childNodes.length, 0); assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0); document.body.removeChild(h1); @@ -1280,7 +1280,7 @@ 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(h2).firstChild, d); assert.equal(Polymer.dom(h1).childNodes.length, 0); assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0); Polymer.dom(h1).appendChild(d); @@ -1292,7 +1292,7 @@ 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(h2).firstChild, d); assert.equal(Polymer.dom(h1).childNodes.length, 0); assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0); document.body.removeChild(h1); @@ -1313,7 +1313,7 @@ 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(h2).firstChild, d); assert.equal(Polymer.dom(h1).childNodes.length, 0); assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0); Polymer.dom(h1).appendChild(d); @@ -1325,7 +1325,7 @@ 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(h2).firstChild, d); assert.equal(Polymer.dom(h1).childNodes.length, 0); assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0); document.body.removeChild(h1); @@ -1335,7 +1335,7 @@ var div = document.createElement('div'); div.innerHTML = '
'; var h1 = div.firstChild; - var h2 = document.createDocumentFragment();; + var h2 = document.createDocumentFragment(); document.body.appendChild(h1); Polymer.dom.flush(); var d = Polymer.dom(h1).firstElementChild; @@ -1347,7 +1347,7 @@ 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(h2).firstChild, d); assert.equal(Polymer.dom(h1).childNodes.length, 0); assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0); Polymer.dom(h1).appendChild(d); @@ -1359,7 +1359,7 @@ 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(h2).firstChild, d); assert.equal(Polymer.dom(h1).childNodes.length, 0); assert.deepEqual(Polymer.dom(h1.$.content).getDistributedNodes().length, 0); document.body.removeChild(h1);