OLD | NEW |
(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> |
OLD | NEW |