Skip to content

Commit 193fdda

Browse files
mfreed7chromium-wpt-export-bot
authored andcommitted
Add shadowRootDelegatesFocus and shadowRootClonable reflection
The former was missed a while ago, and the latter is new as of this spec PR: whatwg/html#10069 Bug: 1510466 Change-Id: I708ec8d562fa4d0fc59c73a071dbb191e1bd276e
1 parent 64b75a9 commit 193fdda

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

shadow-dom/declarative/declarative-shadow-dom-basic.html

+43
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,49 @@
5454
t.getAttribute('shadowrootmode', 'CLOSED');
5555
}, 'Shadowrootmode reflection, setter');
5656

57+
test(() => {
58+
const t = document.createElement('template');
59+
t.setAttribute('shadowrootdelegatesfocus','');
60+
assert_equals(t.shadowRootDelegatesFocus,true,'The shadowRootDelegatesFocus IDL should reflect the content attribute');
61+
t.setAttribute('shadowrootdelegatesfocus','foobar');
62+
assert_equals(t.shadowRootDelegatesFocus,true,'The value doesn\'t matter');
63+
t.removeAttribute('shadowrootdelegatesfocus');
64+
assert_equals(t.shadowRootDelegatesFocus,false,'No shadowRootDelegatesFocus attribute maps to false');
65+
}, 'Shadowrootdelegatesfocus reflection');
66+
67+
test(() => {
68+
const t = document.createElement('template');
69+
assert_equals(t.getAttribute('shadowrootdelegatesfocus'), null);
70+
t.shadowRootDelegatesFocus = true;
71+
assert_equals(t.getAttribute('shadowrootdelegatesfocus'), '');
72+
assert_equals(t.shadowRootDelegatesFocus, true);
73+
t.shadowRootDelegatesFocus = false;
74+
assert_equals(t.getAttribute('shadowrootdelegatesfocus'), null);
75+
assert_equals(t.shadowRootDelegatesFocus, false);
76+
}, 'Shadowrootdelegatesfocus reflection, setter');
77+
78+
79+
test(() => {
80+
const t = document.createElement('template');
81+
t.setAttribute('shadowrootclonable','');
82+
assert_equals(t.shadowRootClonable,true,'The shadowRootClonable IDL should reflect the content attribute');
83+
t.setAttribute('shadowrootclonable','foobar');
84+
assert_equals(t.shadowRootClonable,true,'The value doesn\'t matter');
85+
t.removeAttribute('shadowrootclonable');
86+
assert_equals(t.shadowRootClonable,false,'No shadowRootClonable attribute maps to false');
87+
}, 'Shadowrootclonable reflection');
88+
89+
test(() => {
90+
const t = document.createElement('template');
91+
assert_equals(t.getAttribute('shadowrootclonable'), null);
92+
t.shadowRootClonable = true;
93+
assert_equals(t.getAttribute('shadowrootclonable'), '');
94+
assert_equals(t.shadowRootClonable, true);
95+
t.shadowRootClonable = false;
96+
assert_equals(t.getAttribute('shadowrootclonable'), null);
97+
assert_equals(t.shadowRootClonable, false);
98+
}, 'Shadowrootclonable reflection, setter');
99+
57100
test(() => {
58101
const div = document.createElement('div');
59102
div.setHTMLUnsafe(`

0 commit comments

Comments
 (0)