Add TextProvider and TextEdit patterns to AXPlatformNodeWin (flutter/engine#38646)

* Add TextProvider and TextEdit patterns to AXPlatformNodeWin

* Formatting
This commit is contained in:
yaakovschectman
2023-01-05 09:13:02 -05:00
committed by GitHub
parent b8fb9e873a
commit 2c3494009b
2 changed files with 12 additions and 6 deletions

View File

@@ -31,6 +31,7 @@
#include "ax_fragment_root_win.h"
#include "ax_platform_node_delegate.h"
#include "ax_platform_node_delegate_utils_win.h"
#include "ax_platform_node_textprovider_win.h"
#include "shellscalingapi.h"
#include "uia_registrar_win.h"
@@ -5599,10 +5600,13 @@ AXPlatformNodeWin::GetPatternProviderFactoryMethod(PATTERNID pattern_id) {
}
break;
// TODO(schectman): add implementations for ITextProvider and
// ITextRangeProvider interfaces.
// https://github.com/flutter/flutter/issues/114547 and
// https://github.com/flutter/flutter/issues/109804
case UIA_TextEditPatternId:
case UIA_TextPatternId:
if (IsText() || IsTextField() ||
data.role == ax::mojom::Role::kRootWebArea) {
return &AXPlatformNodeTextProviderWin::CreateIUnknown;
}
break;
case UIA_TogglePatternId:
if (SupportsToggle(data.role)) {

View File

@@ -3509,11 +3509,13 @@ TEST_F(AXPlatformNodeWinTest, GetPatternProviderSupportedPatterns) {
Init(update);
EXPECT_EQ(PatternSet({UIA_ScrollItemPatternId}),
EXPECT_EQ(PatternSet({UIA_ScrollItemPatternId, UIA_TextPatternId,
UIA_TextEditPatternId}),
GetSupportedPatternsFromNodeId(root_id));
EXPECT_EQ(PatternSet({UIA_ScrollItemPatternId, UIA_ValuePatternId,
UIA_ExpandCollapsePatternId}),
UIA_ExpandCollapsePatternId, UIA_TextPatternId,
UIA_TextEditPatternId}),
GetSupportedPatternsFromNodeId(text_field_with_combo_box_id));
EXPECT_EQ(PatternSet({UIA_ScrollItemPatternId, UIA_ValuePatternId,