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

Side by Side 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: Use DCHECK, revert RuntimeEnabledFeatures.in. 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharness-helpers.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="spec/resources/custom-elements-helpers.js"></script>
6 <body>
7 <script>
8 'use strict';
9
10 test_with_window((w) => {
11 class X extends w.HTMLElement {}
12
13 w.customElements.define('new-old', X);
14 assert_throws(null, () => {
15 w.document.registerElement('new-old', {prototype: X.prototype});
16 }, '"registering" (v0) a name already "defined" should throw');
17
18 w.document.registerElement('old-new', {
19 prototype: Object.create(w.HTMLElement.prototype)
20 });
21 class Y extends w.HTMLElement {}
22 assert_throws(null, () => {
23 w.customElements.define('old-new', Y);
24 }, '"defining" (v1) a name already "registered" (v0) should throw');
25 }, 'Overlapping old and new-style custom elements are not allowed');
26 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698