Skip to content

Commit

Permalink
Fix customElements.upgrade() tests for <template> (#10272)
Browse files Browse the repository at this point in the history
* Fix customElements.upgrade() tests for <template>

See #9869 (comment).

* Actually fix things
  • Loading branch information
domenic authored and tkent-google committed Apr 3, 2018
1 parent 24f7e6d commit 5b68d21
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions custom-elements/custom-element-registry/upgrade.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,13 @@

customElements.upgrade(template.content);

assert_true(el1 instanceof Element1, "element 1 must now be upgraded");
assert_true(el2 instanceof Element2, "element 2 must now be upgraded");
assert_true(el3 instanceof Element3, "element 3 must now be upgraded");
assert_true(el4 instanceof Element4, "element 4 must now be upgraded");
assert_true(el5 instanceof Element5, "element 5 must now be upgraded");
// Template contents owner documents don't have a browsing context, so
// https://html.spec.whatwg.org/multipage/custom-elements.html#look-up-a-custom-element-definition does not find any
// custom element definition.
assert_false(el1 instanceof Element1, "element 1 must still not be upgraded after upgrading the template contents");
assert_false(el2 instanceof Element2, "element 2 must still not be upgraded after upgrading the template contents");
assert_false(el3 instanceof Element3, "element 3 must still not be upgraded after upgrading the template contents");
assert_false(el4 instanceof Element4, "element 4 must still not be upgraded after upgrading the template contents");
assert_false(el5 instanceof Element5, "element 5 must still not be upgraded after upgrading the template contents");
}, "Elements inside a template contents DocumentFragment node");
</script>

0 comments on commit 5b68d21

Please sign in to comment.