diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index 1e3650910d543390866f54d3e68eee6916de761c..79aaf1ef943d9d608e5a588650fd9b6e2604061e 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -264,8 +264,9 @@ class SemanticsAction { /// A Boolean value that can be associated with 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 SemanticsFlag { static const int _kHasCheckedStateIndex = 1 << 0; static const int _kIsCheckedIndex = 1 << 1; @@ -476,9 +477,9 @@ class SemanticsFlag { /// to move focus to an offscreen child. /// /// For example, a [ListView] widget has implicit scrolling so that users can - /// easily move to the next visible set of children. A [TabBar] widget does - /// not have implicit scrolling, so that users can navigate into the tab - /// body when reaching the end of the tab bar. + /// easily move the accessibility focus to the next set of children. A + /// [PageView] widget does not have implicit scrolling, so that users don't + /// navigate to the next page when reaching the end of the current one. static const SemanticsFlag hasImplicitScrolling = const SemanticsFlag._(_kHasImplicitScrollingIndex); /// The possible semantics flags. diff --git a/lib/ui/semantics/semantics_node.h b/lib/ui/semantics/semantics_node.h index 7596dc20957e8b22db8b7b7a2394f8a52608a652..6bed3b305f1d309d0cca9bbca2c5fcc455fe842c 100644 --- a/lib/ui/semantics/semantics_node.h +++ b/lib/ui/semantics/semantics_node.h @@ -65,6 +65,7 @@ enum class SemanticsFlags : int32_t { kIsLiveRegion = 1 << 15, kHasToggledState = 1 << 16, kIsToggled = 1 << 17, + kHasImplicitScrolling = 1 << 18, }; struct SemanticsNode { diff --git a/shell/platform/embedder/embedder.h b/shell/platform/embedder/embedder.h index baf789594d0120be414dc857d0b48f93eece7df1..11f70f1092f5dc31661630eb8fe9563a51c59caa 100644 --- a/shell/platform/embedder/embedder.h +++ b/shell/platform/embedder/embedder.h @@ -141,6 +141,14 @@ typedef enum { kFlutterSemanticsFlagHasToggledState = 1 << 16, // If true, the semantics node is "on". If false, the semantics node is "off". kFlutterSemanticsFlagIsToggled = 1 << 17, + // Whether the platform can scroll the semantics node when the user attempts + // to move the accessibility focus to an offscreen child. + // + // For example, a |ListView| widget has implicit scrolling so that users can + // easily move the accessibility focus to the next set of children. A + // |PageView| widget does not have implicit scrolling, so that users don't + // navigate to the next page when reaching the end of the current one. + kFlutterSemanticsFlagHasImplicitScrolling = 1 << 18, } FlutterSemanticsFlag; typedef enum {