Skip to content

Commit

Permalink
expose <address> and <fieldset> as aria group
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=255621

Reviewed by Tyler Wilcock.

Address and Fieldset were incorrectly marked as "Group" which is a
generic AccessibilityRole that does not get exposed as the ARIA "Group"
role. The correct role to expose as "Group" is "ApplicationGroup".

This changes both address tags and fieldset tags to be
"ApplicationGroup".

Co-authored-by: Kate Higa <16447748+khiga8@users.noreply.github.com>
Co-authored-by: Lindsey Wild <35239154+lindseywild@users.noreply.github.com>

* LayoutTests/imported/w3c/web-platform-tests/html-aam/roles-expected.txt:
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html-aam/roles-expected.txt:
* LayoutTests/platform/mac-wk1/accessibility/roles-exposed-expected.txt:
* LayoutTests/platform/mac-wk2/accessibility/roles-exposed-expected.txt:
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::determineAccessibilityRoleFromNode const):

Canonical link: https://commits.webkit.org/271021@main
  • Loading branch information
keithamus authored and twilco committed Nov 21, 2023
1 parent 62f37bd commit 51444d3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ x
x
x

FAIL el-address assert_equals: <address data-testname="el-address" data-expectedrole="group" class="ex">x</address> expected "group" but got ""
PASS el-address
PASS el-article
PASS el-blockquote
PASS el-button
Expand All @@ -64,7 +64,7 @@ FAIL el-details assert_equals: <details data-testname="el-details" data-expected
FAIL el-dfn assert_equals: <dfn data-testname="el-dfn" data-expectedrole="term" class="ex">x</dfn> expected "term" but got "definition"
FAIL el-dt assert_equals: <dt data-testname="el-dt" data-expectedrole="term" class="ex">x</dt> expected "term" but got ""
FAIL el-em assert_equals: <em data-testname="el-em" data-expectedrole="emphasis" class="ex">x</em> expected "emphasis" but got ""
FAIL el-fieldset assert_equals: <fieldset data-testname="el-fieldset" data-expectedrole="group" class="ex"><legend>x</legend><input></fieldset> expected "group" but got ""
PASS el-fieldset
PASS el-figure
PASS el-form
PASS el-h1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ x
x
x

FAIL el-address assert_equals: <address data-testname="el-address" data-expectedrole="group" class="ex">x</address> expected "group" but got ""
PASS el-address
PASS el-article
PASS el-blockquote
PASS el-button
Expand All @@ -64,7 +64,7 @@ FAIL el-details assert_equals: <details data-testname="el-details" data-expected
FAIL el-dfn assert_equals: <dfn data-testname="el-dfn" data-expectedrole="term" class="ex">x</dfn> expected "term" but got "definition"
FAIL el-dt assert_equals: <dt data-testname="el-dt" data-expectedrole="term" class="ex">x</dt> expected "term" but got ""
FAIL el-em assert_equals: <em data-testname="el-em" data-expectedrole="emphasis" class="ex">x</em> expected "emphasis" but got ""
FAIL el-fieldset assert_equals: <fieldset data-testname="el-fieldset" data-expectedrole="group" class="ex"><legend>x</legend><input></fieldset> expected "group" but got ""
PASS el-fieldset
PASS el-figure
PASS el-form
PASS el-h1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abbr[title]

address
AXRole: AXGroup
AXSubrole:
AXSubrole: AXApplicationGroup
AXRoleDescription: group

article
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abbr[title]

address
AXRole: AXGroup
AXSubrole:
AXSubrole: AXApplicationGroup
AXRoleDescription: group

article
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ AccessibilityRole AccessibilityNodeObject::determineAccessibilityRoleFromNode(Tr
if (node()->hasTagName(menuTag) || node()->hasTagName(olTag) || node()->hasTagName(ulTag))
return AccessibilityRole::List;
if (node()->hasTagName(fieldsetTag))
return AccessibilityRole::Group;
return AccessibilityRole::ApplicationGroup;
if (node()->hasTagName(figureTag))
return AccessibilityRole::Figure;
if (node()->hasTagName(pTag))
Expand Down Expand Up @@ -467,7 +467,7 @@ AccessibilityRole AccessibilityNodeObject::determineAccessibilityRoleFromNode(Tr
if (node()->hasTagName(sectionTag))
return hasAttribute(aria_labelAttr) || hasAttribute(aria_labelledbyAttr) ? AccessibilityRole::LandmarkRegion : AccessibilityRole::TextGroup;
if (node()->hasTagName(addressTag))
return AccessibilityRole::Group;
return AccessibilityRole::ApplicationGroup;
if (node()->hasTagName(blockquoteTag))
return AccessibilityRole::Blockquote;
if (node()->hasTagName(captionTag) || node()->hasTagName(figcaptionTag))
Expand Down

0 comments on commit 51444d3

Please sign in to comment.