-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
120 lines (85 loc) · 2.86 KB
/
test.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
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
118
119
120
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>lazyfill TEST</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="./mod.js" xtype=module></script>
<script src="./htmlfills.js" type=module></script>
<link rel=stylesheet href="https://cdn.jsdelivr.net/gh/u1ui/norm.css/norm.css">
</head>
<body>
<script style="display:block; white-space: pre-wrap; background:#eee; margin:1rem; padding:1rem;" type=module>
const body = document.body;
body.innerHTML += 'no polyfill loaded so far.<br>';
setTimeout(function(){
body.innerHTML += "executing ['x','y','z'].at(-1) loads the polyfill<br>";
var item = ['x','y','z'].at(-1);
body.innerHTML += "result: "+item;
const korean = new Intl.Locale('ko', {
script: 'Kore', region: 'KR', hourCycle: 'h24', calendar: 'gregory'
});
const japanese = new Intl.Locale('ja-Jpan-JP-u-ca-japanese-hc-h12');
console.log(korean.baseName, japanese.baseName);
// expected output: "ko-Kore-KR" "ja-Jpan-JP"
console.log(korean.hourCycle, japanese.hourCycle);
// expected output: "h24" "h12"
}, 1000);
/* is connected tests */
const div = document.createElement('div');
console.log(div.isConnected);
document.body.appendChild(div)
console.log(div.isConnected);
console.log('abacad'.replaceAll(/(a)/g, 'x$x'));
console.log('abacad'.replaceAll('a','x'));
console.log(crypto.randomUUID());
console.log('URLPattern:');
const pattern = new URLPattern('http{s}?://*.example.com/books/:id');
console.log(pattern.test('https://store.example.com/books/123') === true);
console.log(pattern.test('https://example.com/books/123') === false);
cookieStore.set('test', 'xyz');
cookieStore.get('test').then(console.log);
/*
Set methods
let S12 = new Set(['1','2']);
let S23 = new Set(['2','3']);
console.log(S12.difference(S23))
*/
var inputValue = `<p>hi! <svg/onload="alert(1)" />well <em>please</em> <a href="javascript:alert(2)" title="pretty-please">click me!</a>`;
var contextEl = document.createElement('div');
contextEl.setHTML(inputValue, { sanitizer: new Sanitizer() });
console.log(contextEl.innerHTML)
console.log([1,2,3].toReversed());
</script>
<button onclick="dialogDemo.showModal()">showModal</button><br>
<dialog id=dialogDemo>
Hello World
</dialog>
<button onclick="dialogDemo2.showModal()">showModal</button><br>
<dialog id=dialogDemo2>
Hello demo
</dialog>
<div inert>
<h2>inert</h2>
<label>
text selectable?
<input value="focusable?">
</label>
</div>
<div focusgroup>
<h2>focusgroup</h2>
<label>
arrow navigatable?
<input type="checkbox">
<input type="checkbox">
</label>
</div>
<search style="border:1px solid blue">
inside search element.
It sould be block and have a role=search
<label>
Input
<input>
</label>
</search>
<button onclick="navigator.share({title:'title',text:'text',url:location.href})">share</button>