From e6a5201f0be3e471438df703ea7355c186d25f51 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Tue, 5 Mar 2019 07:58:26 -0800 Subject: [PATCH] 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. --- lib/ui/semantics.dart | 5 +++-- lib/ui/semantics/semantics_node.h | 5 ++++- shell/platform/embedder/embedder.h | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index 79aaf1ef94..b98d36fe2b 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -7,8 +7,9 @@ part of dart.ui; /// The possible actions that can be conveyed from the operating system /// accessibility APIs to a semantics node. // -// When changes are made to this class, the equivalent APIs in each of the -// embedders *must* be updated. +// When changes are made to this class, the equivalent APIs in +// `lib/ui/semantics/semantics_node.h` and in each of the embedders *must* be +// updated. class SemanticsAction { const SemanticsAction._(this.index); diff --git a/lib/ui/semantics/semantics_node.h b/lib/ui/semantics/semantics_node.h index 6bed3b305f..f6918e5447 100644 --- a/lib/ui/semantics/semantics_node.h +++ b/lib/ui/semantics/semantics_node.h @@ -16,7 +16,8 @@ namespace blink { -// Must match the SemanticsAction enum in semantics.dart. +// Must match the SemanticsAction enum in semantics.dart and in each of the +// embedders. enum class SemanticsAction : int32_t { kTap = 1 << 0, kLongPress = 1 << 1, @@ -37,6 +38,8 @@ enum class SemanticsAction : int32_t { kDidLoseAccessibilityFocus = 1 << 16, kCustomAction = 1 << 17, kDismiss = 1 << 18, + kMoveCursorForwardByWordIndex = 1 << 19, + kMoveCursorBackwardByWordIndex = 1 << 20, }; const int kScrollableSemanticsActions = diff --git a/shell/platform/embedder/embedder.h b/shell/platform/embedder/embedder.h index 11f70f1092..402f58ebcd 100644 --- a/shell/platform/embedder/embedder.h +++ b/shell/platform/embedder/embedder.h @@ -97,6 +97,10 @@ typedef enum { kFlutterSemanticsActionCustomAction = 1 << 17, // A request that the node should be dismissed. kFlutterSemanticsActionDismiss = 1 << 18, + // Move the cursor forward by one word. + kFlutterSemanticsActionMoveCursorForwardByWordIndex = 1 << 19, + // Move the cursor backward by one word. + kFlutterSemanticsActionMoveCursorBackwardByWordIndex = 1 << 20, } FlutterSemanticsAction; // The set of properties that may be associated with a semantics node. -- GitLab