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

Unified Diff: third_party/WebKit/LayoutTests/custom-elements/imports/detached-import.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/detached-import.html
diff --git a/third_party/WebKit/LayoutTests/custom-elements/imports/detached-import.html b/third_party/WebKit/LayoutTests/custom-elements/imports/detached-import.html
new file mode 100644
index 0000000000000000000000000000000000000000..1886b4b0648ff13f102aae5d6f7028f6ba91cd93
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/custom-elements/imports/detached-import.html
@@ -0,0 +1,21 @@
+<!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>

Powered by Google App Engine
This is Rietveld 408576698