feat: additional ARIA attributes (#2677)

This commit is contained in:
luoxiaozero 2024-07-11 20:19:50 +08:00 committed by Greg Johnston
parent 3515469835
commit 12a9e06c5e
2 changed files with 234 additions and 0 deletions

View file

@ -9,6 +9,14 @@ where
V: AttributeValue<Rndr>,
Rndr: Renderer,
{
fn aria_activedescendant(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaActivedescendant, V, Rndr>>
{
self.add_any_attr(aria_activedescendant(value))
}
fn aria_atomic(
self,
value: V,
@ -16,24 +24,63 @@ where
self.add_any_attr(aria_atomic(value))
}
fn aria_autocomplete(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaAutocomplete, V, Rndr>>
{
self.add_any_attr(aria_autocomplete(value))
}
fn aria_busy(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaBusy, V, Rndr>> {
self.add_any_attr(aria_busy(value))
}
fn aria_checked(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaChecked, V, Rndr>> {
self.add_any_attr(aria_checked(value))
}
fn aria_colcount(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaColcount, V, Rndr>> {
self.add_any_attr(aria_colcount(value))
}
fn aria_colindex(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaColindex, V, Rndr>> {
self.add_any_attr(aria_colindex(value))
}
fn aria_colspan(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaColspan, V, Rndr>> {
self.add_any_attr(aria_colspan(value))
}
fn aria_controls(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaControls, V, Rndr>> {
self.add_any_attr(aria_controls(value))
}
fn aria_current(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaCurrent, V, Rndr>> {
self.add_any_attr(aria_current(value))
}
fn aria_describedby(
self,
value: V,
@ -41,6 +88,7 @@ where
{
self.add_any_attr(aria_describedby(value))
}
fn aria_description(
self,
value: V,
@ -48,24 +96,28 @@ where
{
self.add_any_attr(aria_description(value))
}
fn aria_details(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaDetails, V, Rndr>> {
self.add_any_attr(aria_details(value))
}
fn aria_disabled(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaDisabled, V, Rndr>> {
self.add_any_attr(aria_disabled(value))
}
fn aria_dropeffect(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaDropeffect, V, Rndr>> {
self.add_any_attr(aria_dropeffect(value))
}
fn aria_errormessage(
self,
value: V,
@ -73,36 +125,49 @@ where
{
self.add_any_attr(aria_errormessage(value))
}
fn aria_expanded(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaExpanded, V, Rndr>> {
self.add_any_attr(aria_expanded(value))
}
fn aria_flowto(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaFlowto, V, Rndr>> {
self.add_any_attr(aria_flowto(value))
}
fn aria_grabbed(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaGrabbed, V, Rndr>> {
self.add_any_attr(aria_grabbed(value))
}
fn aria_haspopup(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaHaspopup, V, Rndr>> {
self.add_any_attr(aria_haspopup(value))
}
fn aria_hidden(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaHidden, V, Rndr>> {
self.add_any_attr(aria_hidden(value))
}
fn aria_invalid(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaInvalid, V, Rndr>> {
self.add_any_attr(aria_invalid(value))
}
fn aria_keyshortcuts(
self,
value: V,
@ -110,36 +175,108 @@ where
{
self.add_any_attr(aria_keyshortcuts(value))
}
fn aria_label(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaLabel, V, Rndr>> {
self.add_any_attr(aria_label(value))
}
fn aria_labelledby(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaLabelledby, V, Rndr>> {
self.add_any_attr(aria_labelledby(value))
}
fn aria_live(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaLive, V, Rndr>> {
self.add_any_attr(aria_live(value))
}
fn aria_modal(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaModal, V, Rndr>> {
self.add_any_attr(aria_modal(value))
}
fn aria_multiline(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaMultiline, V, Rndr>> {
self.add_any_attr(aria_multiline(value))
}
fn aria_multiselectable(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaMultiselectable, V, Rndr>>
{
self.add_any_attr(aria_multiselectable(value))
}
fn aria_orientation(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaOrientation, V, Rndr>>
{
self.add_any_attr(aria_orientation(value))
}
fn aria_owns(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaOwns, V, Rndr>> {
self.add_any_attr(aria_owns(value))
}
fn aria_placeholder(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaPlaceholder, V, Rndr>>
{
self.add_any_attr(aria_placeholder(value))
}
fn aria_posinset(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaPosinset, V, Rndr>> {
self.add_any_attr(aria_posinset(value))
}
fn aria_pressed(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaPressed, V, Rndr>> {
self.add_any_attr(aria_pressed(value))
}
fn aria_readonly(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaReadonly, V, Rndr>> {
self.add_any_attr(aria_readonly(value))
}
fn aria_relevant(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaRelevant, V, Rndr>> {
self.add_any_attr(aria_relevant(value))
}
fn aria_required(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaRequired, V, Rndr>> {
self.add_any_attr(aria_required(value))
}
fn aria_roledescription(
self,
value: V,
@ -147,6 +284,76 @@ where
{
self.add_any_attr(aria_roledescription(value))
}
fn aria_rowcount(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaRowcount, V, Rndr>> {
self.add_any_attr(aria_rowcount(value))
}
fn aria_rowindex(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaRowindex, V, Rndr>> {
self.add_any_attr(aria_rowindex(value))
}
fn aria_rowspan(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaRowspan, V, Rndr>> {
self.add_any_attr(aria_rowspan(value))
}
fn aria_selected(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaSelected, V, Rndr>> {
self.add_any_attr(aria_selected(value))
}
fn aria_setsize(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaSetsize, V, Rndr>> {
self.add_any_attr(aria_setsize(value))
}
fn aria_sort(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaSort, V, Rndr>> {
self.add_any_attr(aria_sort(value))
}
fn aria_valuemax(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaValuemax, V, Rndr>> {
self.add_any_attr(aria_valuemax(value))
}
fn aria_valuemin(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaValuemin, V, Rndr>> {
self.add_any_attr(aria_valuemin(value))
}
fn aria_valuenow(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaValuenow, V, Rndr>> {
self.add_any_attr(aria_valuenow(value))
}
fn aria_valuetext(
self,
value: V,
) -> <Self as AddAnyAttr<Rndr>>::Output<Attr<AriaValuetext, V, Rndr>> {
self.add_any_attr(aria_valuetext(value))
}
}
impl<T, Rndr, V> AriaAttributes<Rndr, V> for T

View file

@ -41,8 +41,15 @@ attributes! {
allowfullscreen "allowfullscreen", // [],
allowpaymentrequest "allowpaymentrequest", // [],
alt "alt", // [],
// ARIA
aria_activedescendant "aria-activedescendant",
aria_atomic "aria-atomic", // [], // [GlobalAttribute] // [AriaAttribute],
aria_autocomplete "aria-autocomplete",
aria_busy "aria-busy", // [], // [GlobalAttribute] // [AriaAttribute],
aria_checked "aria-checked",
aria_colcount "aria-colcount",
aria_colindex "aria-colindex",
aria_colspan "aria-colspan",
aria_controls "aria-controls", // [], // [GlobalAttribute] // [AriaAttribute],
aria_current "aria-current", // [], // [GlobalAttribute] // [AriaAttribute],
aria_describedby "aria-describedby", // [], // [GlobalAttribute] // [AriaAttribute],
@ -51,6 +58,7 @@ attributes! {
aria_disabled "aria-disabled", // [], // [GlobalAttribute] // [AriaAttribute],
aria_dropeffect "aria-dropeffect", // [], // [GlobalAttribute] // [AriaAttribute],
aria_errormessage "aria-errormessage", // [], // [GlobalAttribute] // [AriaAttribute],
aria_expanded "aria-expanded",
aria_flowto "aria-flowto", // [], // [GlobalAttribute] // [AriaAttribute],
aria_grabbed "aria-grabbed", // [], // [GlobalAttribute] // [AriaAttribute],
aria_haspopup "aria-haspopup", // [], // [GlobalAttribute] // [AriaAttribute],
@ -60,9 +68,28 @@ attributes! {
aria_label "aria-label", // [], // [GlobalAttribute] // [AriaAttribute],
aria_labelledby "aria-labelledby", // [], // [GlobalAttribute] // [AriaAttribute],
aria_live "aria-live", // [], // [GlobalAttribute] // [AriaAttribute],
aria_modal "aria-modal",
aria_multiline "aria-multiline",
aria_multiselectable "aria-multiselectable",
aria_orientation "aria-orientation",
aria_owns "aria-owns", // [], // [GlobalAttribute] // [AriaAttribute],
aria_placeholder "aria-placeholder",
aria_posinset "aria-posinset",
aria_pressed "aria-pressed",
aria_readonly "aria-readonly",
aria_relevant "aria-relevant", // [], // [GlobalAttribute] // [AriaAttribute],
aria_required "aria-required",
aria_roledescription "aria-roledescription", // [], // [GlobalAttribute] // [AriaAttribute],
aria_rowcount "aria-rowcount",
aria_rowindex "aria-rowindex",
aria_rowspan "aria-rowspan",
aria_selected "aria-selected",
aria_setsize "aria-setsize",
aria_sort "aria-sort",
aria_valuemax "aria-valuemax",
aria_valuemin "aria-valuemin",
aria_valuenow "aria-valuenow",
aria_valuetext "aria-valuetext",
r#as "as", // [],
r#async "async", // [],
autocapitalize "autocapitalize", // [], // [GlobalAttribute]