Fix SemanticsAction naming consistency (flutter/engine#32411)
Removes the `Index` suffix from kMoveCursorForwardByWord and kMoveCursorBackwardByWord values in the SemanticsAction enum. These were erroneously copied as-is from the private class members in the dart:ui implementation in lib/ui/semantics/semantics.dart where the class members refer to the enum index here. This removes the trailing `Index` for consistency with the other enum members here. This is also useful in the context of automated testing for API consistency between these enums, the ones in dart:ui (native and web implementations) and the embedder API. Issue: https://github.com/flutter/flutter/issues/101217
This commit is contained in:
@@ -39,8 +39,8 @@ enum class SemanticsAction : int32_t {
|
||||
kDidLoseAccessibilityFocus = 1 << 16,
|
||||
kCustomAction = 1 << 17,
|
||||
kDismiss = 1 << 18,
|
||||
kMoveCursorForwardByWordIndex = 1 << 19,
|
||||
kMoveCursorBackwardByWordIndex = 1 << 20,
|
||||
kMoveCursorForwardByWord = 1 << 19,
|
||||
kMoveCursorBackwardByWord = 1 << 20,
|
||||
kSetText = 1 << 21,
|
||||
};
|
||||
|
||||
|
||||
@@ -136,15 +136,14 @@ std::string NodeActionsToString(const flutter::SemanticsNode& node) {
|
||||
flutter::SemanticsAction::kMoveCursorBackwardByCharacter)) {
|
||||
output += "kMoveCursorBackwardByCharacter|";
|
||||
}
|
||||
if (node.HasAction(
|
||||
flutter::SemanticsAction::kMoveCursorBackwardByWordIndex)) {
|
||||
output += "kMoveCursorBackwardByWordIndex|";
|
||||
if (node.HasAction(flutter::SemanticsAction::kMoveCursorBackwardByWord)) {
|
||||
output += "kMoveCursorBackwardByWord|";
|
||||
}
|
||||
if (node.HasAction(flutter::SemanticsAction::kMoveCursorForwardByCharacter)) {
|
||||
output += "kMoveCursorForwardByCharacter|";
|
||||
}
|
||||
if (node.HasAction(flutter::SemanticsAction::kMoveCursorForwardByWordIndex)) {
|
||||
output += "kMoveCursorForwardByWordIndex|";
|
||||
if (node.HasAction(flutter::SemanticsAction::kMoveCursorForwardByWord)) {
|
||||
output += "kMoveCursorForwardByWord|";
|
||||
}
|
||||
if (node.HasAction(flutter::SemanticsAction::kPaste)) {
|
||||
output += "kPaste|";
|
||||
|
||||
Reference in New Issue
Block a user