Skip to content

Commit

Permalink
Add TextProvider and TextEdit patterns to AXPlatformNodeWin (fl…
Browse files Browse the repository at this point in the history
…utter#38646)

* Add TextProvider and TextEdit patterns to AXPlatformNodeWin

* Formatting
  • Loading branch information
yaakovschectman authored Jan 5, 2023
1 parent a01548f commit 072a9ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 8 additions & 4 deletions third_party/accessibility/ax/platform/ax_platform_node_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 072a9ca

Please sign in to comment.