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

Commit e6a5201

Browse files
authored
Add missing values to semantics action enums (#8033)
This brings the Dart and C++ semantics flag enums back in sync. In #5902, the ability to move the cursor forward and backward one word were added to dart:ui, and to the Android embedder, but not to the SemanticsAction enum on the C++ side.
1 parent 75d4db3 commit e6a5201

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

lib/ui/semantics.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ part of dart.ui;
77
/// The possible actions that can be conveyed from the operating system
88
/// accessibility APIs to a semantics node.
99
//
10-
// When changes are made to this class, the equivalent APIs in each of the
11-
// embedders *must* be updated.
10+
// When changes are made to this class, the equivalent APIs in
11+
// `lib/ui/semantics/semantics_node.h` and in each of the embedders *must* be
12+
// updated.
1213
class SemanticsAction {
1314
const SemanticsAction._(this.index);
1415

lib/ui/semantics/semantics_node.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
namespace blink {
1818

19-
// Must match the SemanticsAction enum in semantics.dart.
19+
// Must match the SemanticsAction enum in semantics.dart and in each of the
20+
// embedders.
2021
enum class SemanticsAction : int32_t {
2122
kTap = 1 << 0,
2223
kLongPress = 1 << 1,
@@ -37,6 +38,8 @@ enum class SemanticsAction : int32_t {
3738
kDidLoseAccessibilityFocus = 1 << 16,
3839
kCustomAction = 1 << 17,
3940
kDismiss = 1 << 18,
41+
kMoveCursorForwardByWordIndex = 1 << 19,
42+
kMoveCursorBackwardByWordIndex = 1 << 20,
4043
};
4144

4245
const int kScrollableSemanticsActions =

shell/platform/embedder/embedder.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ typedef enum {
9797
kFlutterSemanticsActionCustomAction = 1 << 17,
9898
// A request that the node should be dismissed.
9999
kFlutterSemanticsActionDismiss = 1 << 18,
100+
// Move the cursor forward by one word.
101+
kFlutterSemanticsActionMoveCursorForwardByWordIndex = 1 << 19,
102+
// Move the cursor backward by one word.
103+
kFlutterSemanticsActionMoveCursorBackwardByWordIndex = 1 << 20,
100104
} FlutterSemanticsAction;
101105

102106
// The set of properties that may be associated with a semantics node.

0 commit comments

Comments
 (0)