Skip to content

Commit f08d4a3

Browse files
authored
Add a test for scoped custom element registry API changes to unbreak Polymer's polyfill
1 parent 6618dc6 commit f08d4a3

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

custom-elements/revamped-scoped-registry/ShadowRoot-init-customElements.tentative.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535

3636
test(() => {
3737
const host = document.body.appendChild(document.createElement('div'));
38-
assert_throws_js(TypeError, () => host.attachShadow({mode: 'closed', customElements: null}));
39-
}, 'attachShadow() should throw for a null customElements value');
38+
host.attachShadow({mode: 'closed', customElements: null});
39+
}, 'attachShadow() should not throw for a null customElements value');
4040

4141
</script>
4242
</body>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta name="author" title="Ryosuke Niwa" href="mailto:[email protected]">
5+
<link rel="help" href="https://github.com/whatwg/html/issues/10854">
6+
<script src="/resources/testharness.js"></script>
7+
<script src="/resources/testharnessreport.js"></script>
8+
</head>
9+
<body>
10+
<script>
11+
12+
test(() => {
13+
document.createElement('div').attachShadow({mode: 'closed', customElements: { }});
14+
}, 'attachShadow should not throw an exception when an arbitrary type is passed to customElements');
15+
16+
test(() => {
17+
document.createElement('div').attachShadow({mode: 'closed'}).customElements = { };
18+
}, 'The setter of customElements IDL attribute should not throw an exception when assigned of an arbitrary type');
19+
20+
</script>
21+
</body>
22+
</html>

0 commit comments

Comments
 (0)