-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
index.html
70 lines (42 loc) · 1.66 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!doctype html>
<meta charset=UTF-8>
<meta name=viewport content='width=device-width, initial-scale=1'>
<title>Element: Constructor</title>
<meta name=author title=dees href=mailto:[email protected]>
<meta name=author title=snuggsi href=mailto:[email protected]>
<meta name=assert content="HTMLElement must allow subclassing">
<link rel=help href=https://snuggsi.es/element>
<link rel=help href=https://html.spec.whatwg.org/#html-element-constructors>
<!--
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
-->
<div id=log></div>
<foo-bar></foo-bar>
<script>
console.log ('\n\nthis is inside jsdom \n\n')
// failure
/*
test (() => {
Element `foo-bar`
(class CustomElementWithInferredTagName extends HTMLElement {})
assert_throws
({'name': 'TypeError'}, function () { new SomeCustomElement; })
}, 'HTMLElement constructor must throw TypeError when it has not been defined by customElements.define')
*/
// success
/*
test (() => {
Element `foo-bar` (class CustomElementWithInferredTagName extends HTMLElement {})
const instance = new (Element `foo-bar`)
assert_equals (instance.localName, 'foo-bar')
assert_equals (instance.nodeName, 'Foo Bar')
}, 'HTMLElement constructor must infer the tag name from the element interface')
test (() => {
Element `foo-bar` (class CustomElementWithInferredTagName extends HTMLElement {})
}, 'HTMLElement constructor must allow subclassing a custom element')
test (() => {
Element `foo-bar` (class CustomElementWithInferredTagName extends HTMLElement {})
}, 'HTMLElement constructor must allow subclassing an user-defined subclass of HTMLElement')
*/
</script>