From abbd68919dfc9423d43760d2653ebfcb3c2b2ee9 Mon Sep 17 00:00:00 2001 From: Nolan Scobie Date: Sat, 3 Oct 2020 02:30:23 -0400 Subject: [PATCH] Minor a11y documentation breadcrumbs (flutter/engine#20330) Adds a reference to RenderObject.describeSemanticsClip to `SemanticsFlag.isHidden` and a hint that lets readers know that the `SemanticsNode` rect is specified in local coordinates. --- engine/src/flutter/lib/ui/semantics.dart | 4 ++++ engine/src/flutter/lib/ui/semantics/semantics_node.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/lib/ui/semantics.dart b/engine/src/flutter/lib/ui/semantics.dart index 56e371eb770..30bce7cc91e 100644 --- a/engine/src/flutter/lib/ui/semantics.dart +++ b/engine/src/flutter/lib/ui/semantics.dart @@ -479,6 +479,10 @@ class SemanticsFlag { /// the semantics tree altogether. Hidden elements are only included in the /// semantics tree to work around platform limitations and they are mainly /// used to implement accessibility scrolling on iOS. + /// + /// See also: + /// + /// * [RenderObject.describeSemanticsClip] static const SemanticsFlag isHidden = SemanticsFlag._(_kIsHiddenIndex); /// Whether the semantics node represents an image. diff --git a/engine/src/flutter/lib/ui/semantics/semantics_node.h b/engine/src/flutter/lib/ui/semantics/semantics_node.h index 861a1ad0f0a..6b76668301d 100644 --- a/engine/src/flutter/lib/ui/semantics/semantics_node.h +++ b/engine/src/flutter/lib/ui/semantics/semantics_node.h @@ -119,8 +119,8 @@ struct SemanticsNode { std::string decreasedValue; int32_t textDirection = 0; // 0=unknown, 1=rtl, 2=ltr - SkRect rect = SkRect::MakeEmpty(); - SkM44 transform = SkM44{}; // Identity + SkRect rect = SkRect::MakeEmpty(); // Local space, relative to parent. + SkM44 transform = SkM44{}; // Identity std::vector childrenInTraversalOrder; std::vector childrenInHitTestOrder; std::vector customAccessibilityActions;