From 64bc2580ff2a8ccc9c56044455a13a1af3bc26b1 Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Sat, 13 Jul 2024 13:01:40 -0400 Subject: [PATCH] docs: add tachys docs --- tachys/src/dom.rs | 24 +- tachys/src/html/attribute/any_attribute.rs | 4 + tachys/src/html/attribute/aria.rs | 49 ++ tachys/src/html/attribute/custom.rs | 6 + tachys/src/html/attribute/global.rs | 45 ++ tachys/src/html/attribute/key.rs | 790 ++++++++++++++------- tachys/src/html/attribute/mod.rs | 33 + tachys/src/html/attribute/value.rs | 17 + tachys/src/html/class.rs | 22 + tachys/src/html/directive.rs | 12 +- tachys/src/html/element/custom.rs | 4 + tachys/src/html/element/element_ext.rs | 4 + tachys/src/html/element/inner_html.rs | 36 + tachys/src/html/element/mod.rs | 43 +- tachys/src/html/event.rs | 11 + tachys/src/html/islands.rs | 4 + tachys/src/html/mod.rs | 11 + tachys/src/html/node_ref.rs | 6 + tachys/src/html/property.rs | 11 + tachys/src/html/style.rs | 36 +- tachys/src/hydration.rs | 18 + tachys/src/lib.rs | 27 +- tachys/src/mathml/mod.rs | 4 + tachys/src/oco.rs | 1 + tachys/src/reactive_graph/mod.rs | 16 +- tachys/src/reactive_graph/node_ref.rs | 2 + tachys/src/reactive_graph/owned.rs | 2 + tachys/src/reactive_graph/suspense.rs | 21 +- tachys/src/renderer/dom.rs | 8 +- tachys/src/renderer/mock_dom.rs | 29 +- tachys/src/renderer/mod.rs | 8 +- tachys/src/renderer/sledgehammer.rs | 12 +- tachys/src/ssr/mod.rs | 29 +- tachys/src/svg/mod.rs | 2 + tachys/src/view/add_attr.rs | 3 + tachys/src/view/any_view.rs | 13 + tachys/src/view/either.rs | 7 + tachys/src/view/fragment.rs | 2 + tachys/src/view/iterators.rs | 2 + tachys/src/view/keyed.rs | 3 + tachys/src/view/mod.rs | 44 +- tachys/src/view/static_types.rs | 3 + tachys/src/view/strings.rs | 7 +- tachys/src/view/template.rs | 6 + 44 files changed, 1092 insertions(+), 345 deletions(-) diff --git a/tachys/src/dom.rs b/tachys/src/dom.rs index 3968f624d..bb8f2ae7b 100644 --- a/tachys/src/dom.rs +++ b/tachys/src/dom.rs @@ -1,6 +1,5 @@ -use once_cell::unsync::Lazy; use wasm_bindgen::JsCast; -use web_sys::{Document, HtmlElement, Node, Window}; +use web_sys::{Document, HtmlElement, Window}; thread_local! { pub(crate) static WINDOW: web_sys::Window = web_sys::window().unwrap(); @@ -20,27 +19,22 @@ pub fn window() -> Window { /// /// This is cached as a thread-local variable, so calling `document()` multiple times /// requires only one call out to JavaScript. +/// +/// ## Panics +/// Panics if called outside a browser environment. pub fn document() -> Document { DOCUMENT.with(Clone::clone) } +/// The `` element. +/// +/// ## Panics +/// Panics if there is no `` in the current document, or if it is called outside a browser +/// environment. pub fn body() -> HtmlElement { document().body().unwrap() } -pub fn comment() -> Node { - thread_local! { - static COMMENT: Lazy = Lazy::new(|| { - document().create_comment("").unchecked_into() - }); - } - COMMENT.with(|n| n.clone_node().unwrap()) -} - -pub fn log(s: &str) { - web_sys::console::log_1(&wasm_bindgen::JsValue::from_str(s)); -} - /// Helper function to extract [`Event.target`](https://developer.mozilla.org/en-US/docs/Web/API/Event/target) /// from any event. pub fn event_target(event: &web_sys::Event) -> T diff --git a/tachys/src/html/attribute/any_attribute.rs b/tachys/src/html/attribute/any_attribute.rs index 4bffb473f..df5e72ce3 100644 --- a/tachys/src/html/attribute/any_attribute.rs +++ b/tachys/src/html/attribute/any_attribute.rs @@ -8,6 +8,7 @@ use std::{ #[cfg(feature = "ssr")] use std::{future::Future, pin::Pin}; +/// A type-erased container for any [`Attribute`]. pub struct AnyAttribute { type_id: TypeId, html_len: usize, @@ -40,6 +41,7 @@ where } } +/// View state for [`AnyAttribute`]. pub struct AnyAttributeState where R: Renderer, @@ -50,10 +52,12 @@ where rndr: PhantomData, } +/// Converts an [`Attribute`] into [`AnyAttribute`]. pub trait IntoAnyAttribute where R: Renderer, { + /// Wraps the given attribute. fn into_any_attr(self) -> AnyAttribute; } diff --git a/tachys/src/html/attribute/aria.rs b/tachys/src/html/attribute/aria.rs index e12f5f89f..479397db4 100644 --- a/tachys/src/html/attribute/aria.rs +++ b/tachys/src/html/attribute/aria.rs @@ -3,12 +3,14 @@ use crate::{ view::add_attr::AddAnyAttr, }; +/// Applies ARIA attributes to an HTML element. pub trait AriaAttributes where Self: Sized + AddAnyAttr, V: AttributeValue, Rndr: Renderer, { + /// Identifies the currently active descendant of a composite widget. fn aria_activedescendant( self, value: V, @@ -17,6 +19,7 @@ where 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, @@ -24,6 +27,7 @@ where self.add_any_attr(aria_atomic(value)) } + /// Indicates whether user input completion suggestions are provided. fn aria_autocomplete( self, value: V, @@ -32,6 +36,7 @@ where self.add_any_attr(aria_autocomplete(value)) } + /// Indicates whether an element, and its subtree, are currently being updated. fn aria_busy( self, value: V, @@ -39,6 +44,7 @@ where 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, @@ -46,6 +52,7 @@ where self.add_any_attr(aria_checked(value)) } + /// Defines the number of columns in a table, grid, or treegrid. fn aria_colcount( self, value: V, @@ -53,6 +60,7 @@ where 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, @@ -60,6 +68,7 @@ where 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, @@ -67,6 +76,7 @@ where 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, @@ -74,6 +84,7 @@ where 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, @@ -81,6 +92,7 @@ where self.add_any_attr(aria_current(value)) } + /// Identifies the element (or elements) that describes the object. fn aria_describedby( self, value: V, @@ -89,6 +101,7 @@ where self.add_any_attr(aria_describedby(value)) } + /// Defines a string value that describes or annotates the current element. fn aria_description( self, value: V, @@ -97,6 +110,7 @@ where self.add_any_attr(aria_description(value)) } + /// Identifies the element that provides additional information related to the object. fn aria_details( self, value: V, @@ -104,6 +118,7 @@ where 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, @@ -111,6 +126,7 @@ where 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, @@ -118,6 +134,7 @@ where 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, @@ -126,6 +143,7 @@ where 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, @@ -133,6 +151,7 @@ where 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, @@ -140,6 +159,7 @@ where 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, @@ -147,6 +167,7 @@ where 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, @@ -154,6 +175,7 @@ where self.add_any_attr(aria_haspopup(value)) } + /// Indicates whether the element is exposed to an accessibility API. fn aria_hidden( self, value: V, @@ -161,6 +183,7 @@ where 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, @@ -168,6 +191,7 @@ where 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, @@ -176,6 +200,7 @@ where self.add_any_attr(aria_keyshortcuts(value)) } + /// Defines a string value that labels the current element. fn aria_label( self, value: V, @@ -183,6 +208,7 @@ where self.add_any_attr(aria_label(value)) } + /// Identifies the element (or elements) that labels the current element. fn aria_labelledby( self, value: V, @@ -190,6 +216,7 @@ where 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, @@ -197,6 +224,7 @@ where self.add_any_attr(aria_live(value)) } + /// Indicates whether an element is modal when displayed. fn aria_modal( self, value: V, @@ -204,6 +232,7 @@ where 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, @@ -211,6 +240,7 @@ where 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, @@ -219,6 +249,7 @@ where self.add_any_attr(aria_multiselectable(value)) } + /// Indicates whether the element's orientation is horizontal, vertical, or undefined. fn aria_orientation( self, value: V, @@ -227,6 +258,7 @@ where 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, @@ -234,6 +266,7 @@ where 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, @@ -242,6 +275,7 @@ where 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, @@ -249,6 +283,7 @@ where self.add_any_attr(aria_posinset(value)) } + /// Indicates the current "pressed" state of toggle buttons. fn aria_pressed( self, value: V, @@ -256,6 +291,7 @@ where self.add_any_attr(aria_pressed(value)) } + /// Indicates that the element is not editable, but is otherwise operable. fn aria_readonly( self, value: V, @@ -263,6 +299,7 @@ where 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, @@ -270,6 +307,7 @@ where 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, @@ -277,6 +315,7 @@ where 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, @@ -285,6 +324,7 @@ where 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, @@ -292,6 +332,7 @@ where 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, @@ -299,6 +340,7 @@ where 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, @@ -306,6 +348,7 @@ where self.add_any_attr(aria_rowspan(value)) } + /// Indicates the current "selected" state of various widgets. fn aria_selected( self, value: V, @@ -313,6 +356,7 @@ where 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, @@ -320,6 +364,7 @@ where 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, @@ -327,6 +372,7 @@ where self.add_any_attr(aria_sort(value)) } + /// Defines the maximum allowed value for a range widget. fn aria_valuemax( self, value: V, @@ -334,6 +380,7 @@ where self.add_any_attr(aria_valuemax(value)) } + /// Defines the minimum allowed value for a range widget. fn aria_valuemin( self, value: V, @@ -341,6 +388,7 @@ where self.add_any_attr(aria_valuemin(value)) } + /// Defines the current value for a range widget. fn aria_valuenow( self, value: V, @@ -348,6 +396,7 @@ where 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, diff --git a/tachys/src/html/attribute/custom.rs b/tachys/src/html/attribute/custom.rs index a7d61ba18..d681db20f 100644 --- a/tachys/src/html/attribute/custom.rs +++ b/tachys/src/html/attribute/custom.rs @@ -6,6 +6,7 @@ use crate::{ }; use std::{borrow::Cow, marker::PhantomData, sync::Arc}; +/// Adds a custom attribute with any key-value combintion. #[inline(always)] pub fn custom_attribute(key: K, value: V) -> CustomAttr where @@ -20,6 +21,7 @@ where } } +/// A custom attribute with any key-value combination. #[derive(Debug)] pub struct CustomAttr where @@ -154,7 +156,9 @@ where } // TODO this needs to be a method, not a const +/// Defines a custom attribute key. pub trait CustomAttributeKey: Clone + AsRef + Send + 'static { + /// The attribute name. const KEY: &'static str; } @@ -181,6 +185,7 @@ impl CustomAttributeKey const KEY: &'static str = K; } +/// Adds a custom attribute to an element. pub trait CustomAttribute where K: CustomAttributeKey, @@ -188,6 +193,7 @@ where Rndr: DomRenderer, Self: Sized + AddAnyAttr, { + /// Adds an HTML attribute by key and value. fn attr( self, key: K, diff --git a/tachys/src/html/attribute/global.rs b/tachys/src/html/attribute/global.rs index 5f99ca6e0..8dda5dccc 100644 --- a/tachys/src/html/attribute/global.rs +++ b/tachys/src/html/attribute/global.rs @@ -13,13 +13,16 @@ use crate::{ }; use core::convert::From; +/// Adds an attribute that modifies the `class`. pub trait ClassAttribute where C: IntoClass, Rndr: DomRenderer, { + /// The type of the element with the new attribute added. type Output; + /// Adds a CSS class to an element. fn class(self, value: C) -> Self::Output; } @@ -36,13 +39,16 @@ where } } +/// Adds an attribute that modifies the DOM properties. pub trait PropAttribute where P: IntoProperty, Rndr: DomRenderer, { + /// The type of the element with the new attribute added. type Output; + /// Adds a DOM property to an element. fn prop(self, key: K, value: P) -> Self::Output; } @@ -54,18 +60,22 @@ where Rndr: DomRenderer, { type Output = >::Output>; + fn prop(self, key: K, value: P) -> Self::Output { self.add_any_attr(prop(key, value)) } } +/// Adds an attribute that modifies the CSS styles. pub trait StyleAttribute where S: IntoStyle, Rndr: DomRenderer, { + /// The type of the element with the new attribute added. type Output; + /// Adds a CSS style to an element. fn style(self, value: S) -> Self::Output; } @@ -82,9 +92,12 @@ where } } +/// Adds an event listener to an element definition. pub trait OnAttribute { + /// The type of the element with the event listener added. type Output; + /// Adds an event listener to an element. fn on(self, event: E, cb: F) -> Self::Output; } @@ -104,9 +117,12 @@ where } } +/// Adds an event listener with a typed target to an element definition. pub trait OnTargetAttribute { + /// The type of the element with the new attribute added. type Output; + /// Adds an event listener with a typed target to an element definition. fn on_target(self, event: E, cb: F) -> Self::Output; } @@ -130,12 +146,14 @@ where } } +/// Global attributes can be added to any HTML element. pub trait GlobalAttributes where Self: Sized + AddAnyAttr, V: AttributeValue, Rndr: Renderer, { + /// The `accesskey` global attribute provides a hint for generating a keyboard shortcut for the current element. fn accesskey( self, value: V, @@ -143,6 +161,7 @@ where self.add_any_attr(accesskey(value)) } + /// The `autocapitalize` global attribute controls whether and how text input is automatically capitalized as it is entered/edited by the user. fn autocapitalize( self, value: V, @@ -150,6 +169,7 @@ where self.add_any_attr(autocapitalize(value)) } + /// The `autofocus` global attribute is a Boolean attribute indicating that an element should receive focus as soon as the page is loaded. fn autofocus( self, value: V, @@ -157,6 +177,7 @@ where self.add_any_attr(autofocus(value)) } + /// The `contenteditable` global attribute is an enumerated attribute indicating if the element should be editable by the user. fn contenteditable( self, value: V, @@ -165,6 +186,7 @@ where self.add_any_attr(contenteditable(value)) } + /// The `dir` global attribute is an enumerated attribute indicating the directionality of the element's text. fn dir( self, value: V, @@ -172,6 +194,7 @@ where self.add_any_attr(dir(value)) } + /// The `draggable` global attribute is an enumerated attribute indicating whether the element can be dragged. fn draggable( self, value: V, @@ -179,6 +202,7 @@ where self.add_any_attr(draggable(value)) } + /// The `enterkeyhint` global attribute is used to customize the enter key on virtual keyboards. fn enterkeyhint( self, value: V, @@ -186,6 +210,7 @@ where self.add_any_attr(enterkeyhint(value)) } + /// The `hidden` global attribute is a Boolean attribute indicating that the element is not yet, or is no longer, relevant. fn hidden( self, value: V, @@ -193,6 +218,7 @@ where self.add_any_attr(hidden(value)) } + /// The `id` global attribute defines a unique identifier (ID) which must be unique in the whole document. fn id( self, value: V, @@ -200,6 +226,7 @@ where self.add_any_attr(id(value)) } + /// The `inert` global attribute is a Boolean attribute that makes an element behave inertly. fn inert( self, value: V, @@ -207,6 +234,7 @@ where self.add_any_attr(inert(value)) } + /// The `inputmode` global attribute provides a hint to browsers for which virtual keyboard to display. fn inputmode( self, value: V, @@ -214,6 +242,7 @@ where self.add_any_attr(inputmode(value)) } + /// The `is` global attribute allows you to specify that a standard HTML element should behave like a custom built-in element. fn is( self, value: V, @@ -221,6 +250,7 @@ where self.add_any_attr(is(value)) } + /// The `itemid` global attribute is used to specify the unique, global identifier of an item. fn itemid( self, value: V, @@ -228,6 +258,7 @@ where self.add_any_attr(itemid(value)) } + /// The `itemprop` global attribute is used to add properties to an item. fn itemprop( self, value: V, @@ -235,6 +266,7 @@ where self.add_any_attr(itemprop(value)) } + /// The `itemref` global attribute is used to refer to other elements. fn itemref( self, value: V, @@ -242,6 +274,7 @@ where self.add_any_attr(itemref(value)) } + /// The `itemscope` global attribute is used to create a new item. fn itemscope( self, value: V, @@ -249,6 +282,7 @@ where self.add_any_attr(itemscope(value)) } + /// The `itemtype` global attribute is used to specify the types of items. fn itemtype( self, value: V, @@ -256,6 +290,7 @@ where self.add_any_attr(itemtype(value)) } + /// The `lang` global attribute helps define the language of an element. fn lang( self, value: V, @@ -263,6 +298,7 @@ where self.add_any_attr(lang(value)) } + /// The `nonce` global attribute is used to specify a cryptographic nonce. fn nonce( self, value: V, @@ -270,6 +306,7 @@ where self.add_any_attr(nonce(value)) } + /// The `part` global attribute identifies the element as a part of a component. fn part( self, value: V, @@ -277,6 +314,7 @@ where self.add_any_attr(part(value)) } + /// The `popover` global attribute defines the popover's behavior. fn popover( self, value: V, @@ -284,6 +322,7 @@ where self.add_any_attr(popover(value)) } + /// The `role` global attribute defines the role of an element in ARIA. fn role( self, value: V, @@ -291,6 +330,7 @@ where self.add_any_attr(role(value)) } + /// The `slot` global attribute assigns a slot in a shadow DOM. fn slot( self, value: V, @@ -298,6 +338,7 @@ where self.add_any_attr(slot(value)) } + /// The `spellcheck` global attribute is an enumerated attribute that defines whether the element may be checked for spelling errors. fn spellcheck( self, value: V, @@ -305,6 +346,7 @@ where self.add_any_attr(spellcheck(value)) } + /// The `tabindex` global attribute indicates if the element can take input focus. fn tabindex( self, value: V, @@ -312,6 +354,7 @@ where self.add_any_attr(tabindex(value)) } + /// The `title` global attribute contains text representing advisory information. fn title( self, value: V, @@ -319,6 +362,7 @@ where self.add_any_attr(title(value)) } + /// The `translate` global attribute is an enumerated attribute that specifies whether an element's attribute values and text content should be translated when the page is localized. fn translate( self, value: V, @@ -326,6 +370,7 @@ where self.add_any_attr(translate(value)) } + /// The `virtualkeyboardpolicy` global attribute specifies the behavior of the virtual keyboard. fn virtualkeyboardpolicy( self, value: V, diff --git a/tachys/src/html/attribute/key.rs b/tachys/src/html/attribute/key.rs index 493dbb1b3..710685451 100644 --- a/tachys/src/html/attribute/key.rs +++ b/tachys/src/html/attribute/key.rs @@ -2,14 +2,18 @@ use super::{Attr, AttributeValue}; use crate::renderer::Renderer; use std::{fmt::Debug, marker::PhantomData}; +/// An HTML attribute key. pub trait AttributeKey: Clone + Send + 'static { + /// The name of the attribute. const KEY: &'static str; } macro_rules! attributes { - ($($key:ident $html:literal),* $(,)?) => { + ($(#[$meta:meta] $key:ident $html:literal),* $(,)?) => { paste::paste! { $( + #[$meta] + #[track_caller] pub fn $key(value: V) -> Attr<[<$key:camel>], V, Rndr> where V: AttributeValue, Rndr: Renderer @@ -17,6 +21,7 @@ macro_rules! attributes { Attr([<$key:camel>], value, PhantomData) } + #[$meta] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub struct [<$key:camel>]; @@ -28,311 +33,618 @@ macro_rules! attributes { } } -// TODO attribute names with underscores should be kebab-cased attributes! { // HTML - abbr "abbr", // [], - accept_charset "accept-charset", // [], - accept "accept", // [], - accesskey "accesskey", // [], // [GlobalAttribute] - action "action", // [], - align "align", // [], - allow "allow", // [], - allowfullscreen "allowfullscreen", // [], - allowpaymentrequest "allowpaymentrequest", // [], - alt "alt", // [], + /// The `abbr` attribute specifies an abbreviated form of the element's content. + abbr "abbr", + /// The `accept-charset` attribute specifies the character encodings that are to be used for the form submission. + accept_charset "accept-charset", + /// The `accept` attribute specifies a list of types the server accepts, typically a file type. + accept "accept", + /// The `accesskey` attribute specifies a shortcut key to activate or focus an element. + accesskey "accesskey", + /// The `action` attribute defines the URL to which the form data will be sent. + action "action", + /// The `align` attribute specifies the alignment of an element. + align "align", + /// The `allow` attribute defines a feature policy for the content in an iframe. + allow "allow", + /// The `allowfullscreen` attribute allows the iframe to be displayed in fullscreen mode. + allowfullscreen "allowfullscreen", + /// The `allowpaymentrequest` attribute allows a cross-origin iframe to invoke the Payment Request API. + allowpaymentrequest "allowpaymentrequest", + /// The `alt` attribute provides alternative text for an image, if the image cannot be displayed. + alt "alt", // ARIA + /// The `aria-activedescendant` attribute identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. aria_activedescendant "aria-activedescendant", - aria_atomic "aria-atomic", // [], // [GlobalAttribute] // [AriaAttribute], + /// The `aria-atomic` attribute 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. + aria_atomic "aria-atomic", + /// The `aria-autocomplete` attribute indicates whether user input completion suggestions are provided. aria_autocomplete "aria-autocomplete", - aria_busy "aria-busy", // [], // [GlobalAttribute] // [AriaAttribute], + /// The `aria-busy` attribute indicates whether an element, and its subtree, are currently being updated. + aria_busy "aria-busy", + /// The `aria-checked` attribute indicates the current "checked" state of checkboxes, radio buttons, and other widgets. aria_checked "aria-checked", + /// The `aria-colcount` attribute defines the total number of columns in a table, grid, or treegrid. aria_colcount "aria-colcount", + /// The `aria-colindex` attribute defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. aria_colindex "aria-colindex", + /// The `aria-colspan` attribute defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. aria_colspan "aria-colspan", - aria_controls "aria-controls", // [], // [GlobalAttribute] // [AriaAttribute], - aria_current "aria-current", // [], // [GlobalAttribute] // [AriaAttribute], - aria_describedby "aria-describedby", // [], // [GlobalAttribute] // [AriaAttribute], - aria_description "aria-description", // [], // [GlobalAttribute] // [AriaAttribute], - aria_details "aria-details", // [], // [GlobalAttribute] // [AriaAttribute], - aria_disabled "aria-disabled", // [], // [GlobalAttribute] // [AriaAttribute], - aria_dropeffect "aria-dropeffect", // [], // [GlobalAttribute] // [AriaAttribute], - aria_errormessage "aria-errormessage", // [], // [GlobalAttribute] // [AriaAttribute], + /// The `aria-controls` attribute identifies the element (or elements) whose contents or presence are controlled by the current element. + aria_controls "aria-controls", + /// The `aria-current` attribute indicates the element representing the current item within a container or set of related elements. + aria_current "aria-current", + /// The `aria-describedby` attribute identifies the element (or elements) that describes the object. + aria_describedby "aria-describedby", + /// The `aria-description` attribute provides a string value that describes or annotates the current element. + aria_description "aria-description", + /// The `aria-details` attribute identifies the element that provides a detailed, extended description for the object. + aria_details "aria-details", + /// The `aria-disabled` attribute indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. + aria_disabled "aria-disabled", + /// The `aria-dropeffect` attribute indicates what functions can be performed when a dragged object is released on the drop target. + aria_dropeffect "aria-dropeffect", + /// The `aria-errormessage` attribute identifies the element that provides an error message for the object. + aria_errormessage "aria-errormessage", + /// The `aria-expanded` attribute indicates whether an element, or another grouping element it controls, is currently expanded or collapsed. aria_expanded "aria-expanded", - aria_flowto "aria-flowto", // [], // [GlobalAttribute] // [AriaAttribute], - aria_grabbed "aria-grabbed", // [], // [GlobalAttribute] // [AriaAttribute], - aria_haspopup "aria-haspopup", // [], // [GlobalAttribute] // [AriaAttribute], - aria_hidden "aria-hidden", // [], // [GlobalAttribute] // [AriaAttribute], - aria_invalid "aria-invalid", // [], // [GlobalAttribute] // [AriaAttribute], - aria_keyshortcuts "aria-keyshortcuts", // [], // [GlobalAttribute] // [AriaAttribute], - aria_label "aria-label", // [], // [GlobalAttribute] // [AriaAttribute], - aria_labelledby "aria-labelledby", // [], // [GlobalAttribute] // [AriaAttribute], - aria_live "aria-live", // [], // [GlobalAttribute] // [AriaAttribute], + /// The `aria-flowto` attribute identifies the next element (or elements) in an alternate reading order of content. + aria_flowto "aria-flowto", + /// The `aria-grabbed` attribute indicates an element's "grabbed" state in a drag-and-drop operation. + aria_grabbed "aria-grabbed", + /// The `aria-haspopup` attribute indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. + aria_haspopup "aria-haspopup", + /// The `aria-hidden` attribute indicates whether the element is exposed to an accessibility API. + aria_hidden "aria-hidden", + /// The `aria-invalid` attribute indicates the entered value does not conform to the format expected by the application. + aria_invalid "aria-invalid", + /// The `aria-keyshortcuts` attribute indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. + aria_keyshortcuts "aria-keyshortcuts", + /// The `aria-label` attribute defines a string value that labels the current element. + aria_label "aria-label", + /// The `aria-labelledby` attribute identifies the element (or elements) that labels the current element. + aria_labelledby "aria-labelledby", + /// The `aria-live` attribute 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. + aria_live "aria-live", + /// The `aria-modal` attribute indicates whether an element is modal when displayed. aria_modal "aria-modal", + /// The `aria-multiline` attribute indicates whether a text box accepts multiple lines of input or only a single line. aria_multiline "aria-multiline", + /// The `aria-multiselectable` attribute indicates that the user may select more than one item from the current selectable descendants. aria_multiselectable "aria-multiselectable", + /// The `aria-orientation` attribute indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. aria_orientation "aria-orientation", - aria_owns "aria-owns", // [], // [GlobalAttribute] // [AriaAttribute], + /// The `aria-owns` attribute identifies an element (or elements) in order to define a relationship between the element with `aria-owns` and the target element. + aria_owns "aria-owns", + /// The `aria-placeholder` attribute defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. aria_placeholder "aria-placeholder", + /// The `aria-posinset` attribute defines an element's position within a set or treegrid. aria_posinset "aria-posinset", + /// The `aria-pressed` attribute indicates the current "pressed" state of toggle buttons. aria_pressed "aria-pressed", + /// The `aria-readonly` attribute indicates that the element is not editable, but is otherwise operable. aria_readonly "aria-readonly", - aria_relevant "aria-relevant", // [], // [GlobalAttribute] // [AriaAttribute], + /// The `aria-relevant` attribute indicates what user agent changes to the accessibility tree should be monitored. + aria_relevant "aria-relevant", + /// The `aria-required` attribute indicates that user input is required on the element before a form may be submitted. aria_required "aria-required", - aria_roledescription "aria-roledescription", // [], // [GlobalAttribute] // [AriaAttribute], + /// The `aria-roledescription` attribute defines a human-readable, author-localized description for the role of an element. + aria_roledescription "aria-roledescription", + /// The `aria-rowcount` attribute defines the total number of rows in a table, grid, or treegrid. aria_rowcount "aria-rowcount", + /// The `aria-rowindex` attribute defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. aria_rowindex "aria-rowindex", + /// The `aria-rowspan` attribute defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. aria_rowspan "aria-rowspan", + /// The `aria-selected` attribute indicates the current "selected" state of various widgets. aria_selected "aria-selected", + /// The `aria-setsize` attribute defines the number of items in the current set of listitems or treeitems. aria_setsize "aria-setsize", + /// The `aria-sort` attribute indicates if items in a table or grid are sorted in ascending or descending order. aria_sort "aria-sort", + /// The `aria-valuemax` attribute defines the maximum allowed value for a range widget. aria_valuemax "aria-valuemax", + /// The `aria-valuemin` attribute defines the minimum allowed value for a range widget. aria_valuemin "aria-valuemin", + /// The `aria-valuenow` attribute defines the current value for a range widget. aria_valuenow "aria-valuenow", + /// The `aria-valuetext` attribute defines the human-readable text alternative of aria-valuenow for a range widget. aria_valuetext "aria-valuetext", - r#as "as", // [], - r#async "async", // [], - autocapitalize "autocapitalize", // [], // [GlobalAttribute] - autocomplete "autocomplete", // [], - autofocus "autofocus", // [], // [GlobalAttribute] - autoplay "autoplay", // [], - background "background", // [], - bgcolor "bgcolor", // [], - blocking "blocking", // [], - border "border", // [], - buffered "buffered", // [], - capture "capture", // [], - challenge "challenge", // [], - charset "charset", // [], - checked "checked", // [], - cite "cite", // [], + /// The `as` attribute specifies the type of destination for the content of the link. + r#as "as", + /// The `async` attribute indicates that the script should be executed asynchronously. + r#async "async", + /// The `autocapitalize` attribute controls whether and how text input is automatically capitalized as it is entered/edited by the user. + autocapitalize "autocapitalize", + /// The `autocomplete` attribute indicates whether an input field can have its value automatically completed by the browser. + autocomplete "autocomplete", + /// The `autofocus` attribute indicates that an element should be focused on page load. + autofocus "autofocus", + /// The `autoplay` attribute indicates that the media should start playing as soon as it is loaded. + autoplay "autoplay", + /// The `background` attribute sets the URL of the background image for the document. + background "background", + /// The `bgcolor` attribute sets the background color of an element. + bgcolor "bgcolor", + /// The `blocking` attribute indicates that the script will block the page loading until it is executed. + blocking "blocking", + /// The `border` attribute sets the width of an element's border. + border "border", + /// The `buffered` attribute contains the time ranges that the media has been buffered. + buffered "buffered", + /// The `capture` attribute indicates that the user must capture media using a camera or microphone instead of selecting a file from the file picker. + capture "capture", + /// The `challenge` attribute specifies the challenge string that is paired with the keygen element. + challenge "challenge", + /// The `charset` attribute specifies the character encoding of the HTML document. + charset "charset", + /// The `checked` attribute indicates whether an input element is checked or not. + checked "checked", + /// The `cite` attribute contains a URL that points to the source of the quotation or change. + cite "cite", // class is handled in ../class.rs instead - //class "class", // [], - code "code", // [], - color "color", // [], - cols "cols", // [], - colspan "colspan", // [], - content "content", // [], - contenteditable "contenteditable", // [], // [GlobalAttribute] - contextmenu "contextmenu", // [], // [GlobalAttribute] - controls "controls", // [], - controlslist "controlslist", // [], - coords "coords", // [], - crossorigin "crossorigin", // [], - csp "csp", // [], - data "data", // [], - datetime "datetime", // [], - decoding "decoding", // [], - default "default", // [], - defer "defer", // [], - dir "dir", // [], // [GlobalAttribute] - dirname "dirname", // [], - disabled "disabled", // [], - disablepictureinpicture "disablepictureinpicture", // [], - disableremoteplayback "disableremoteplayback", // [], - download "download", // [], - draggable "draggable", // [], // [GlobalAttribute] - enctype "enctype", // [], - enterkeyhint "enterkeyhint", // [], // [GlobalAttribute] - exportparts "exportparts", // [], // [GlobalAttribute] - fetchpriority "fetchprioty", // [], - r#for "for", // [], - form "form", // [], - formaction "formaction", // [], - formenctype "formenctype", // [], - formmethod "formmethod", // [], - formnovalidate "formnovalidate", // [], - formtarget "formtarget", // [], - headers "headers", // [], - height "height", // [], - hidden "hidden", // [], // [GlobalAttribute] - high "high", // [], - href "href", // [], - hreflang "hreflang", // [], - http_equiv "http-equiv", // [], - icon "icon", // [], - id "id", // [], // [GlobalAttribute] + //class "class", + /// The `code` attribute specifies the URL of the applet's class file to be loaded and executed. + code "code", + /// The `color` attribute specifies the color of an element's text. + color "color", + /// The `cols` attribute specifies the visible width of a text area. + cols "cols", + /// The `colspan` attribute defines the number of columns a cell should span. + colspan "colspan", + /// The `content` attribute gives the value associated with the http-equiv or name attribute. + content "content", + /// The `contenteditable` attribute indicates whether the element's content is editable. + contenteditable "contenteditable", + /// The `contextmenu` attribute specifies the ID of a `` element to open as a context menu. + contextmenu "contextmenu", + /// The `controls` attribute indicates whether the browser should display playback controls for the media. + controls "controls", + /// The `controlslist` attribute allows the control of which controls to show on the media element whenever the browser shows its native controls. + controlslist "controlslist", + /// The `coords` attribute specifies the coordinates of an area in an image map. + coords "coords", + /// The `crossorigin` attribute indicates whether the resource should be fetched with a CORS request. + crossorigin "crossorigin", + /// The `csp` attribute allows the embedding document to define the Content Security Policy that an embedded document must agree to enforce upon itself. + csp "csp", + /// The `data` attribute specifies the URL of the resource that is being embedded. + data "data", + /// The `datetime` attribute specifies the date and time. + datetime "datetime", + /// The `decoding` attribute indicates the preferred method for decoding images. + decoding "decoding", + /// The `default` attribute indicates that the track should be enabled unless the user's preferences indicate that another track is more appropriate. + default "default", + /// The `defer` attribute indicates that the script should be executed after the document has been parsed. + defer "defer", + /// The `dir` attribute specifies the text direction for the content in an element. + dir "dir", + /// The `dirname` attribute identifies the text directionality of an input element. + dirname "dirname", + /// The `disabled` attribute indicates whether the element is disabled. + disabled "disabled", + /// The `disablepictureinpicture` attribute indicates that the element is not allowed to be displayed in Picture-in-Picture mode. + disablepictureinpicture "disablepictureinpicture", + /// The `disableremoteplayback` attribute indicates that the element is not allowed to be displayed using remote playback. + disableremoteplayback "disableremoteplayback", + /// The `download` attribute indicates that the linked resource is intended to be downloaded rather than displayed in the browser. + download "download", + /// The `draggable` attribute indicates whether the element is draggable. + draggable "draggable", + /// The `enctype` attribute specifies the MIME type of the form submission. + enctype "enctype", + /// The `enterkeyhint` attribute allows authors to specify what kind of action label or icon will be presented to users in a virtual keyboard's enter key. + enterkeyhint "enterkeyhint", + /// The `exportparts` attribute enables the sharing of parts of an element's shadow DOM with a containing document. + exportparts "exportparts", + /// The `fetchpriority` attribute allows developers to specify the priority of a resource fetch request. + fetchpriority "fetchpriority", + /// The `for` attribute specifies which form element a label is bound to. + r#for "for", + /// The `form` attribute associates the element with a form element. + form "form", + /// The `formaction` attribute specifies the URL that processes the form submission. + formaction "formaction", + /// The `formenctype` attribute specifies how the form data should be encoded when submitted. + formenctype "formenctype", + /// The `formmethod` attribute specifies the HTTP method to use when submitting the form. + formmethod "formmethod", + /// The `formnovalidate` attribute indicates that the form should not be validated when submitted. + formnovalidate "formnovalidate", + /// The `formtarget` attribute specifies where to display the response after submitting the form. + formtarget "formtarget", + /// The `headers` attribute specifies the headers associated with the element. + headers "headers", + /// The `height` attribute specifies the height of an element. + height "height", + /// The `hidden` attribute indicates that the element is not yet, or is no longer, relevant. + hidden "hidden", + /// The `high` attribute specifies the range that is considered to be a high value. + high "high", + /// The `href` attribute specifies the URL of a linked resource. + href "href", + /// The `hreflang` attribute specifies the language of the linked resource. + hreflang "hreflang", + /// The `http-equiv` attribute provides an HTTP header for the information/value of the content attribute. + http_equiv "http-equiv", + /// The `icon` attribute specifies the URL of an image to be used as a graphical icon for the element. + icon "icon", + /// The `id` attribute specifies a unique id for an element. + id "id", + /// The `imagesizes` attribute specifies image sizes for different page layouts. imagesizes "imagesizes", + /// The `imagesrcset` attribute specifies the URLs of multiple images to be used in different situations. imagesrcset "imagesrcset", - importance "importance", // [], - inert "inert", // [], // [GlobalAttribute] - inputmode "inputmode", // [], // [GlobalAttribute] - integrity "integrity", // [], - intrinsicsize "intrinsicsize", // [], - is "is", // [], // [GlobalAttribute] - ismap "ismap", // [], - itemid "itemid", // [], // [GlobalAttribute] - itemprop "itemprop", // [], // [GlobalAttribute] - itemref "itemref", // [], // [GlobalAttribute] - itemscope "itemscope", // [], // [GlobalAttribute] - itemtype "itemtype", // [], // [GlobalAttribute] - keytype "keytype", // [], - kind "kind", // [], - label "label", // [], - lang "lang", // [], // [GlobalAttribute] - language "language", // [], - list "list", // [], - loading "loading", // [], - r#loop "loop", // [], - low "low", // [], - manifest "manifest", // [], - max "max", // [], - maxlength "maxlength", // [], - media "media", // [], - method "method", // [], - min "min", // [], - minlength "minlength", // [], - multiple "multiple", // [], - muted "muted", // [], - name "name", // [], - nomodule "nomodule", // [], - nonce "nonce", // [], // [GlobalAttribute] - novalidate "novalidate", // [], - open "open", // [], - optimum "optimum", // [], - part "part", // [], // [GlobalAttribute] - pattern "pattern", // [], - ping "ping", // [], - placeholder "placeholder", // [], - playsinline "playsinline", // [], - popover "popover", // [], // [GlobalAttribute] + /// The `importance` attribute specifies the relative importance of the element. + importance "importance", + /// The `inert` attribute indicates that the element is non-interactive and won't be accessible to user interactions or assistive technologies. + inert "inert", + /// The `inputmode` attribute specifies the type of data that the user will enter. + inputmode "inputmode", + /// The `integrity` attribute contains a hash value that the browser can use to verify that the resource hasn't been altered. + integrity "integrity", + /// The `intrinsicsize` attribute specifies the intrinsic size of an image or video. + intrinsicsize "intrinsicsize", + /// The `is` attribute allows you to specify the name of a custom element. + is "is", + /// The `ismap` attribute indicates that the image is part of a server-side image map. + ismap "ismap", + /// The `itemid` attribute assigns a unique identifier to an item. + itemid "itemid", + /// The `itemprop` attribute adds a property to an item. + itemprop "itemprop", + /// The `itemref` attribute provides a list of element IDs that have additional properties for the item. + itemref "itemref", + /// The `itemscope` attribute creates a new item and adds it to the page's items. + itemscope "itemscope", + /// The `itemtype` attribute specifies the type of an item. + itemtype "itemtype", + /// The `keytype` attribute specifies the type of key used by the `` element. + keytype "keytype", + /// The `kind` attribute specifies the kind of text track. + kind "kind", + /// The `label` attribute provides a user-readable title for an element. + label "label", + /// The `lang` attribute specifies the language of the element's content. + lang "lang", + /// The `language` attribute specifies the scripting language used for the script. + language "language", + /// The `list` attribute identifies a `` element that contains pre-defined options for an `` element. + list "list", + /// The `loading` attribute indicates how the browser should load the image. + loading "loading", + /// The `loop` attribute indicates whether the media should start over again when it reaches the end. + r#loop "loop", + /// The `low` attribute specifies the range that is considered to be a low value. + low "low", + /// The `manifest` attribute specifies the URL of a document's cache manifest. + manifest "manifest", + /// The `max` attribute specifies the maximum value for an input element. + max "max", + /// The `maxlength` attribute specifies the maximum number of characters that an input element can accept. + maxlength "maxlength", + /// The `media` attribute specifies what media/device the linked resource is optimized for. + media "media", + /// The `method` attribute specifies the HTTP method to use when submitting the form. + method "method", + /// The `min` attribute specifies the minimum value for an input element. + min "min", + /// The `minlength` attribute specifies the minimum number of characters that an input element can accept. + minlength "minlength", + /// The `multiple` attribute indicates whether the user can enter more than one value. + multiple "multiple", + /// The `muted` attribute indicates whether the audio will be initially silenced on page load. + muted "muted", + /// The `name` attribute specifies the name of the element. + name "name", + /// The `nomodule` attribute indicates that the script should not be executed in browsers that support ES modules. + nomodule "nomodule", + /// The `nonce` attribute provides a cryptographic nonce to ensure that a script or style is approved for execution. + nonce "nonce", + /// The `novalidate` attribute indicates that the form should not be validated when submitted. + novalidate "novalidate", + /// The `open` attribute indicates whether the details element is open or closed. + open "open", + /// The `optimum` attribute specifies the range that is considered to be an optimum value. + optimum "optimum", + /// The `part` attribute identifies the element as a shadow DOM part. + part "part", + /// The `pattern` attribute specifies a regular expression that the input element's value is checked against. + pattern "pattern", + /// The `ping` attribute contains a space-separated list of URLs to be notified if the user follows the hyperlink. + ping "ping", + /// The `placeholder` attribute provides a short hint that describes the expected value of the input element. + placeholder "placeholder", + /// The `playsinline` attribute indicates that the video should play inline in the element's playback area. + playsinline "playsinline", + /// The `popover` attribute indicates that an element is a popover and specifies the event that causes the popover to be shown. + popover "popover", + /// The `popovertarget` attribute specifies the ID of an element to toggle a popover. popovertarget "popovertarget", + /// The `popovertargetaction` attribute specifies the action that shows the popover. popovertargetaction "popovertargetaction", - poster "poster", // [], - preload "preload", // [], - radiogroup "radiogroup", // [], - readonly "readonly", // [], - referrerpolicy "referrerpolicy", // [], - rel "rel", // [], - required "required", // [], - reversed "reversed", // [], - role "role", // [], // [GlobalAttribute] // [AriaAttribute], - rows "rows", // [], - rowspan "rowspan", // [], - sandbox "sandbox", // [], - scope "scope", // [], - scoped "scoped", // [], - selected "selected", // [], - shape "shape", // [], - size "size", // [], - sizes "sizes", // [], - slot "slot", // [], // [GlobalAttribute] - span "span", // [], - spellcheck "spellcheck", // [], // [GlobalAttribute] - src "src", // [], - srcdoc "srcdoc", // [], - srclang "srclang", // [], - srcset "srcset", // [], - start "start", // [], - step "step", // [], + /// The `poster` attribute specifies an image to be shown while the video is downloading or until the user hits the play button. + poster "poster", + /// The `preload` attribute specifies if and how the author thinks that the media file should be loaded when the page loads. + preload "preload", + /// The `radiogroup` attribute specifies the name of the group to which the element belongs. + radiogroup "radiogroup", + /// The `readonly` attribute indicates that the user cannot modify the value of the input element. + readonly "readonly", + /// The `referrerpolicy` attribute specifies which referrer information to include with requests. + referrerpolicy "referrerpolicy", + /// The `rel` attribute specifies the relationship between the current document and the linked document. + rel "rel", + /// The `required` attribute indicates that the user must fill in the input element before submitting the form. + required "required", + /// The `reversed` attribute indicates that the list should be displayed in a descending order. + reversed "reversed", + /// The `role` attribute defines the role of an element in the context of a web application. + role "role", + /// The `rows` attribute specifies the number of visible text lines for a text area. + rows "rows", + /// The `rowspan` attribute defines the number of rows a cell should span. + rowspan "rowspan", + /// The `sandbox` attribute applies extra restrictions to the content in the `