Commit 0cbc466d authored by Ionel Popescu's avatar Ionel Popescu Committed by Commit Bot

Revert "Update the aria role for datalist and its options to match the spec."

This reverts commit ee4b369d.

Reason for revert: the change caused an issue on ChromeOS where the autofill suggestions are not being read.

Original change's description:
> Update the aria role for datalist and its options to match the spec.
> 
> According to https://w3c.github.io/html-aam/#el-datalist the aria role for
> datalist should be listbox (currently it is menu).
> 
> For datalist options according to https://w3c.github.io/html-aam/#el-option the aria
> role should be option (currently it is menuitem).
> 
> The unit test is also updated to use the new aria roles.
> 
> Bug: 1011133
> Change-Id: Ia3541067e3d8ada622c5c3776f3b1b0ce0a26c54
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1838997
> Reviewed-by: Akihiro Ota <akihiroota@chromium.org>
> Reviewed-by: David Tseng <dtseng@chromium.org>
> Reviewed-by: Evan Stade <estade@chromium.org>
> Commit-Queue: Ionel Popescu <iopopesc@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#706495}

TBR=dtseng@chromium.org,estade@chromium.org,akihiroota@chromium.org,iopopesc@microsoft.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1037649
Change-Id: Ib12a558f70972a28514c943f020f91a7c562c091
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2042230Reviewed-by: default avatarIonel Popescu <iopopesc@microsoft.com>
Commit-Queue: Ionel Popescu <iopopesc@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#738982}
parent c4e65bf7
...@@ -372,7 +372,7 @@ void AutofillPopupItemView::GetAccessibleNodeData(ui::AXNodeData* node_data) { ...@@ -372,7 +372,7 @@ void AutofillPopupItemView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
node_data->SetName(base::JoinString(text, base::ASCIIToUTF16(" "))); node_data->SetName(base::JoinString(text, base::ASCIIToUTF16(" ")));
// Options are selectable. // Options are selectable.
node_data->role = ax::mojom::Role::kListBoxOption; node_data->role = ax::mojom::Role::kMenuItem;
node_data->AddBoolAttribute(ax::mojom::BoolAttribute::kSelected, node_data->AddBoolAttribute(ax::mojom::BoolAttribute::kSelected,
is_selected()); is_selected());
...@@ -991,7 +991,7 @@ AutofillPopupViewNativeViews::~AutofillPopupViewNativeViews() {} ...@@ -991,7 +991,7 @@ AutofillPopupViewNativeViews::~AutofillPopupViewNativeViews() {}
void AutofillPopupViewNativeViews::GetAccessibleNodeData( void AutofillPopupViewNativeViews::GetAccessibleNodeData(
ui::AXNodeData* node_data) { ui::AXNodeData* node_data) {
node_data->role = ax::mojom::Role::kListBox; node_data->role = ax::mojom::Role::kMenu;
// If controller_ is valid, then the view is expanded. // If controller_ is valid, then the view is expanded.
if (controller_) { if (controller_) {
node_data->AddState(ax::mojom::State::kExpanded); node_data->AddState(ax::mojom::State::kExpanded);
......
...@@ -175,7 +175,7 @@ TEST_F(AutofillPopupViewNativeViewsTest, AccessibilityTest) { ...@@ -175,7 +175,7 @@ TEST_F(AutofillPopupViewNativeViewsTest, AccessibilityTest) {
// Item 0. // Item 0.
ui::AXNodeData node_data_0; ui::AXNodeData node_data_0;
view()->GetRowsForTesting()[0]->GetAccessibleNodeData(&node_data_0); view()->GetRowsForTesting()[0]->GetAccessibleNodeData(&node_data_0);
EXPECT_EQ(ax::mojom::Role::kListBoxOption, node_data_0.role); EXPECT_EQ(ax::mojom::Role::kMenuItem, node_data_0.role);
EXPECT_EQ(1, node_data_0.GetIntAttribute(ax::mojom::IntAttribute::kPosInSet)); EXPECT_EQ(1, node_data_0.GetIntAttribute(ax::mojom::IntAttribute::kPosInSet));
EXPECT_EQ(3, node_data_0.GetIntAttribute(ax::mojom::IntAttribute::kSetSize)); EXPECT_EQ(3, node_data_0.GetIntAttribute(ax::mojom::IntAttribute::kSetSize));
EXPECT_TRUE( EXPECT_TRUE(
...@@ -195,7 +195,7 @@ TEST_F(AutofillPopupViewNativeViewsTest, AccessibilityTest) { ...@@ -195,7 +195,7 @@ TEST_F(AutofillPopupViewNativeViewsTest, AccessibilityTest) {
view()->GetRowsForTesting()[2]->GetAccessibleNodeData(&node_data_2); view()->GetRowsForTesting()[2]->GetAccessibleNodeData(&node_data_2);
EXPECT_EQ(2, node_data_2.GetIntAttribute(ax::mojom::IntAttribute::kPosInSet)); EXPECT_EQ(2, node_data_2.GetIntAttribute(ax::mojom::IntAttribute::kPosInSet));
EXPECT_EQ(3, node_data_2.GetIntAttribute(ax::mojom::IntAttribute::kSetSize)); EXPECT_EQ(3, node_data_2.GetIntAttribute(ax::mojom::IntAttribute::kSetSize));
EXPECT_EQ(ax::mojom::Role::kListBoxOption, node_data_2.role); EXPECT_EQ(ax::mojom::Role::kMenuItem, node_data_2.role);
EXPECT_FALSE( EXPECT_FALSE(
node_data_2.GetBoolAttribute(ax::mojom::BoolAttribute::kSelected)); node_data_2.GetBoolAttribute(ax::mojom::BoolAttribute::kSelected));
...@@ -204,7 +204,7 @@ TEST_F(AutofillPopupViewNativeViewsTest, AccessibilityTest) { ...@@ -204,7 +204,7 @@ TEST_F(AutofillPopupViewNativeViewsTest, AccessibilityTest) {
view()->GetRowsForTesting()[3]->GetAccessibleNodeData(&node_data_3); view()->GetRowsForTesting()[3]->GetAccessibleNodeData(&node_data_3);
EXPECT_EQ(3, node_data_3.GetIntAttribute(ax::mojom::IntAttribute::kPosInSet)); EXPECT_EQ(3, node_data_3.GetIntAttribute(ax::mojom::IntAttribute::kPosInSet));
EXPECT_EQ(3, node_data_3.GetIntAttribute(ax::mojom::IntAttribute::kSetSize)); EXPECT_EQ(3, node_data_3.GetIntAttribute(ax::mojom::IntAttribute::kSetSize));
EXPECT_EQ(ax::mojom::Role::kListBoxOption, node_data_3.role); EXPECT_EQ(ax::mojom::Role::kMenuItem, node_data_3.role);
EXPECT_FALSE( EXPECT_FALSE(
node_data_3.GetBoolAttribute(ax::mojom::BoolAttribute::kSelected)); node_data_3.GetBoolAttribute(ax::mojom::BoolAttribute::kSelected));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment