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

Unified Diff: third_party/WebKit/LayoutTests/custom-elements/imports/upgrade-order.html

Issue 2242743002: Make custom elements work in HTML imports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses tkent's comments. Created 4 years, 4 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
Index: third_party/WebKit/LayoutTests/custom-elements/imports/upgrade-order.html
diff --git a/third_party/WebKit/LayoutTests/custom-elements/imports/upgrade-order.html b/third_party/WebKit/LayoutTests/custom-elements/imports/upgrade-order.html
new file mode 100644
index 0000000000000000000000000000000000000000..eb9728e7c5ac2283dd1e636394e35af544c5f83b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/custom-elements/imports/upgrade-order.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+'use strict';
+
+let reactions = [];
+</script>
+<x-x id="a"></x-x>
+<y-y id="x"></y-y>
+<link id="import1" rel="import" href="resources/upgrade.html">
+<x-x id="b"></x-x>
+<y-y id="y"></y-y>
+<script>
+'use strict'
+
+async_test((test) => {
+ window.onload = test.step_func_done(() => {
+ customElements.define('y-y', class extends HTMLElement {
+ constructor() {
+ super();
+ reactions.push({ type: 'constructor', element: this });
+ }
+ });
+
+ let elements = reactions.map(e => e.element.id);
+ assert_array_equals(elements, ['a', 'aa', 'b', 'x', 'bb', 'y']);
+ }, 'Upgrade of custom elements should happen in document order.');
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698