diff --git a/.changeset/short-bats-judge.md b/.changeset/short-bats-judge.md new file mode 100644 index 000000000000..a199212c7806 --- /dev/null +++ b/.changeset/short-bats-judge.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes a bug where the the role `image` was incorrectly reported by audit tool bar. diff --git a/packages/astro/src/runtime/client/dev-toolbar/apps/audit/rules/a11y.ts b/packages/astro/src/runtime/client/dev-toolbar/apps/audit/rules/a11y.ts index 10c0070c2e95..ba34f8509079 100644 --- a/packages/astro/src/runtime/client/dev-toolbar/apps/audit/rules/a11y.ts +++ b/packages/astro/src/runtime/client/dev-toolbar/apps/audit/rules/a11y.ts @@ -83,6 +83,7 @@ const aria_non_interactive_roles = [ 'form', 'group', 'heading', + 'image', 'img', 'list', 'listitem', @@ -149,7 +150,7 @@ const a11y_implicit_semantics = new Map([ ['h5', 'heading'], ['h6', 'heading'], ['hr', 'separator'], - ['img', 'img'], + ['img', 'image'], ['li', 'listitem'], ['link', 'link'], ['main', 'main'], @@ -201,7 +202,7 @@ const ariaAttributes = new Set( // All the WAI-ARIA 1.2 role attribute values from https://www.w3.org/TR/wai-aria-1.2/#role_definitions const ariaRoles = new Set( - 'alert alertdialog application article banner blockquote button caption cell checkbox code columnheader combobox command complementary composite contentinfo definition deletion dialog directory document emphasis feed figure form generic grid gridcell group heading img input insertion landmark link list listbox listitem log main marquee math meter menu menubar menuitem menuitemcheckbox menuitemradio navigation none note option paragraph presentation progressbar radio radiogroup range region roletype row rowgroup rowheader scrollbar search searchbox section sectionhead select separator slider spinbutton status strong structure subscript superscript switch tab table tablist tabpanel term textbox time timer toolbar tooltip tree treegrid treeitem widget window'.split( + 'alert alertdialog application article banner blockquote button caption cell checkbox code columnheader combobox command complementary composite contentinfo definition deletion dialog directory document emphasis feed figure form generic grid gridcell group heading image img input insertion landmark link list listbox listitem log main marquee math meter menu menubar menuitem menuitemcheckbox menuitemradio navigation none note option paragraph presentation progressbar radio radiogroup range region roletype row rowgroup rowheader scrollbar search searchbox section sectionhead select separator slider spinbutton status strong structure subscript superscript switch tab table tablist tabpanel term textbox time timer toolbar tooltip tree treegrid treeitem widget window'.split( ' ', ), );