Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 072a9ca

Browse files
Add TextProvider and TextEdit patterns to AXPlatformNodeWin (#38646)
* Add TextProvider and TextEdit patterns to AXPlatformNodeWin * Formatting
1 parent a01548f commit 072a9ca

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

third_party/accessibility/ax/platform/ax_platform_node_win.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "ax_fragment_root_win.h"
3232
#include "ax_platform_node_delegate.h"
3333
#include "ax_platform_node_delegate_utils_win.h"
34+
#include "ax_platform_node_textprovider_win.h"
3435
#include "shellscalingapi.h"
3536
#include "uia_registrar_win.h"
3637

@@ -5599,10 +5600,13 @@ AXPlatformNodeWin::GetPatternProviderFactoryMethod(PATTERNID pattern_id) {
55995600
}
56005601
break;
56015602

5602-
// TODO(schectman): add implementations for ITextProvider and
5603-
// ITextRangeProvider interfaces.
5604-
// https://github.com/flutter/flutter/issues/114547 and
5605-
// https://github.com/flutter/flutter/issues/109804
5603+
case UIA_TextEditPatternId:
5604+
case UIA_TextPatternId:
5605+
if (IsText() || IsTextField() ||
5606+
data.role == ax::mojom::Role::kRootWebArea) {
5607+
return &AXPlatformNodeTextProviderWin::CreateIUnknown;
5608+
}
5609+
break;
56065610

56075611
case UIA_TogglePatternId:
56085612
if (SupportsToggle(data.role)) {

third_party/accessibility/ax/platform/ax_platform_node_win_unittest.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3509,11 +3509,13 @@ TEST_F(AXPlatformNodeWinTest, GetPatternProviderSupportedPatterns) {
35093509

35103510
Init(update);
35113511

3512-
EXPECT_EQ(PatternSet({UIA_ScrollItemPatternId}),
3512+
EXPECT_EQ(PatternSet({UIA_ScrollItemPatternId, UIA_TextPatternId,
3513+
UIA_TextEditPatternId}),
35133514
GetSupportedPatternsFromNodeId(root_id));
35143515

35153516
EXPECT_EQ(PatternSet({UIA_ScrollItemPatternId, UIA_ValuePatternId,
3516-
UIA_ExpandCollapsePatternId}),
3517+
UIA_ExpandCollapsePatternId, UIA_TextPatternId,
3518+
UIA_TextEditPatternId}),
35173519
GetSupportedPatternsFromNodeId(text_field_with_combo_box_id));
35183520

35193521
EXPECT_EQ(PatternSet({UIA_ScrollItemPatternId, UIA_ValuePatternId,

0 commit comments

Comments
 (0)