blob: eb600548e21a1bfaae1484cd25775f1a4948afa5 (
plain)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Inspector (empty page)</title>
<script>
"use strict";
window.onload = function() {
customElements.define("test-empty", class extends HTMLElement {
constructor() {
super();
this.attachShadow({mode: "open"});
}
});
customElements.define("test-empty-closed", class extends HTMLElement {
constructor() {
super();
this.attachShadow({mode: "closed"});
}
});
customElements.define("test-children", class extends HTMLElement {
constructor() {
super();
this.attachShadow({mode: "open"});
this.shadowRoot.innerHTML = `
<h1>One child</h1>
<p>A second child</p>`;
}
});
customElements.define("test-named-slot", class extends HTMLElement {
constructor() {
super();
this.attachShadow({mode: "open"});
this.shadowRoot.innerHTML = `
<h1>With slot</h1>
<slot name="slot1"></slot>`;
}
});
customElements.define("test-slot", class extends HTMLElement {
constructor() {
super();
this.attachShadow({mode: "open"});
this.shadowRoot.innerHTML = `
<style>
slot::before { content: "[SLOT BEFORE]"; color: red; }
slot::after { content: "[SLOT AFTER]"; color: blue; }
</style>
<slot></slot>`;
}
});
customElements.define("test-simple-slot", class extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: "open"});
this.shadowRoot.innerHTML = "<slot></slot>";
}
});
};
</script>
<style>
#host-pseudo::before { content: "[HOST BEFORE]"; color: red; }
#host-pseudo::after { content: "[HOST AFTER]"; color: blue; }
</style>
</head>
<body>
<test-empty id="empty"></test-empty>
<hr>
<test-empty id="one-child">
<h1>One child</h1>
</test-empty>
<hr>
<test-children id="shadow-children"></test-children>
<hr>
<test-named-slot id="named-slot">
<p class="slotted" slot="slot1">Slotted</p>
</test-named-slot>
<hr>
<test-slot id="slot-pseudo">
<span class="has-before">Slotted</span>
</test-slot>
<hr>
<test-empty id="host-pseudo"></test-empty>
<hr>
<test-empty id="mode-open"></test-empty>
<test-empty-closed id="mode-closed"></test-empty-closed>
<hr>
<test-simple-slot id="slot-inline-text">
Lorem ipsum
</test-simple-slot>
<hr>
<video id="video-controls" controls></video>
<video id="video-controls-with-children" controls>
<div>some content</div>
</video>
</body>
</html>
|