Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 5093bc9

Browse files
committed
Propagate identifier from FlutterSemanticsNode2 to AXNodeData
1 parent 990b9fa commit 5093bc9

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed

shell/platform/common/accessibility_bridge.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ void AccessibilityBridge::ConvertFlutterUpdate(const SemanticsNode& node,
280280
SetIntAttributesFromFlutterUpdate(node_data, node);
281281
SetIntListAttributesFromFlutterUpdate(node_data, node);
282282
SetStringListAttributesFromFlutterUpdate(node_data, node);
283+
SetIdentifierFromFlutterUpdate(node_data, node);
283284
SetNameFromFlutterUpdate(node_data, node);
284285
SetValueFromFlutterUpdate(node_data, node);
285286
SetTooltipFromFlutterUpdate(node_data, node);
@@ -519,6 +520,13 @@ void AccessibilityBridge::SetStringListAttributesFromFlutterUpdate(
519520
}
520521
}
521522

523+
void AccessibilityBridge::SetIdentifierFromFlutterUpdate(
524+
ui::AXNodeData& node_data,
525+
const SemanticsNode& node) {
526+
node_data.AddStringAttribute(ax::mojom::StringAttribute::kAuthorUniqueId,
527+
node.identifier);
528+
}
529+
522530
void AccessibilityBridge::SetNameFromFlutterUpdate(ui::AXNodeData& node_data,
523531
const SemanticsNode& node) {
524532
node_data.SetName(node.label);

shell/platform/common/accessibility_bridge.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ class AccessibilityBridge
172172
double scroll_extent_min;
173173
double elevation;
174174
double thickness;
175+
std::string identifier;
175176
std::string label;
176177
std::string hint;
177178
std::string value;
@@ -227,6 +228,8 @@ class AccessibilityBridge
227228
const SemanticsNode& node);
228229
void SetStringListAttributesFromFlutterUpdate(ui::AXNodeData& node_data,
229230
const SemanticsNode& node);
231+
void SetIdentifierFromFlutterUpdate(ui::AXNodeData& node_data,
232+
const SemanticsNode& node);
230233
void SetNameFromFlutterUpdate(ui::AXNodeData& node_data,
231234
const SemanticsNode& node);
232235
void SetValueFromFlutterUpdate(ui::AXNodeData& node_data,

third_party/accessibility/ax/ax_enum_util.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,6 +1413,8 @@ const char* ToString(ax::mojom::StringAttribute string_attribute) {
14131413
return "accessKey";
14141414
case ax::mojom::StringAttribute::kAriaInvalidValue:
14151415
return "ariaInvalidValue";
1416+
case ax::mojom::StringAttribute::kAuthorUniqueId:
1417+
return "authorUniqueId";
14161418
case ax::mojom::StringAttribute::kAutoComplete:
14171419
return "autoComplete";
14181420
case ax::mojom::StringAttribute::kChildTreeId:
@@ -1473,6 +1475,8 @@ ax::mojom::StringAttribute ParseStringAttribute(const char* string_attribute) {
14731475
return ax::mojom::StringAttribute::kAccessKey;
14741476
if (0 == strcmp(string_attribute, "ariaInvalidValue"))
14751477
return ax::mojom::StringAttribute::kAriaInvalidValue;
1478+
if (0 == strcmp(string_attribute, "authorUniqueId"))
1479+
return ax::mojom::StringAttribute::kAuthorUniqueId;
14761480
if (0 == strcmp(string_attribute, "autoComplete"))
14771481
return ax::mojom::StringAttribute::kAutoComplete;
14781482
if (0 == strcmp(string_attribute, "childTreeId"))

third_party/accessibility/ax/ax_enums.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ enum class StringAttribute {
523523
kAccessKey,
524524
// Only used when invalid_state == invalid_state_other.
525525
kAriaInvalidValue,
526+
kAuthorUniqueId,
526527
kAutoComplete,
527528
kChildTreeId,
528529
kClassName,

third_party/accessibility/ax/ax_node_data.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,6 +1444,9 @@ std::string AXNodeData::ToString() const {
14441444
case ax::mojom::StringAttribute::kAriaInvalidValue:
14451445
result += " aria_invalid_value=" + value;
14461446
break;
1447+
case ax::mojom::StringAttribute::kAuthorUniqueId:
1448+
result += " author_unique_id=" + value;
1449+
break;
14471450
case ax::mojom::StringAttribute::kAutoComplete:
14481451
result += " autocomplete=" + value;
14491452
break;

0 commit comments

Comments
 (0)