File: CustomElementRegistry-define.html

package info (click to toggle)
firefox 147.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,683,320 kB
  • sloc: cpp: 7,607,359; javascript: 6,533,295; ansic: 3,775,223; python: 1,415,500; xml: 634,561; asm: 438,949; java: 186,241; sh: 62,752; makefile: 18,079; objc: 13,092; perl: 12,808; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10; exp: 6
file content (30 lines) | stat: -rw-r--r-- 1,113 bytes parent folder | download | duplicates (12)
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
<!DOCTYPE html>
<html>
<head>
<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
<link rel="help" href="https://github.com/whatwg/html/issues/10854">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
test(() => {
    let registry = new CustomElementRegistry();
    assert_not_equals(registry, window.customElements);
}, 'Create a CustomElementRegistry not identically equal to window.customElements');

test(() => {
    let registry = new CustomElementRegistry();
    window.customElements.define('a-b', class extends HTMLElement {});
    assert_equals(registry.get('a-b'), undefined);
}, 'Defining an element in the global registry does not add a definition to a scoped CustomElementRegistry');

test(() => {
    let registry = new CustomElementRegistry();
    registry.define('b-c', class extends HTMLElement {});
    assert_equals(window.customElements.get('b-c'), undefined);
}, 'Defining an element in a scoped global registry does not add a definition to the global registry');

</script>
</body>
</html>