forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscoped-custom-element-registry-customelementregistry-attribute-in-xhtml.xhtml
More file actions
45 lines (38 loc) · 1.8 KB
/
Copy pathscoped-custom-element-registry-customelementregistry-attribute-in-xhtml.xhtml
File metadata and controls
45 lines (38 loc) · 1.8 KB
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
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
<link rel="help" href="https://html.spec.whatwg.org/multipage/custom-elements.html#dom-customelementregistry-initialize"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
<![CDATA[
customElements.define('c-d', class ABElement extends HTMLElement { });
]]>
</script>
<div id="container"><a-b customelementregistry=""></a-b><c-d customelementregistry=""></c-d></div>
<script>
<![CDATA[
const container = document.getElementById('container');
test((test) => {
assert_equals(container.querySelector('a-b').customElementRegistry, null);
}, `XHTML parser should create a custom element candidate with null registry if customelementregistry is set`);
test((test) => {
assert_equals(container.querySelector('c-d').customElementRegistry, null);
}, `XHTML parser should create a defined custom element with null registry if customelementregistry is set`);
test((test) => {
container.setHTMLUnsafe(`<a-b customelementregistry></a-b>`);
assert_equals(container.querySelector('a-b').customElementRegistry, null);
}, `XHTML fragment parser should create a custom element candidate with null registry if customelementregistry is set`);
test((test) => {
container.setHTMLUnsafe(`<c-d></c-d>`);
assert_equals(container.querySelector('c-d').customElementRegistry, window.customElements);
container.setHTMLUnsafe(`<c-d customelementregistry></c-d>`);
assert_equals(container.querySelector('c-d').customElementRegistry, null);
}, `XHTML fragment parser should create a defined custom element with null registry if customelementregistry is set`);
]]>
</script>
</body>
</html>