pub struct FieldSurface {
pub required: AttributeSurface,
pub disabled: AttributeSurface,
pub validity: ValiditySurface,
pub name: NameSurface,
}Expand description
How one rendered element spells its field state, one axis per attribute.
The axes are independent because their validity lattices disagree pairwise: native disabled
is legal on a button where native required is not, and aria-invalid is unsupported on
some roles where aria-disabled is fine. A single index over all of them cannot describe any
element correctly.
The data-* state attributes are outside this type. They are valid on every element, so
FieldMeta::attributes_for always emits them regardless of the surface — an Omit axis
suppresses only the attribute the element cannot carry, never the styling hook.
Fields§
§required: AttributeSurfaceHow the element spells its required state.
disabled: AttributeSurfaceHow the element spells its disabled state.
validity: ValiditySurfaceHow the element spells its validity.
name: NameSurfaceWhether the element carries a name.
Implementations§
Source§impl FieldSurface
impl FieldSurface
Sourcepub const NATIVE: Self
pub const NATIVE: Self
input, textarea, and select — every axis that has a native spelling uses it, and
this is the default. Validity stays ARIA, since no element spells validity natively.
Sourcepub const BUTTON_WIDGET: Self
pub const BUTTON_WIDGET: Self
button[role=checkbox|switch] — native disabled and name are legal on a button,
native required is not.
Sourcepub const ARIA_WIDGET: Self
pub const ARIA_WIDGET: Self
div[role=radiogroup] — no native attribute applies, and a div carries no name.
A control rooted on role=group should start here and set validity to
ValiditySurface::Omit, since aria-invalid is deprecated on that role.
Trait Implementations§
Source§impl Clone for FieldSurface
impl Clone for FieldSurface
Source§fn clone(&self) -> FieldSurface
fn clone(&self) -> FieldSurface
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more