Skip to content

Commit 0149f94

Browse files
JSUYAclaude
andcommitted
Fix GetParent() to use unignored parent for blocked node children
Use GetUnignoredParent() in the common FlutterPlatformNodeDelegate::GetParent() so children of kIgnored (accessibility-blocked) nodes are correctly parented to the nearest visible ancestor in the AT-SPI tree. This also resolves the build error in FlutterPlatformNodeDelegateTizen::GetParent() which was calling the protected GetNativeAccessibleFromId() directly; it now delegates to the base class implementation instead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4b7ff5f commit 0149f94

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

flutter/shell/platform/common/flutter_platform_node_delegate.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,13 @@ const ui::AXNodeData& FlutterPlatformNodeDelegate::GetData() const {
7070
}
7171

7272
gfx::NativeViewAccessible FlutterPlatformNodeDelegate::GetParent() {
73-
if (!ax_node_->parent()) {
73+
auto* unignored_parent = ax_node_->GetUnignoredParent();
74+
if (!unignored_parent) {
7475
return nullptr;
7576
}
7677
auto bridge_ptr = bridge_.lock();
7778
BASE_DCHECK(bridge_ptr);
78-
return bridge_ptr->GetNativeAccessibleFromId(ax_node_->parent()->id());
79+
return bridge_ptr->GetNativeAccessibleFromId(unignored_parent->id());
7980
}
8081

8182
gfx::NativeViewAccessible FlutterPlatformNodeDelegate::GetFocus() {

flutter/shell/platform/tizen/flutter_platform_node_delegate_tizen.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,9 @@ gfx::NativeViewAccessible FlutterPlatformNodeDelegateTizen::GetParent() {
139139
// Walk up through any ignored (e.g. accessibility-blocked) ancestors so that
140140
// children of blocked nodes are correctly parented to the nearest visible
141141
// (non-ignored) ancestor in the AT-SPI tree.
142-
auto* unignored_parent = GetAXNode()->GetUnignoredParent();
143-
if (unignored_parent) {
144-
auto bridge_ptr = GetOwnerBridge().lock();
145-
BASE_DCHECK(bridge_ptr);
146-
return bridge_ptr->GetNativeAccessibleFromId(unignored_parent->id());
142+
gfx::NativeViewAccessible parent = FlutterPlatformNodeDelegate::GetParent();
143+
if (parent) {
144+
return parent;
147145
}
148146
return FlutterPlatformAppDelegateTizen::GetInstance()
149147
.GetWindow()

0 commit comments

Comments
 (0)