Skip to content

Commit

Permalink
Avoid use of element accessors on doc frag to fix IE/Edge.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Jan 29, 2018
1 parent 86ecd98 commit ecb1005
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/unit/templatize.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
</head>
<body>

<template id="standalone">
<div prop="[[prop]]">[[text]]</div>
</template>
<template id="standalone"><div prop="[[prop]]">[[text]]</div></template>

<script>

Expand Down Expand Up @@ -338,7 +336,7 @@
const template = document.getElementById('standalone').cloneNode(true);
const Template = Polymer.Templatize.templatize(template);
const inst = new Template({prop: 'prop', text: 'text'});
const div = inst.root.firstElementChild;
const div = inst.root.firstChild;
assert.equal(div.prop, 'prop');
assert.equal(div.textContent, 'text');
});
Expand All @@ -347,7 +345,7 @@
const template = document.getElementById('standalone').cloneNode(true);
const Template = Polymer.Templatize.templatize(template);
const inst = new Template();
const div = inst.root.firstElementChild;
const div = inst.root.firstChild;
assert.equal(div.prop, undefined);
assert.equal(div.textContent.trim(), '');
inst.setProperties({prop: 'prop', text: 'text'});
Expand All @@ -359,7 +357,7 @@
const template = document.getElementById('standalone').cloneNode(true);
const Template = Polymer.Templatize.templatize(template);
const inst = new Template();
const div = inst.root.firstElementChild;
const div = inst.root.firstChild;
inst.setProperties({prop: {foo: true}});
assert.equal(div.prop.foo, true);
inst.set('prop.foo', false);
Expand Down

0 comments on commit ecb1005

Please sign in to comment.