Remove redundant Role::kPresentation/kIgnored (use kNone)
Also fixes an actual bug, where the computed role for 'none' was capitalized as 'None'. Bug: None Change-Id: I344ee1b5d018dac8d92f69bfcacc04631e1172e1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2828456 Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org> Reviewed-by: Shengfa Lin <shengfa@google.com> Reviewed-by: Peter Kasting <pkasting@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Aaron Leventhal <aleventhal@chromium.org> Cr-Commit-Position: refs/heads/master@{#874502}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
0588be0fb6
commit
609f569cd5
chrome
browser
resources
chromeos
accessibility
common
ui
test
chromedriver
test
content
browser
accessibility
renderer
accessibility
test
data
accessibility
fuzzer
extensions/common/api
third_party
blink
renderer
modules
accessibility
web_tests
closure_compiler
externs
ui
accessibility
ax_enum_util.ccax_enums.mojomax_node_data.ccax_role_properties.ccax_table_fuzzer.ccax_tree_unittest.cc
platform
views
accessibility
controls
widget
@ -783,7 +783,7 @@ AutomationPredicate.structuralContainer = AutomationPredicate.roles([
|
||||
Role.ALERT_DIALOG, Role.CLIENT, Role.DIALOG, Role.LAYOUT_TABLE,
|
||||
Role.LAYOUT_TABLE_CELL, Role.LAYOUT_TABLE_ROW, Role.ROOT_WEB_AREA,
|
||||
Role.WEB_VIEW, Role.WINDOW, Role.EMBEDDED_OBJECT, Role.IFRAME,
|
||||
Role.IFRAME_PRESENTATIONAL, Role.PLUGIN_OBJECT, Role.IGNORED, Role.UNKNOWN,
|
||||
Role.IFRAME_PRESENTATIONAL, Role.PLUGIN_OBJECT, Role.NONE, Role.UNKNOWN,
|
||||
Role.PANE
|
||||
]);
|
||||
|
||||
|
@ -108,7 +108,7 @@ class RatingStar : public views::ImageView {
|
||||
|
||||
// views::ImageView:
|
||||
void GetAccessibleNodeData(ui::AXNodeData* node_data) override {
|
||||
node_data->role = ax::mojom::Role::kIgnored;
|
||||
node_data->role = ax::mojom::Role::kNone;
|
||||
}
|
||||
};
|
||||
|
||||
@ -128,7 +128,7 @@ class RatingLabel : public views::Label {
|
||||
|
||||
// views::Label:
|
||||
void GetAccessibleNodeData(ui::AXNodeData* node_data) override {
|
||||
node_data->role = ax::mojom::Role::kIgnored;
|
||||
node_data->role = ax::mojom::Role::kNone;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -606,7 +606,7 @@ void ExtensionInstallDialogRatingsSectionTest::TestRatingsSectionA11y(
|
||||
for (views::View* child : rating_view->children()) {
|
||||
ui::AXNodeData node_data;
|
||||
child->GetAccessibleNodeData(&node_data);
|
||||
EXPECT_EQ(ax::mojom::Role::kIgnored, node_data.role);
|
||||
EXPECT_EQ(ax::mojom::Role::kNone, node_data.role);
|
||||
}
|
||||
|
||||
CloseAndWait(modal_dialog);
|
||||
|
@ -273,7 +273,7 @@ TabHoverCardBubbleView::~TabHoverCardBubbleView() = default;
|
||||
ax::mojom::Role TabHoverCardBubbleView::GetAccessibleWindowRole() {
|
||||
// Override the role so that hover cards are not read when they appear because
|
||||
// tabs handle accessibility text.
|
||||
return ax::mojom::Role::kIgnored;
|
||||
return ax::mojom::Role::kNone;
|
||||
}
|
||||
|
||||
void TabHoverCardBubbleView::Layout() {
|
||||
|
@ -599,7 +599,7 @@ class ChromeDriverTest(ChromeDriverBaseTestWithWebServer):
|
||||
|
||||
# GetComputedLabel for ignored node should return empty string.
|
||||
self.assertEquals(ignoredHeaderElement.GetComputedLabel(), '')
|
||||
self.assertEquals(ignoredHeaderElement.GetComputedRole(), 'Ignored')
|
||||
self.assertEquals(ignoredHeaderElement.GetComputedRole(), 'none')
|
||||
|
||||
def testGetComputedAttributesForUnrenderedNode(self):
|
||||
self._driver.Load(
|
||||
@ -610,7 +610,7 @@ class ChromeDriverTest(ChromeDriverBaseTestWithWebServer):
|
||||
|
||||
# GetComputedLabel for unrendered node should return empty string.
|
||||
self.assertEquals(unrenderedHeaderElement.GetComputedLabel(), '')
|
||||
self.assertEquals(unrenderedHeaderElement.GetComputedRole(), 'Ignored')
|
||||
self.assertEquals(unrenderedHeaderElement.GetComputedRole(), 'none')
|
||||
|
||||
def testLoadUrl(self):
|
||||
self._driver.Load(self.GetHttpUrlForFile('/chromedriver/empty.html'))
|
||||
|
@ -1365,9 +1365,6 @@ std::u16string BrowserAccessibilityAndroid::GetRoleDescription() const {
|
||||
case ax::mojom::Role::kIframePresentational:
|
||||
// No role description.
|
||||
break;
|
||||
case ax::mojom::Role::kIgnored:
|
||||
// No role description.
|
||||
break;
|
||||
case ax::mojom::Role::kImage:
|
||||
message_id = IDS_AX_ROLE_GRAPHIC;
|
||||
break;
|
||||
@ -1488,9 +1485,6 @@ std::u16string BrowserAccessibilityAndroid::GetRoleDescription() const {
|
||||
case ax::mojom::Role::kPre:
|
||||
// No role description.
|
||||
break;
|
||||
case ax::mojom::Role::kPresentational:
|
||||
// No role description.
|
||||
break;
|
||||
case ax::mojom::Role::kProgressIndicator:
|
||||
message_id = IDS_AX_ROLE_PROGRESS_INDICATOR;
|
||||
break;
|
||||
|
@ -871,7 +871,7 @@ void RenderAccessibilityImpl::SendPendingAccessibilityEvents() {
|
||||
//
|
||||
// Consider the following tree :
|
||||
// ++(0) Role::kRootWebArea
|
||||
// ++++<1> Role::kIgnored
|
||||
// ++++<1> Role::kNone
|
||||
// ++++++[2] Role::kGenericContainer <body>
|
||||
// ++++++++[3] Role::kGenericContainer with 'visibility: hidden'
|
||||
//
|
||||
|
@ -4,7 +4,7 @@ rootWebArea
|
||||
++++++splitter horizontal name='Ordinary presentation element with id'
|
||||
++++++splitter horizontal name='An aria-owned element is never ignored'
|
||||
++++++group
|
||||
++++++++presentational ignored
|
||||
++++++++none ignored
|
||||
++++++++++button name='button-in-owned-tree'
|
||||
++++++++++++staticText name='button-in-owned-tree'
|
||||
++++++++++++++inlineTextBox name='button-in-owned-tree'
|
||||
@ -17,5 +17,5 @@ rootWebArea
|
||||
++++++++checkBox checkedState=false
|
||||
++++++splitter horizontal name='All the above in one'
|
||||
++++++genericContainer
|
||||
++++++++presentational ignored
|
||||
++++++++none ignored
|
||||
++++++++++slider horizontal value='50' valueForRange=50.00 minValueForRange=0.00 maxValueForRange=100.00
|
@ -4,6 +4,6 @@ rootWebArea language='en-US'
|
||||
++++++paragraph language='es-ES'
|
||||
++++++++staticText language='es-ES' name='Espanyol'
|
||||
++++++++++inlineTextBox language='es-ES' name='Espanyol'
|
||||
++++++presentational ignored language='fr-FR'
|
||||
++++++none ignored language='fr-FR'
|
||||
++++++++staticText language='fr-FR' name='Comment allez-vous?'
|
||||
++++++++++inlineTextBox language='fr-FR' name='Comment allez-vous?'
|
||||
|
@ -1,7 +1,7 @@
|
||||
rootWebArea name='Table with role=presentation'
|
||||
++genericContainer ignored
|
||||
++++genericContainer ignored
|
||||
++++++presentational ignored
|
||||
++++++none ignored
|
||||
++++++++genericContainer ignored
|
||||
++++++++++genericContainer ignored
|
||||
++++++++++++genericContainer
|
||||
|
@ -25,7 +25,7 @@ ax::mojom::Role GetInterestingRole(FuzzedDataProvider& fdp) {
|
||||
switch (fdp.ConsumeIntegralInRange(0, 12)) {
|
||||
default:
|
||||
case 0:
|
||||
return ax::mojom::Role::kIgnored;
|
||||
return ax::mojom::Role::kNone;
|
||||
case 1:
|
||||
return ax::mojom::Role::kStaticText;
|
||||
case 2:
|
||||
|
@ -242,7 +242,6 @@
|
||||
heading,
|
||||
iframe,
|
||||
iframePresentational,
|
||||
ignored,
|
||||
image,
|
||||
imeCandidate,
|
||||
inlineTextBox,
|
||||
@ -284,7 +283,6 @@
|
||||
popUpButton,
|
||||
portal,
|
||||
pre,
|
||||
presentational,
|
||||
progressIndicator,
|
||||
radioButton,
|
||||
radioGroup,
|
||||
|
@ -201,7 +201,6 @@ bool IsValidRole(ax::mojom::blink::Role role) {
|
||||
case ax::mojom::blink::Role::kColumn:
|
||||
case ax::mojom::blink::Role::kDesktop:
|
||||
case ax::mojom::blink::Role::kKeyboard:
|
||||
case ax::mojom::blink::Role::kIgnored:
|
||||
case ax::mojom::blink::Role::kImeCandidate:
|
||||
case ax::mojom::blink::Role::kListGrid:
|
||||
case ax::mojom::blink::Role::kPane:
|
||||
@ -348,11 +347,14 @@ const RoleEntry kAriaRoles[] = {
|
||||
{"mark", ax::mojom::blink::Role::kMark},
|
||||
{"meter", ax::mojom::blink::Role::kMeter},
|
||||
{"navigation", ax::mojom::blink::Role::kNavigation},
|
||||
// role="presentation" is the same as role="none".
|
||||
{"presentation", ax::mojom::blink::Role::kNone},
|
||||
// role="none" is listed after role="presentation", so that it is the
|
||||
// canonical name in devtools and tests.
|
||||
{"none", ax::mojom::blink::Role::kNone},
|
||||
{"note", ax::mojom::blink::Role::kNote},
|
||||
{"option", ax::mojom::blink::Role::kListBoxOption},
|
||||
{"paragraph", ax::mojom::blink::Role::kParagraph},
|
||||
{"presentation", ax::mojom::blink::Role::kPresentational},
|
||||
{"progressbar", ax::mojom::blink::Role::kProgressIndicator},
|
||||
{"radio", ax::mojom::blink::Role::kRadioButton},
|
||||
{"radiogroup", ax::mojom::blink::Role::kRadioGroup},
|
||||
@ -5060,7 +5062,6 @@ bool AXObject::SupportsNameFromContents(bool recursive) const {
|
||||
case ax::mojom::blink::Role::kNone:
|
||||
case ax::mojom::blink::Role::kParagraph:
|
||||
case ax::mojom::blink::Role::kPre:
|
||||
case ax::mojom::blink::Role::kPresentational:
|
||||
case ax::mojom::blink::Role::kRegion:
|
||||
// Spec says we should always expose the name on rows,
|
||||
// but for performance reasons we only do it
|
||||
@ -5131,7 +5132,6 @@ bool AXObject::SupportsNameFromContents(bool recursive) const {
|
||||
case ax::mojom::blink::Role::kColumn:
|
||||
case ax::mojom::blink::Role::kDesktop:
|
||||
case ax::mojom::blink::Role::kKeyboard:
|
||||
case ax::mojom::blink::Role::kIgnored:
|
||||
case ax::mojom::blink::Role::kImeCandidate:
|
||||
case ax::mojom::blink::Role::kListGrid:
|
||||
case ax::mojom::blink::Role::kPane:
|
||||
|
@ -605,7 +605,7 @@ std::unique_ptr<AXNode> InspectorAccessibilityAgent::BuildObjectForIgnoredNode(
|
||||
.setNodeId(String::Number(ax_id))
|
||||
.setIgnored(true)
|
||||
.build();
|
||||
ax::mojom::Role role = ax::mojom::Role::kIgnored;
|
||||
ax::mojom::blink::Role role = ax::mojom::blink::Role::kNone;
|
||||
ignored_node_object->setRole(CreateRoleNameValue(role));
|
||||
|
||||
if (ax_object && ax_object->IsAXLayoutObject()) {
|
||||
|
@ -28,7 +28,7 @@ test(function(t) {
|
||||
// contents.
|
||||
assert_equals(axRoot.childrenCount, 1);
|
||||
assert_equals(axRoot.childAtIndex(0).role, 'AXRole: AXGenericContainer');
|
||||
assert_equals(axParent.childAtIndex(0).role, 'AXRole: AXPresentational');
|
||||
assert_equals(axParent.childAtIndex(0).role, 'AXRole: AXNone');
|
||||
}, 'Aria-owns cannot be fooled by pointing it at a presentational node.');
|
||||
|
||||
</script>
|
||||
|
@ -74,7 +74,7 @@ PASS implicitRoleElement.computedRole is "navigation"
|
||||
PASS roleElement.computedRole is "option"
|
||||
PASS implicitRoleElement.computedRole is "option"
|
||||
PASS implicitRoleElement.computedRole is "option"
|
||||
PASS roleElement.computedRole is "presentation"
|
||||
PASS roleElement.computedRole is "none"
|
||||
PASS roleElement.computedRole is "progressbar"
|
||||
PASS implicitRoleElement.computedRole is "progressbar"
|
||||
PASS roleElement.computedRole is "meter"
|
||||
|
@ -142,8 +142,8 @@
|
||||
<option value="2" data-role="option">Second</option>
|
||||
</select>
|
||||
|
||||
<div role="presentation">This is presentation</div>
|
||||
<nav role="presentation">This is presentation, too</nav>
|
||||
<div role="none">This is none/presentation</div>
|
||||
<nav role="none">This is none/presentation, too</nav>
|
||||
|
||||
<div role="progressbar">This is a progressbar</div>
|
||||
<progress data-role="progressbar" max="100">10</progress>
|
||||
|
@ -53,7 +53,7 @@ AXRole: AXGenericContainer
|
||||
AXRole: AXGenericContainer
|
||||
AXRole: AXStaticText "These two tables have static text roles because they have presentation roles."
|
||||
AXRole: AXInlineTextBox "These two tables have static text roles because they have presentation roles."
|
||||
AXRole: AXPresentational
|
||||
AXRole: AXNone
|
||||
AXRole: AXGenericContainer
|
||||
AXRole: AXGenericContainer
|
||||
AXRole: AXGenericContainer
|
||||
@ -64,7 +64,7 @@ AXRole: AXGenericContainer
|
||||
AXRole: AXGenericContainer
|
||||
AXRole: AXStaticText "Presentation th"
|
||||
AXRole: AXInlineTextBox "Presentation th"
|
||||
AXRole: AXPresentational
|
||||
AXRole: AXNone
|
||||
AXRole: AXGenericContainer
|
||||
AXRole: AXGenericContainer
|
||||
AXRole: AXGenericContainer
|
||||
@ -75,7 +75,7 @@ AXRole: AXGenericContainer
|
||||
AXRole: AXInlineTextBox "The "Presentation th" has a static text role because it has a presentation role."
|
||||
AXRole: AXTable
|
||||
AXRole: AXRowGroup
|
||||
AXRole: AXPresentational
|
||||
AXRole: AXNone
|
||||
AXRole: AXGenericContainer
|
||||
AXRole: AXStaticText "Presentation th"
|
||||
AXRole: AXInlineTextBox "Presentation th"
|
||||
@ -86,7 +86,7 @@ AXRole: AXGenericContainer
|
||||
AXRole: AXGenericContainer
|
||||
AXRole: AXStaticText "The row for "Explicit th" has a row role even if table has a presentation role because it has an explicit role."
|
||||
AXRole: AXInlineTextBox "The row for "Explicit th" has a row role even if table has a presentation role because it has an explicit role."
|
||||
AXRole: AXPresentational
|
||||
AXRole: AXNone
|
||||
AXRole: AXGenericContainer
|
||||
AXRole: AXRow
|
||||
AXRole: AXGenericContainer
|
||||
|
@ -13,8 +13,8 @@ Tests that node without AXNode reports accessibility values.
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@ Tests that fetching the tree for a node without an AXNode functions correctly.
|
||||
RootWebArea
|
||||
main
|
||||
article
|
||||
*Ignored
|
||||
*none
|
||||
{
|
||||
domNode : div#hidden
|
||||
ignored : true
|
||||
@ -18,8 +18,8 @@ RootWebArea
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
Tests accessibility values of ignored nodes.
|
||||
|
||||
RootWebArea
|
||||
*Ignored
|
||||
*none
|
||||
{
|
||||
domNode : html
|
||||
ignored : true
|
||||
@ -9,14 +9,14 @@ RootWebArea
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
RootWebArea
|
||||
img
|
||||
*Ignored
|
||||
*none
|
||||
{
|
||||
domNode : svg
|
||||
ignored : true
|
||||
@ -35,13 +35,13 @@ RootWebArea
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
RootWebArea
|
||||
*Ignored
|
||||
*none
|
||||
{
|
||||
domNode : div
|
||||
ignored : true
|
||||
@ -56,13 +56,13 @@ RootWebArea
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
RootWebArea
|
||||
*Ignored
|
||||
*none
|
||||
{
|
||||
domNode : div
|
||||
ignored : true
|
||||
@ -81,13 +81,13 @@ RootWebArea
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
RootWebArea
|
||||
*Ignored
|
||||
*none
|
||||
{
|
||||
domNode : ol
|
||||
ignored : true
|
||||
@ -102,13 +102,13 @@ RootWebArea
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
RootWebArea
|
||||
*Ignored
|
||||
*none
|
||||
{
|
||||
domNode : li
|
||||
ignored : true
|
||||
@ -123,8 +123,8 @@ RootWebArea
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@ RootWebArea
|
||||
|
||||
RootWebArea
|
||||
LabelText
|
||||
*Ignored
|
||||
*none
|
||||
{
|
||||
domNode : span
|
||||
ignored : true
|
||||
@ -211,13 +211,13 @@ RootWebArea
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
RootWebArea
|
||||
*Ignored
|
||||
*none
|
||||
{
|
||||
domNode : div
|
||||
ignored : true
|
||||
@ -232,13 +232,13 @@ RootWebArea
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
RootWebArea
|
||||
*Ignored
|
||||
*none
|
||||
{
|
||||
domNode : span
|
||||
ignored : true
|
||||
@ -253,13 +253,13 @@ RootWebArea
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
RootWebArea
|
||||
*Ignored
|
||||
*none
|
||||
{
|
||||
domNode : canvas
|
||||
ignored : true
|
||||
@ -274,13 +274,13 @@ RootWebArea
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
RootWebArea
|
||||
*Ignored
|
||||
*none
|
||||
{
|
||||
domNode : canvas
|
||||
ignored : true
|
||||
@ -295,8 +295,8 @@ RootWebArea
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
@ -417,7 +417,7 @@ RootWebArea
|
||||
}
|
||||
|
||||
RootWebArea
|
||||
*Ignored
|
||||
*none
|
||||
{
|
||||
domNode : button
|
||||
ignored : true
|
||||
@ -432,13 +432,13 @@ RootWebArea
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
RootWebArea
|
||||
*Ignored
|
||||
*none
|
||||
{
|
||||
domNode : button
|
||||
ignored : true
|
||||
@ -458,8 +458,8 @@ RootWebArea
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
@ -506,7 +506,7 @@ RootWebArea
|
||||
}
|
||||
|
||||
RootWebArea
|
||||
*Ignored
|
||||
*none
|
||||
{
|
||||
domNode : div
|
||||
ignored : true
|
||||
@ -521,8 +521,8 @@ RootWebArea
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,8 +17,8 @@ Tests accessibility values of ignored nodes in model dialog.
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
{
|
||||
|
@ -196,8 +196,8 @@ Tests accessibility values in modal dialog.
|
||||
]
|
||||
nodeId : <string>
|
||||
role : {
|
||||
type : internalRole
|
||||
value : Ignored
|
||||
type : role
|
||||
value : none
|
||||
}
|
||||
}
|
||||
{
|
||||
|
@ -241,7 +241,6 @@ chrome.automation.RoleType = {
|
||||
HEADING: 'heading',
|
||||
IFRAME: 'iframe',
|
||||
IFRAME_PRESENTATIONAL: 'iframePresentational',
|
||||
IGNORED: 'ignored',
|
||||
IMAGE: 'image',
|
||||
IME_CANDIDATE: 'imeCandidate',
|
||||
INLINE_TEXT_BOX: 'inlineTextBox',
|
||||
@ -274,6 +273,7 @@ chrome.automation.RoleType = {
|
||||
MENU_LIST_POPUP: 'menuListPopup',
|
||||
METER: 'meter',
|
||||
NAVIGATION: 'navigation',
|
||||
NONE: 'none',
|
||||
NOTE: 'note',
|
||||
PANE: 'pane',
|
||||
PARAGRAPH: 'paragraph',
|
||||
@ -283,7 +283,6 @@ chrome.automation.RoleType = {
|
||||
POP_UP_BUTTON: 'popUpButton',
|
||||
PORTAL: 'portal',
|
||||
PRE: 'pre',
|
||||
PRESENTATIONAL: 'presentational',
|
||||
PROGRESS_INDICATOR: 'progressIndicator',
|
||||
RADIO_BUTTON: 'radioButton',
|
||||
RADIO_GROUP: 'radioGroup',
|
||||
|
@ -338,8 +338,6 @@ const char* ToString(ax::mojom::Role role) {
|
||||
return "iframe";
|
||||
case ax::mojom::Role::kIframePresentational:
|
||||
return "iframePresentational";
|
||||
case ax::mojom::Role::kIgnored:
|
||||
return "ignored";
|
||||
case ax::mojom::Role::kImage:
|
||||
return "image";
|
||||
case ax::mojom::Role::kImeCandidate:
|
||||
@ -422,8 +420,6 @@ const char* ToString(ax::mojom::Role role) {
|
||||
return "portal";
|
||||
case ax::mojom::Role::kPre:
|
||||
return "pre";
|
||||
case ax::mojom::Role::kPresentational:
|
||||
return "presentational";
|
||||
case ax::mojom::Role::kProgressIndicator:
|
||||
return "progressIndicator";
|
||||
case ax::mojom::Role::kRadioButton:
|
||||
|
@ -102,7 +102,7 @@ enum Event {
|
||||
//
|
||||
// Native: this attribute is only used in native UI.
|
||||
enum Role {
|
||||
kNone,
|
||||
kNone, // Used for role="none"/"presentation" -- ignored in platform tree.
|
||||
kAbbr,
|
||||
kAlert,
|
||||
kAlertDialog,
|
||||
@ -212,7 +212,6 @@ enum Role {
|
||||
kHeading,
|
||||
kIframe,
|
||||
kIframePresentational,
|
||||
kIgnored,
|
||||
kImage,
|
||||
kImeCandidate,
|
||||
kInlineTextBox,
|
||||
@ -257,7 +256,6 @@ enum Role {
|
||||
kPopUpButton,
|
||||
kPortal,
|
||||
kPre,
|
||||
kPresentational,
|
||||
kProgressIndicator,
|
||||
kRadioButton,
|
||||
kRadioGroup,
|
||||
|
@ -984,8 +984,7 @@ bool AXNodeData::IsSelectable() const {
|
||||
}
|
||||
|
||||
bool AXNodeData::IsIgnored() const {
|
||||
return HasState(ax::mojom::State::kIgnored) ||
|
||||
role == ax::mojom::Role::kIgnored;
|
||||
return HasState(ax::mojom::State::kIgnored) || role == ax::mojom::Role::kNone;
|
||||
}
|
||||
|
||||
bool AXNodeData::IsInvisible() const {
|
||||
|
@ -206,7 +206,6 @@ bool IsControlOnAndroid(const ax::mojom::Role role, bool isFocusable) {
|
||||
case ax::mojom::Role::kDialog:
|
||||
case ax::mojom::Role::kMenu:
|
||||
case ax::mojom::Role::kMenuBar:
|
||||
case ax::mojom::Role::kNone:
|
||||
case ax::mojom::Role::kTree:
|
||||
case ax::mojom::Role::kUnknown:
|
||||
return false;
|
||||
@ -408,7 +407,6 @@ bool IsPlatformDocument(const ax::mojom::Role role) {
|
||||
bool IsPresentational(const ax::mojom::Role role) {
|
||||
switch (role) {
|
||||
case ax::mojom::Role::kNone:
|
||||
case ax::mojom::Role::kPresentational:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@ -638,7 +636,6 @@ bool IsStructure(const ax::mojom::Role role) {
|
||||
case ax::mojom::Role::kApplication:
|
||||
case ax::mojom::Role::kArticle: // Subclass of kDocument.
|
||||
case ax::mojom::Role::kDocument:
|
||||
case ax::mojom::Role::kPresentational:
|
||||
case ax::mojom::Role::kRowGroup:
|
||||
case ax::mojom::Role::kSplitter:
|
||||
// Dpub roles.
|
||||
|
@ -36,7 +36,7 @@ ax::mojom::Role GetInterestingTableRole(unsigned char byte) {
|
||||
case 10:
|
||||
return ax::mojom::Role::kGenericContainer;
|
||||
case 11:
|
||||
return ax::mojom::Role::kIgnored;
|
||||
return ax::mojom::Role::kNone;
|
||||
case 12:
|
||||
return ax::mojom::Role::kLayoutTable;
|
||||
case 13:
|
||||
|
@ -3503,7 +3503,7 @@ TEST(AXTreeTest, SetSizePosInSetNestedContainer) {
|
||||
tree_update.nodes[3].id = 4;
|
||||
tree_update.nodes[3].role = ax::mojom::Role::kListItem; // 2 of 4
|
||||
tree_update.nodes[4].id = 5;
|
||||
tree_update.nodes[4].role = ax::mojom::Role::kIgnored;
|
||||
tree_update.nodes[4].role = ax::mojom::Role::kNone;
|
||||
tree_update.nodes[4].child_ids = {6};
|
||||
tree_update.nodes[5].id = 6;
|
||||
tree_update.nodes[5].role = ax::mojom::Role::kListItem; // 3 of 4
|
||||
|
@ -2800,8 +2800,6 @@ AtkRole AXPlatformNodeAuraLinux::GetAtkRole() const {
|
||||
case ax::mojom::Role::kIframe:
|
||||
case ax::mojom::Role::kIframePresentational:
|
||||
return ATK_ROLE_INTERNAL_FRAME;
|
||||
case ax::mojom::Role::kIgnored:
|
||||
return ATK_ROLE_REDUNDANT_OBJECT;
|
||||
case ax::mojom::Role::kImage:
|
||||
return IsImageWithMap() ? ATK_ROLE_IMAGE_MAP : ATK_ROLE_IMAGE;
|
||||
case ax::mojom::Role::kInlineTextBox:
|
||||
@ -3024,7 +3022,6 @@ AtkRole AXPlatformNodeAuraLinux::GetAtkRole() const {
|
||||
case ax::mojom::Role::kImeCandidate:
|
||||
case ax::mojom::Role::kKeyboard:
|
||||
case ax::mojom::Role::kNone:
|
||||
case ax::mojom::Role::kPresentational:
|
||||
return ATK_ROLE_REDUNDANT_OBJECT;
|
||||
}
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ TEST(AXPlatformNodeBaseTest, InnerTextIgnoresInvisibleAndIgnored) {
|
||||
SetIsInvisible(&tree, 2, false);
|
||||
EXPECT_EQ(root->GetInnerText(), u"abde");
|
||||
|
||||
SetRole(&tree, 2, ax::mojom::Role::kIgnored);
|
||||
SetRole(&tree, 2, ax::mojom::Role::kNone);
|
||||
EXPECT_EQ(root->GetInnerText(), u"bde");
|
||||
|
||||
SetRole(&tree, 2, ax::mojom::Role::kStaticText);
|
||||
@ -196,7 +196,7 @@ TEST(AXPlatformNodeBaseTest, InnerTextIgnoresInvisibleAndIgnored) {
|
||||
SetIsInvisible(&tree, 4, true);
|
||||
EXPECT_EQ(root->GetInnerText(), u"abde");
|
||||
|
||||
SetRole(&tree, 4, ax::mojom::Role::kIgnored);
|
||||
SetRole(&tree, 4, ax::mojom::Role::kNone);
|
||||
EXPECT_EQ(root->GetInnerText(), u"abde");
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,6 @@ RoleMap BuildRoleMap() {
|
||||
{ax::mojom::Role::kHeading, @"AXHeading"},
|
||||
{ax::mojom::Role::kIframe, NSAccessibilityGroupRole},
|
||||
{ax::mojom::Role::kIframePresentational, NSAccessibilityGroupRole},
|
||||
{ax::mojom::Role::kIgnored, NSAccessibilityUnknownRole},
|
||||
{ax::mojom::Role::kImage, NSAccessibilityImageRole},
|
||||
{ax::mojom::Role::kInputTime, @"AXTimeField"},
|
||||
{ax::mojom::Role::kLabelText, NSAccessibilityGroupRole},
|
||||
@ -178,7 +177,6 @@ RoleMap BuildRoleMap() {
|
||||
{ax::mojom::Role::kPopUpButton, NSAccessibilityPopUpButtonRole},
|
||||
{ax::mojom::Role::kPortal, NSAccessibilityButtonRole},
|
||||
{ax::mojom::Role::kPre, NSAccessibilityGroupRole},
|
||||
{ax::mojom::Role::kPresentational, NSAccessibilityGroupRole},
|
||||
{ax::mojom::Role::kProgressIndicator,
|
||||
NSAccessibilityProgressIndicatorRole},
|
||||
{ax::mojom::Role::kRadioButton, NSAccessibilityRadioButtonRole},
|
||||
|
@ -5599,10 +5599,8 @@ int AXPlatformNodeWin::MSAARole() {
|
||||
return ROLE_SYSTEM_PANE;
|
||||
|
||||
case ax::mojom::Role::kImeCandidate:
|
||||
case ax::mojom::Role::kIgnored:
|
||||
case ax::mojom::Role::kKeyboard:
|
||||
case ax::mojom::Role::kNone:
|
||||
case ax::mojom::Role::kPresentational:
|
||||
case ax::mojom::Role::kUnknown:
|
||||
return ROLE_SYSTEM_PANE;
|
||||
}
|
||||
@ -6439,9 +6437,7 @@ std::wstring AXPlatformNodeWin::UIAAriaRole() {
|
||||
|
||||
case ax::mojom::Role::kPane:
|
||||
case ax::mojom::Role::kWindow:
|
||||
case ax::mojom::Role::kIgnored:
|
||||
case ax::mojom::Role::kNone:
|
||||
case ax::mojom::Role::kPresentational:
|
||||
case ax::mojom::Role::kUnknown:
|
||||
return L"region";
|
||||
}
|
||||
@ -7098,11 +7094,9 @@ LONG AXPlatformNodeWin::ComputeUIAControlType() { // NOLINT(runtime/int)
|
||||
|
||||
case ax::mojom::Role::kPane:
|
||||
case ax::mojom::Role::kWindow:
|
||||
case ax::mojom::Role::kIgnored:
|
||||
case ax::mojom::Role::kImeCandidate:
|
||||
case ax::mojom::Role::kKeyboard:
|
||||
case ax::mojom::Role::kNone:
|
||||
case ax::mojom::Role::kPresentational:
|
||||
case ax::mojom::Role::kUnknown:
|
||||
return UIA_PaneControlTypeId;
|
||||
}
|
||||
|
@ -585,7 +585,7 @@ TEST_F(AXVirtualViewTest, TreeNavigationWithIgnoredVirtualViews) {
|
||||
virtual_child_2->ChildAtIndex(1));
|
||||
|
||||
// Try ignoring a node by changing its role, instead of its state.
|
||||
virtual_child_2->GetCustomData().role = ax::mojom::Role::kIgnored;
|
||||
virtual_child_2->GetCustomData().role = ax::mojom::Role::kNone;
|
||||
|
||||
EXPECT_EQ(button_->GetNativeViewAccessible(), virtual_label_->GetParent());
|
||||
EXPECT_EQ(virtual_label_->GetNativeObject(), virtual_child_1->GetParent());
|
||||
|
@ -35,7 +35,6 @@ bool IsValidRoleForViews(ax::mojom::Role role) {
|
||||
case ax::mojom::Role::kDocument: // Used for ARIA role="document".
|
||||
case ax::mojom::Role::kIframe:
|
||||
case ax::mojom::Role::kIframePresentational:
|
||||
case ax::mojom::Role::kNone:
|
||||
case ax::mojom::Role::kPdfRoot:
|
||||
case ax::mojom::Role::kPortal:
|
||||
case ax::mojom::Role::kRootWebArea:
|
||||
|
@ -180,7 +180,7 @@ void ImageView::OnPaint(gfx::Canvas* canvas) {
|
||||
void ImageView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
const std::u16string& name = GetAccessibleName();
|
||||
if (name.empty()) {
|
||||
node_data->role = ax::mojom::Role::kIgnored;
|
||||
node_data->role = ax::mojom::Role::kNone;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ void Link::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
Label::GetAccessibleNodeData(node_data);
|
||||
// Prevent invisible links from being announced by screen reader.
|
||||
node_data->role =
|
||||
GetText().empty() ? ax::mojom::Role::kIgnored : ax::mojom::Role::kLink;
|
||||
GetText().empty() ? ax::mojom::Role::kNone : ax::mojom::Role::kLink;
|
||||
}
|
||||
|
||||
void Link::OnFocus() {
|
||||
|
@ -295,7 +295,7 @@ void MenuScrollViewContainer::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
// number of items inside it, we ignore the MenuScrollViewContainer (which
|
||||
// holds the menu itself: the SubmenuView).
|
||||
#if defined(OS_MAC)
|
||||
node_data->role = ax::mojom::Role::kIgnored;
|
||||
node_data->role = ax::mojom::Role::kNone;
|
||||
#else
|
||||
node_data->role = ax::mojom::Role::kMenuBar;
|
||||
#endif
|
||||
|
@ -310,7 +310,7 @@ TabStrip::TabStrip(TabbedPane::Orientation orientation,
|
||||
}
|
||||
SetLayoutManager(std::move(layout));
|
||||
|
||||
GetViewAccessibility().OverrideRole(ax::mojom::Role::kIgnored);
|
||||
GetViewAccessibility().OverrideRole(ax::mojom::Role::kNone);
|
||||
|
||||
// These durations are taken from the Paper Tabs source:
|
||||
// https://github.com/PolymerElements/paper-tabs/blob/master/paper-tabs.html
|
||||
|
@ -271,7 +271,7 @@ TEST_F(AXNativeWidgetMacTest, ChildrenAttribute) {
|
||||
|
||||
// Check ignored children don't show up in the accessibility tree.
|
||||
widget()->GetContentsView()->AddChildView(
|
||||
new FlexibleRoleTestView(ax::mojom::Role::kIgnored));
|
||||
new FlexibleRoleTestView(ax::mojom::Role::kNone));
|
||||
EXPECT_EQ(kNumChildren, ax_node.accessibilityChildren.count);
|
||||
}
|
||||
|
||||
@ -303,7 +303,7 @@ TEST_F(AXNativeWidgetMacTest, ParentAttribute) {
|
||||
EXPECT_NSEQ(NSAccessibilityGroupRole, ax_parent.accessibilityRole);
|
||||
|
||||
// Test an ignored role parent is skipped in favor of the grandparent.
|
||||
parent->set_role(ax::mojom::Role::kIgnored);
|
||||
parent->set_role(ax::mojom::Role::kNone);
|
||||
ASSERT_NSNE(nil, AXParentOf(ax_child));
|
||||
EXPECT_NSEQ(NSAccessibilityGroupRole, AXParentOf(ax_child).accessibilityRole);
|
||||
}
|
||||
|
Reference in New Issue
Block a user