hypertext/validation/
attributes.rs1#![allow(non_upper_case_globals)]
27#[cfg(feature = "mathml")]
28pub use super::mathml::MathMlGlobalAttributes;
29use crate::validation::{Attribute, Element};
30#[allow(unused_imports)]
31use crate::validation::{AttributeNamespace, AttributeSymbol};
32
33pub trait GlobalAttributes: Element {
68 const access_key: Attribute = Attribute;
71
72 const autocapitalize: Attribute = Attribute;
75
76 const autofocus: Attribute = Attribute;
79
80 #[doc(alias = ".")]
82 const class: Attribute = Attribute;
83
84 const contenteditable: Attribute = Attribute;
86
87 const dir: Attribute = Attribute;
89
90 const draggable: Attribute = Attribute;
92
93 const enterkeyhint: Attribute = Attribute;
95
96 const hidden: Attribute = Attribute;
98
99 #[doc(alias = "#")]
101 const id: Attribute = Attribute;
102
103 const inert: Attribute = Attribute;
105
106 const inputmode: Attribute = Attribute;
109
110 const is: Attribute = Attribute;
112
113 const itemid: Attribute = Attribute;
115
116 const itemprop: Attribute = Attribute;
118
119 const itemref: Attribute = Attribute;
122
123 const itemscope: Attribute = Attribute;
125
126 const itemtype: Attribute = Attribute;
128
129 const lang: Attribute = Attribute;
131
132 const nonce: Attribute = Attribute;
136
137 const popover: Attribute = Attribute;
141
142 const slot: Attribute = Attribute;
144
145 const spellcheck: Attribute = Attribute;
147
148 const style: Attribute = Attribute;
150
151 const tabindex: Attribute = Attribute;
153
154 const title: Attribute = Attribute;
156
157 const translate: Attribute = Attribute;
159}
160
161#[expect(missing_docs)]
163pub trait AriaAttributes: GlobalAttributes {
164 const role: Attribute = Attribute;
165 const aria_activedescendant: Attribute = Attribute;
166 const aria_atomic: Attribute = Attribute;
167 const aria_autocomplete: Attribute = Attribute;
168 const aria_braillelabel: Attribute = Attribute;
169 const aria_brailleroledescription: Attribute = Attribute;
170 const aria_busy: Attribute = Attribute;
171 const aria_checked: Attribute = Attribute;
172 const aria_colcount: Attribute = Attribute;
173 const aria_colindex: Attribute = Attribute;
174 const aria_colindextext: Attribute = Attribute;
175 const aria_colspan: Attribute = Attribute;
176 const aria_controls: Attribute = Attribute;
177 const aria_current: Attribute = Attribute;
178 const aria_describedby: Attribute = Attribute;
179 const aria_description: Attribute = Attribute;
180 const aria_details: Attribute = Attribute;
181 const aria_disabled: Attribute = Attribute;
182 const aria_dropeffect: Attribute = Attribute;
183 const aria_errormessage: Attribute = Attribute;
184 const aria_expanded: Attribute = Attribute;
185 const aria_flowto: Attribute = Attribute;
186 const aria_grabbed: Attribute = Attribute;
187 const aria_haspopup: Attribute = Attribute;
188 const aria_hidden: Attribute = Attribute;
189 const aria_invalid: Attribute = Attribute;
190 const aria_keyshortcuts: Attribute = Attribute;
191 const aria_label: Attribute = Attribute;
192 const aria_labelledby: Attribute = Attribute;
193 const aria_level: Attribute = Attribute;
194 const aria_live: Attribute = Attribute;
195 const aria_modal: Attribute = Attribute;
196 const aria_multiline: Attribute = Attribute;
197 const aria_multiselectable: Attribute = Attribute;
198 const aria_orientation: Attribute = Attribute;
199 const aria_owns: Attribute = Attribute;
200 const aria_placeholder: Attribute = Attribute;
201 const aria_posinset: Attribute = Attribute;
202 const aria_pressed: Attribute = Attribute;
203 const aria_readonly: Attribute = Attribute;
204 const aria_relevant: Attribute = Attribute;
205 const aria_required: Attribute = Attribute;
206 const aria_roledescription: Attribute = Attribute;
207 const aria_rowcount: Attribute = Attribute;
208 const aria_rowindex: Attribute = Attribute;
209 const aria_rowindextext: Attribute = Attribute;
210 const aria_rowspan: Attribute = Attribute;
211 const aria_selected: Attribute = Attribute;
212 const aria_setsize: Attribute = Attribute;
213 const aria_sort: Attribute = Attribute;
214 const aria_valuemax: Attribute = Attribute;
215 const aria_valuemin: Attribute = Attribute;
216 const aria_valuenow: Attribute = Attribute;
217 const aria_valuetext: Attribute = Attribute;
218}
219
220impl<T: GlobalAttributes> AriaAttributes for T {}
221
222#[expect(missing_docs)]
224pub trait EventHandlerAttributes: GlobalAttributes {
225 const onabort: Attribute = Attribute;
226 const onautocomplete: Attribute = Attribute;
227 const onautocompleteerror: Attribute = Attribute;
228 const onblur: Attribute = Attribute;
229 const oncancel: Attribute = Attribute;
230 const oncanplay: Attribute = Attribute;
231 const oncanplaythrough: Attribute = Attribute;
232 const onchange: Attribute = Attribute;
233 const onclick: Attribute = Attribute;
234 const onclose: Attribute = Attribute;
235 const oncontextmenu: Attribute = Attribute;
236 const oncuechange: Attribute = Attribute;
237 const ondblclick: Attribute = Attribute;
238 const ondrag: Attribute = Attribute;
239 const ondragend: Attribute = Attribute;
240 const ondragenter: Attribute = Attribute;
241 const ondragleave: Attribute = Attribute;
242 const ondragover: Attribute = Attribute;
243 const ondragstart: Attribute = Attribute;
244 const ondrop: Attribute = Attribute;
245 const ondurationchange: Attribute = Attribute;
246 const onemptied: Attribute = Attribute;
247 const onended: Attribute = Attribute;
248 const onerror: Attribute = Attribute;
249 const onfocus: Attribute = Attribute;
250 const oninput: Attribute = Attribute;
251 const oninvalid: Attribute = Attribute;
252 const onkeydown: Attribute = Attribute;
253 const onkeypress: Attribute = Attribute;
254 const onkeyup: Attribute = Attribute;
255 const onload: Attribute = Attribute;
256 const onloadeddata: Attribute = Attribute;
257 const onloadedmetadata: Attribute = Attribute;
258 const onloadstart: Attribute = Attribute;
259 const onmousedown: Attribute = Attribute;
260 const onmouseenter: Attribute = Attribute;
261 const onmouseleave: Attribute = Attribute;
262 const onmousemove: Attribute = Attribute;
263 const onmouseout: Attribute = Attribute;
264 const onmouseover: Attribute = Attribute;
265 const onmouseup: Attribute = Attribute;
266 const onmousewheel: Attribute = Attribute;
267 const onpause: Attribute = Attribute;
268 const onplay: Attribute = Attribute;
269 const onplaying: Attribute = Attribute;
270 const onprogress: Attribute = Attribute;
271 const onratechange: Attribute = Attribute;
272 const onreset: Attribute = Attribute;
273 const onresize: Attribute = Attribute;
274 const onscroll: Attribute = Attribute;
275 const onseeked: Attribute = Attribute;
276 const onseeking: Attribute = Attribute;
277 const onselect: Attribute = Attribute;
278 const onshow: Attribute = Attribute;
279 const onsort: Attribute = Attribute;
280 const onstalled: Attribute = Attribute;
281 const onsubmit: Attribute = Attribute;
282 const onsuspend: Attribute = Attribute;
283 const ontimeupdate: Attribute = Attribute;
284 const ontoggle: Attribute = Attribute;
285 const onvolumechange: Attribute = Attribute;
286 const onwaiting: Attribute = Attribute;
287}
288
289impl<T: GlobalAttributes> EventHandlerAttributes for T {}
290
291#[cfg(feature = "htmx")]
293pub trait HtmxAttributes: GlobalAttributes {
294 const hx_get: Attribute = Attribute;
296
297 const hx_post: Attribute = Attribute;
299
300 const hx_on: AttributeNamespace = AttributeNamespace;
302
303 const hx_push_url: Attribute = Attribute;
305
306 const hx_select: Attribute = Attribute;
308
309 const hx_select_oob: Attribute = Attribute;
312
313 const hx_swap: Attribute = Attribute;
316
317 const hx_swap_oob: Attribute = Attribute;
319
320 const hx_target: Attribute = Attribute;
322
323 const hx_trigger: Attribute = Attribute;
325
326 const hx_vals: Attribute = Attribute;
328
329 const hx_boost: Attribute = Attribute;
331
332 const hx_confirm: Attribute = Attribute;
334
335 const hx_delete: Attribute = Attribute;
337 const hx_disable: Attribute = Attribute;
339
340 const hx_disabled_elt: Attribute = Attribute;
343
344 const hx_disinherit: Attribute = Attribute;
346
347 const hx_encoding: Attribute = Attribute;
349
350 const hx_ext: Attribute = Attribute;
352 const hx_headers: Attribute = Attribute;
354
355 const hx_history: Attribute = Attribute;
357
358 const hx_history_elt: Attribute = Attribute;
360
361 const hx_include: Attribute = Attribute;
363
364 const hx_indicator: Attribute = Attribute;
366 const hx_inherit: Attribute = Attribute;
369
370 const hx_params: Attribute = Attribute;
372
373 const hx_patch: Attribute = Attribute;
375
376 const hx_preserve: Attribute = Attribute;
378
379 const hx_prompt: Attribute = Attribute;
381
382 const hx_put: Attribute = Attribute;
384
385 const hx_replace_url: Attribute = Attribute;
387
388 const hx_request: Attribute = Attribute;
390
391 const hx_sync: Attribute = Attribute;
393
394 const hx_validate: Attribute = Attribute;
396
397 #[deprecated = "use `hx-vals` instead"]
400 const hx_vars: Attribute = Attribute;
401}
402
403#[cfg(feature = "htmx")]
404impl<T: GlobalAttributes> HtmxAttributes for T {}
405
406#[cfg(feature = "hyperscript")]
407pub trait HyperscriptAttributes: GlobalAttributes {
409 const __: Attribute = Attribute;
411}
412
413#[cfg(feature = "hyperscript")]
414impl<T: GlobalAttributes> HyperscriptAttributes for T {}
415
416#[cfg(feature = "alpine")]
418pub trait AlpineJsAttributes: GlobalAttributes {
419 const x_data: Attribute = Attribute;
421
422 const x_bind: AttributeNamespace = AttributeNamespace;
424
425 #[doc(alias = ":")]
429 const _colon: AttributeSymbol = AttributeSymbol;
430
431 const x_on: AttributeNamespace = AttributeNamespace;
433
434 #[doc(alias = "@")]
438 const _at: AttributeSymbol = AttributeSymbol;
439
440 const x_text: Attribute = Attribute;
442
443 const x_html: Attribute = Attribute;
445
446 const x_model: Attribute = Attribute;
448
449 const x_show: Attribute = Attribute;
451
452 const x_transition: Attribute = Attribute;
454
455 const x_for: Attribute = Attribute;
457
458 const x_if: Attribute = Attribute;
460
461 const x_init: Attribute = Attribute;
463
464 const x_effect: Attribute = Attribute;
467
468 const x_ref: Attribute = Attribute;
471
472 const x_cloak: Attribute = Attribute;
475
476 const x_ignore: Attribute = Attribute;
478}
479
480#[cfg(feature = "alpine")]
481impl<T: GlobalAttributes> AlpineJsAttributes for T {}