UNPKG

@webcomponents/custom-elements

Version:
22 lines (18 loc) 823 B
<!DOCTYPE html> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <link id="import1" rel="import" href="resources/import-custom.html"> <script> 'use strict'; test(() => { let a = import1.import.querySelector('x-x'); assert_equals(Object.getPrototypeOf(a), HTMLElement.prototype, '<x-x> should not have been upgreaded yet.'); import1.remove(); assert_equals(document.querySelector('link[rel=import]'), null, 'imported document should be detached'); customElements.define('x-x', class extends HTMLElement{}); assert_equals(Object.getPrototypeOf(a), HTMLElement.prototype, 'detached <x-x> should not have been upgreaded.'); }, 'custom elements in detached imports should not upgrade.'); </script>