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

Unified Diff: third_party/WebKit/LayoutTests/custom-elements/v0-v1-interop.html

Issue 1952893003: Implement custom element construction and some 'define' checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement feedback. Created 4 years, 7 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/v0-v1-interop.html
diff --git a/third_party/WebKit/LayoutTests/custom-elements/v0-v1-interop.html b/third_party/WebKit/LayoutTests/custom-elements/v0-v1-interop.html
new file mode 100644
index 0000000000000000000000000000000000000000..a1c7288e84021ca14ce1ab2672328877dbc8e3f1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/custom-elements/v0-v1-interop.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharness-helpers.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="spec/resources/custom-elements-helpers.js"></script>
+<body>
+<script>
+'use strict';
+
+test_with_window((w) => {
+ class X extends w.HTMLElement {}
+
+ w.customElements.define('new-old', X);
+ assert_throws(null, () => {
+ w.document.registerElement('new-old', {prototype: X.prototype});
+ }, '"registering" (v0) a name already "defined" should throw');
+
+ w.document.registerElement('old-new', {
+ prototype: Object.create(w.HTMLElement.prototype)
+ });
+ class Y extends w.HTMLElement {}
+ assert_throws(null, () => {
+ w.customElements.define('old-new', Y);
+ }, '"defining" (v1) a name already "registered" (v0) should throw');
+}, 'Overlapping old and new-style custom elements are not allowed');
+</script>

Powered by Google App Engine
This is Rietveld 408576698