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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
use crate::{
html::{
attribute::{Attr, *},
element::{ElementType, HtmlElement},
},
renderer::Rndr,
view::{add_attr::AddAnyAttr, RenderHtml},
};
/// Applies ARIA attributes to an HTML element.
pub trait AriaAttributes<Rndr, V>
where
Self: Sized + AddAnyAttr,
V: AttributeValue,
{
/// Identifies the currently active descendant of a composite widget.
fn aria_activedescendant(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaActivedescendant, V>> {
self.add_any_attr(aria_activedescendant(value))
}
/// Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the `aria-relevant` attribute.
fn aria_atomic(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaAtomic, V>> {
self.add_any_attr(aria_atomic(value))
}
/// Indicates whether user input completion suggestions are provided.
fn aria_autocomplete(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaAutocomplete, V>> {
self.add_any_attr(aria_autocomplete(value))
}
/// Indicates whether an element, and its subtree, are currently being updated.
fn aria_busy(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaBusy, V>> {
self.add_any_attr(aria_busy(value))
}
/// Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
fn aria_checked(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaChecked, V>> {
self.add_any_attr(aria_checked(value))
}
/// Defines the number of columns in a table, grid, or treegrid.
fn aria_colcount(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaColcount, V>> {
self.add_any_attr(aria_colcount(value))
}
/// Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
fn aria_colindex(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaColindex, V>> {
self.add_any_attr(aria_colindex(value))
}
/// Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
fn aria_colspan(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaColspan, V>> {
self.add_any_attr(aria_colspan(value))
}
/// Identifies the element (or elements) whose contents or presence are controlled by the current element.
fn aria_controls(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaControls, V>> {
self.add_any_attr(aria_controls(value))
}
/// Indicates the element that represents the current item within a container or set of related elements.
fn aria_current(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaCurrent, V>> {
self.add_any_attr(aria_current(value))
}
/// Identifies the element (or elements) that describes the object.
fn aria_describedby(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaDescribedby, V>> {
self.add_any_attr(aria_describedby(value))
}
/// Defines a string value that describes or annotates the current element.
fn aria_description(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaDescription, V>> {
self.add_any_attr(aria_description(value))
}
/// Identifies the element that provides additional information related to the object.
fn aria_details(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaDetails, V>> {
self.add_any_attr(aria_details(value))
}
/// Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
fn aria_disabled(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaDisabled, V>> {
self.add_any_attr(aria_disabled(value))
}
/// Indicates what functions can be performed when a dragged object is released on the drop target.
fn aria_dropeffect(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaDropeffect, V>> {
self.add_any_attr(aria_dropeffect(value))
}
/// Defines the element that provides an error message related to the object.
fn aria_errormessage(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaErrormessage, V>> {
self.add_any_attr(aria_errormessage(value))
}
/// Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
fn aria_expanded(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaExpanded, V>> {
self.add_any_attr(aria_expanded(value))
}
/// Identifies the next element (or elements) in an alternate reading order of content.
fn aria_flowto(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaFlowto, V>> {
self.add_any_attr(aria_flowto(value))
}
/// Indicates an element's "grabbed" state in a drag-and-drop operation.
fn aria_grabbed(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaGrabbed, V>> {
self.add_any_attr(aria_grabbed(value))
}
/// Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.
fn aria_haspopup(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaHaspopup, V>> {
self.add_any_attr(aria_haspopup(value))
}
/// Indicates whether the element is exposed to an accessibility API.
fn aria_hidden(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaHidden, V>> {
self.add_any_attr(aria_hidden(value))
}
/// Indicates the entered value does not conform to the format expected by the application.
fn aria_invalid(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaInvalid, V>> {
self.add_any_attr(aria_invalid(value))
}
/// Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.
fn aria_keyshortcuts(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaKeyshortcuts, V>> {
self.add_any_attr(aria_keyshortcuts(value))
}
/// Defines a string value that labels the current element.
fn aria_label(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaLabel, V>> {
self.add_any_attr(aria_label(value))
}
/// Identifies the element (or elements) that labels the current element.
fn aria_labelledby(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaLabelledby, V>> {
self.add_any_attr(aria_labelledby(value))
}
/// Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.
fn aria_live(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaLive, V>> {
self.add_any_attr(aria_live(value))
}
/// Indicates whether an element is modal when displayed.
fn aria_modal(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaModal, V>> {
self.add_any_attr(aria_modal(value))
}
/// Indicates whether a text box accepts multiple lines of input or only a single line.
fn aria_multiline(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaMultiline, V>> {
self.add_any_attr(aria_multiline(value))
}
/// Indicates that the user may select more than one item from the current selectable descendants.
fn aria_multiselectable(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaMultiselectable, V>> {
self.add_any_attr(aria_multiselectable(value))
}
/// Indicates whether the element's orientation is horizontal, vertical, or undefined.
fn aria_orientation(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaOrientation, V>> {
self.add_any_attr(aria_orientation(value))
}
/// Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
fn aria_owns(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaOwns, V>> {
self.add_any_attr(aria_owns(value))
}
/// Defines a short hint (a word or short phrase) intended to help the user with data entry when the control has no value.
fn aria_placeholder(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaPlaceholder, V>> {
self.add_any_attr(aria_placeholder(value))
}
/// Defines an element's number or position in the current set of listitems or treeitems.
fn aria_posinset(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaPosinset, V>> {
self.add_any_attr(aria_posinset(value))
}
/// Indicates the current "pressed" state of toggle buttons.
fn aria_pressed(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaPressed, V>> {
self.add_any_attr(aria_pressed(value))
}
/// Indicates that the element is not editable, but is otherwise operable.
fn aria_readonly(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaReadonly, V>> {
self.add_any_attr(aria_readonly(value))
}
/// Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
fn aria_relevant(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaRelevant, V>> {
self.add_any_attr(aria_relevant(value))
}
/// Indicates that user input is required on the element before a form may be submitted.
fn aria_required(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaRequired, V>> {
self.add_any_attr(aria_required(value))
}
/// Defines a human-readable, author-localized description for the role of an element.
fn aria_roledescription(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaRoledescription, V>> {
self.add_any_attr(aria_roledescription(value))
}
/// Defines the total number of rows in a table, grid, or treegrid.
fn aria_rowcount(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaRowcount, V>> {
self.add_any_attr(aria_rowcount(value))
}
/// Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
fn aria_rowindex(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaRowindex, V>> {
self.add_any_attr(aria_rowindex(value))
}
/// Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
fn aria_rowspan(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaRowspan, V>> {
self.add_any_attr(aria_rowspan(value))
}
/// Indicates the current "selected" state of various widgets.
fn aria_selected(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaSelected, V>> {
self.add_any_attr(aria_selected(value))
}
/// Defines the number of items in the current set of listitems or treeitems.
fn aria_setsize(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaSetsize, V>> {
self.add_any_attr(aria_setsize(value))
}
/// Indicates if items in a table or grid are sorted in ascending or descending order.
fn aria_sort(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaSort, V>> {
self.add_any_attr(aria_sort(value))
}
/// Defines the maximum allowed value for a range widget.
fn aria_valuemax(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaValuemax, V>> {
self.add_any_attr(aria_valuemax(value))
}
/// Defines the minimum allowed value for a range widget.
fn aria_valuemin(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaValuemin, V>> {
self.add_any_attr(aria_valuemin(value))
}
/// Defines the current value for a range widget.
fn aria_valuenow(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaValuenow, V>> {
self.add_any_attr(aria_valuenow(value))
}
/// Defines the human-readable text alternative of `aria-valuenow` for a range widget.
fn aria_valuetext(
self,
value: V,
) -> <Self as AddAnyAttr>::Output<Attr<AriaValuetext, V>> {
self.add_any_attr(aria_valuetext(value))
}
}
impl<El, At, Ch, V> AriaAttributes<Rndr, V> for HtmlElement<El, At, Ch>
where
El: ElementType + Send,
At: Attribute + Send,
Ch: RenderHtml + Send,
V: AttributeValue,
{
}