Skip to content

Commit

Permalink
Avoid firstElementChild on DocFrag for IE11
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed May 24, 2017
1 parent 06190c9 commit 02e31d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/unit/template-stamp.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</head>
<body>

<template id="test-template">
<template id="test-template" strip-whitespace>
<div id="a">a</div>
<div id="eventHandler" on-click="handleClick"></div>
<div id="b">b</div>
Expand Down Expand Up @@ -75,7 +75,7 @@
let content = el.constructor._contentForTemplate(el.dom.$.nestedTemplate);
assert.isTrue(content instanceof DocumentFragment);
assert.equal(content.ownerDocument, el.dom.$.nestedTemplate.content.ownerDocument);
assert.equal(content.firstElementChild.getAttribute('on-click'), null);
assert.equal(content.firstChild.getAttribute('on-click'), null);
document.body.removeChild(el);
});

Expand All @@ -84,7 +84,7 @@
document.body.appendChild(el);
let content = el.dom.$.preservedTemplate.content;
assert.isTrue(content instanceof DocumentFragment);
assert.equal(content.firstElementChild.getAttribute('on-click'), 'shouldNotBeRemoved');
assert.equal(content.childNodes[1].getAttribute('on-click'), 'shouldNotBeRemoved');
document.body.removeChild(el);
});

Expand Down

0 comments on commit 02e31d7

Please sign in to comment.