Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1036)

Unified Diff: third_party/WebKit/LayoutTests/custom-elements/spec/insert-a-node-try-to-upgrade.html

Issue 2067853002: Upgrade custom elements when inserting a node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dominicc nits Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698