diff --git a/third_party/accessibility/ax/ax_node_position_unittest.cc b/third_party/accessibility/ax/ax_node_position_unittest.cc index 8eb318b3ef037..18677f3697eae 100644 --- a/third_party/accessibility/ax/ax_node_position_unittest.cc +++ b/third_party/accessibility/ax/ax_node_position_unittest.cc @@ -297,6 +297,7 @@ void AXPositionTest::SetUp() { true); text_field_.AddState(ax::mojom::State::kEditable); text_field_.SetValue(TEXT_VALUE); + text_field_.SetName(TEXT_VALUE); text_field_.AddIntListAttribute( ax::mojom::IntListAttribute::kCachedLineStarts, std::vector{0, 7}); @@ -1078,7 +1079,7 @@ TEST_F(AXPositionTest, GetMaxTextOffsetAndGetTextWithGeneratedContent) { root_1.role = ax::mojom::Role::kRootWebArea; root_1.child_ids = {text_field_2.id}; - text_field_2.role = ax::mojom::Role::kTextField; + text_field_2.role = ax::mojom::Role::kGroup; text_field_2.SetValue("3.14"); text_field_2.child_ids = {static_text_3.id, static_text_5.id}; @@ -1573,7 +1574,7 @@ TEST_F(AXPositionTest, AtStartAndEndOfLineInsideTextField) { AXNodeData text_field_data_1; text_field_data_1.id = 2; - text_field_data_1.role = ax::mojom::Role::kTextField; + text_field_data_1.role = ax::mojom::Role::kGroup; // "kIsLineBreakingObject" and the "kEditable" state are not strictly // necessary but are added for completeness. text_field_data_1.AddBoolAttribute( @@ -1613,7 +1614,7 @@ TEST_F(AXPositionTest, AtStartAndEndOfLineInsideTextField) { AXNodeData text_field_data_2; text_field_data_2.id = 7; - text_field_data_2.role = ax::mojom::Role::kTextField; + text_field_data_2.role = ax::mojom::Role::kGroup; // "kIsLineBreakingObject" and the "kEditable" state are not strictly // necessary but are added for completeness. text_field_data_2.AddBoolAttribute( @@ -7567,7 +7568,7 @@ TEST_F(AXPositionTest, EmptyObjectReplacedByCharacterTextNavigation) { inline_box_3.AddIntListAttribute(ax::mojom::IntListAttribute::kWordEnds, std::vector{6}); - text_field_4.role = ax::mojom::Role::kTextField; + text_field_4.role = ax::mojom::Role::kGroup; text_field_4.child_ids = {generic_container_5.id}; generic_container_5.role = ax::mojom::Role::kGenericContainer; diff --git a/third_party/accessibility/ax/ax_range_unittest.cc b/third_party/accessibility/ax/ax_range_unittest.cc index 01d9e2404f16f..f8efa277cc388 100644 --- a/third_party/accessibility/ax/ax_range_unittest.cc +++ b/third_party/accessibility/ax/ax_range_unittest.cc @@ -205,7 +205,7 @@ void AXRangeTest::SetUp() { check_box2_.AddIntAttribute(ax::mojom::IntAttribute::kPreviousOnLineId, check_box1_.id); - text_field_.role = ax::mojom::Role::kTextField; + text_field_.role = ax::mojom::Role::kGroup; text_field_.AddState(ax::mojom::State::kEditable); text_field_.SetValue(TEXT_FIELD); text_field_.AddIntListAttribute( diff --git a/third_party/accessibility/ax/ax_role_properties.cc b/third_party/accessibility/ax/ax_role_properties.cc index 0e85813cb70de..8e699979b1a27 100644 --- a/third_party/accessibility/ax/ax_role_properties.cc +++ b/third_party/accessibility/ax/ax_role_properties.cc @@ -687,6 +687,9 @@ bool IsText(ax::mojom::Role role) { case ax::mojom::Role::kInlineTextBox: case ax::mojom::Role::kLineBreak: case ax::mojom::Role::kStaticText: + case ax::mojom::Role::kTextField: + case ax::mojom::Role::kTextFieldWithComboBox: + case ax::mojom::Role::kLabelText: return true; default: return false;