Index: third_party/WebKit/LayoutTests/custom-elements/spec/insert-a-node-try-to-upgrade.html |
diff --git a/third_party/WebKit/LayoutTests/custom-elements/spec/insert-a-node-try-to-upgrade.html b/third_party/WebKit/LayoutTests/custom-elements/spec/insert-a-node-try-to-upgrade.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bfc2cc2887d536719fc03b343de07bc84e75e8dc |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/custom-elements/spec/insert-a-node-try-to-upgrade.html |
@@ -0,0 +1,32 @@ |
+<!DOCTYPE html> |
+<title>Custom Elements: Insert a node should try to upgrade</title> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script src="resources/custom-elements-helpers.js"></script> |
+<body> |
+<script> |
+'use strict'; |
+ |
+// Insert a node |
+// https://dom.spec.whatwg.org/#concept-node-insert |
+// 6.5.2.2. try to upgrade inclusiveDescendant. |
+// Try to upgrade an element |
+// https://html.spec.whatwg.org/multipage/scripting.html#concept-try-upgrade |
+test_with_window(w => { |
+ let element = w.document.createElement('a-a'); |
+ |
+ w.customElements.define('a-a', class extends w.HTMLElement { |
+ constructor() { |
+ super(); |
+ this.is_upgraded = true; |
+ } |
+ }); |
+ assert_false('is_upgraded' in element); |
+ assert_false(element.matches(':defined')); |
+ |
+ w.document.body.appendChild(element); |
+ assert_true(element.is_upgraded); |
+ assert_true(element.matches(':defined')); |
+}, 'Insert a node should try to upgrade'); |
+</script> |
+</body> |