Skip to content

Commit 70c89e8

Browse files
committed
Bug 1570552 [wpt PR 18223] - Add ARIA role, state and properties to ElementInternals, a=testonly
Automatic update from web-platform-tests Add ARIA role, state and properties to ElementInternals Adds a way to set default ARIA role, state & properties for custom elements through ElementInternals. These can be overridden with setting the ARIA attributes on the element directly. See whatwg/html#4658 for spec PR. Explainer: https://github.com/alice/aom/blob/gh-pages/explainer.md#per-instance-dynamic-semantics-via-the-elementinternals-object Intent to Implement: https://groups.google.com/a/chromium.org/d/msg/blink-dev/b-cGz9c67pM/0zvBzjhrAAAJ Change-Id: I0caf6bc302445e48f4e0324513105eba3d6303a6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1709950 Commit-Queue: Rakina Zata Amni <rakinachromium.org> Reviewed-by: Alice Boxhall <aboxhallchromium.org> Reviewed-by: Kent Tamura <tkentchromium.org> Cr-Commit-Position: refs/heads/master{#685141} -- wpt-commits: 5c61f2493fe744dc9f3d08e1f5a80165f574cfa3 wpt-pr: 18223 UltraBlame original commit: a95eec38bb25d830da2c2414356d5904c8e99d6d
1 parent 74a6a21 commit 70c89e8

File tree

1 file changed

+322
-0
lines changed

1 file changed

+322
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,322 @@
1+
<
2+
!
3+
DOCTYPE
4+
HTML
5+
>
6+
<
7+
script
8+
src
9+
=
10+
"
11+
/
12+
resources
13+
/
14+
testharness
15+
.
16+
js
17+
"
18+
>
19+
<
20+
/
21+
script
22+
>
23+
<
24+
script
25+
src
26+
=
27+
"
28+
/
29+
resources
30+
/
31+
testharnessreport
32+
.
33+
js
34+
"
35+
>
36+
<
37+
/
38+
script
39+
>
40+
<
41+
script
42+
>
43+
class
44+
TestElement
45+
extends
46+
HTMLElement
47+
{
48+
constructor
49+
(
50+
)
51+
{
52+
super
53+
(
54+
)
55+
;
56+
this
57+
.
58+
_internals
59+
=
60+
this
61+
.
62+
attachInternals
63+
(
64+
)
65+
;
66+
}
67+
get
68+
internals
69+
(
70+
)
71+
{
72+
return
73+
this
74+
.
75+
_internals
76+
;
77+
}
78+
set
79+
internals
80+
(
81+
val
82+
)
83+
{
84+
throw
85+
"
86+
Can
87+
'
88+
t
89+
set
90+
internals
91+
!
92+
"
93+
;
94+
}
95+
}
96+
customElements
97+
.
98+
define
99+
(
100+
"
101+
test
102+
-
103+
element
104+
"
105+
TestElement
106+
)
107+
;
108+
<
109+
/
110+
script
111+
>
112+
<
113+
test
114+
-
115+
element
116+
id
117+
=
118+
"
119+
testElement
120+
"
121+
>
122+
<
123+
/
124+
test
125+
-
126+
element
127+
>
128+
<
129+
script
130+
>
131+
const
132+
element
133+
=
134+
document
135+
.
136+
getElementById
137+
(
138+
"
139+
testElement
140+
"
141+
)
142+
;
143+
const
144+
properties
145+
=
146+
[
147+
"
148+
role
149+
"
150+
"
151+
ariaActiveDescendant
152+
"
153+
"
154+
ariaAtomic
155+
"
156+
"
157+
ariaAutoComplete
158+
"
159+
"
160+
ariaBusy
161+
"
162+
"
163+
ariaChecked
164+
"
165+
"
166+
ariaColCount
167+
"
168+
"
169+
ariaColIndex
170+
"
171+
"
172+
ariaColSpan
173+
"
174+
"
175+
ariaControls
176+
"
177+
"
178+
ariaCurrent
179+
"
180+
"
181+
ariaDescribedBy
182+
"
183+
"
184+
ariaDetails
185+
"
186+
"
187+
ariaDisabled
188+
"
189+
"
190+
ariaErrorMessage
191+
"
192+
"
193+
ariaExpanded
194+
"
195+
"
196+
ariaFlowTo
197+
"
198+
"
199+
ariaHasPopup
200+
"
201+
"
202+
ariaHidden
203+
"
204+
"
205+
ariaKeyShortcuts
206+
"
207+
"
208+
ariaLabel
209+
"
210+
"
211+
ariaLabelledBy
212+
"
213+
"
214+
ariaLevel
215+
"
216+
"
217+
ariaLive
218+
"
219+
"
220+
ariaModal
221+
"
222+
"
223+
ariaMultiLine
224+
"
225+
"
226+
ariaMultiSelectable
227+
"
228+
"
229+
ariaOrientation
230+
"
231+
"
232+
ariaOwns
233+
"
234+
"
235+
ariaPlaceholder
236+
"
237+
"
238+
ariaPosInSet
239+
"
240+
"
241+
ariaPressed
242+
"
243+
"
244+
ariaReadOnly
245+
"
246+
"
247+
ariaRelevant
248+
"
249+
"
250+
ariaRequired
251+
"
252+
"
253+
ariaRoleDescription
254+
"
255+
"
256+
ariaRowCount
257+
"
258+
"
259+
ariaRowIndex
260+
"
261+
"
262+
ariaRowSpan
263+
"
264+
"
265+
ariaSelected
266+
"
267+
"
268+
ariaSort
269+
"
270+
"
271+
ariaValueMax
272+
"
273+
"
274+
ariaValueMin
275+
"
276+
"
277+
ariaValueNow
278+
"
279+
"
280+
ariaValueText
281+
"
282+
]
283+
;
284+
for
285+
(
286+
const
287+
property
288+
of
289+
properties
290+
)
291+
{
292+
test
293+
(
294+
(
295+
)
296+
=
297+
>
298+
{
299+
assert_inherits
300+
(
301+
element
302+
.
303+
internals
304+
property
305+
)
306+
;
307+
}
308+
property
309+
+
310+
"
311+
is
312+
defined
313+
in
314+
ElementInternals
315+
"
316+
)
317+
;
318+
}
319+
<
320+
/
321+
script
322+
>

0 commit comments

Comments
 (0)