Adding TextPattern providers to TextBox and UpDown controls#2701
Conversation
src/System.Windows.Forms/src/System/Windows/Forms/Automation/TextPattern.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/TextBoxAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/TextBoxAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/UiaTextProviderTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/TextBoxBase.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/TextBoxBase.cs
Outdated
Show resolved
Hide resolved
RussKie
left a comment
There was a problem hiding this comment.
- Please rebase on top of the latest master
- Please review https://github.com/dotnet/winforms/wiki/Useful-guidelines#pinvoke-and-com-imports and adjust all interop imports
src/System.Windows.Forms/src/System/Windows/Forms/TextBoxBase.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/TextBoxBase.cs
Outdated
Show resolved
Hide resolved
src/Common/src/Interop/UiaCore/Interop.TextAttributeIdentifier.cs
Outdated
Show resolved
Hide resolved
d12296c to
bae9d4c
Compare
weltkante
left a comment
There was a problem hiding this comment.
This PR is adding a huge amount of interop declarations which on a quick glance don't seem to follow the patterns used with the recent interop refactorings
That aside the PR also introduces a lot more cases of wrong usage of ComVisible(true) attributes (#1878) - while we have an issue to fix these there's no point for new PRs adding wrong declarations. Unless you are on a time constraint and have to merge immediately its better to fix them first to avoid adding more work to be done later in #1878.
/cc @JeremyKuhne for commenting on interop
This comment has been minimized.
This comment has been minimized.
src/System.Windows.Forms/src/System/Windows/Forms/TextBoxBase.TextBoxBaseUiaTextProvider.cs
Outdated
Show resolved
Hide resolved
|
@weltkante, thank you that you pointed to your comment above, I lost that. |
src/System.Windows.Forms/src/System/Windows/Forms/TextBoxBase.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
What happens if you have other control characters (Char.IsControl())? Or multiple in a row?
There was a problem hiding this comment.
Thanks, reworked this. I return an upper-left point because a control character doesn't have a width (except \t)
src/System.Windows.Forms.Primitives/tests/TestUtilities/WindowClass.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Primitives/tests/TestUtilities/Win32/Window.cs
Outdated
Show resolved
Hide resolved
JeremyKuhne
left a comment
There was a problem hiding this comment.
Added some more comments.
|
Largely this PR is in a good shape modulo the outstanding comments in: |
Codecov Report
@@ Coverage Diff @@
## release/5.0-rc1 #2701 +/- ##
==========================================================
- Coverage 67.43211% 36.37429% -31.05782%
==========================================================
Files 1393 919 -474
Lines 505630 250897 -254733
Branches 41064 36842 -4222
==========================================================
- Hits 340957 91262 -249695
+ Misses 158835 154416 -4419
+ Partials 5838 5219 -619
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Removed supporting |
- Add ITextRange and ITextProvider interfaces as a base of TextPattern
Refer to:
https://docs.microsoft.com/dotnet/api/system.windows.automation.provider.itextprovider
https://docs.microsoft.com/dotnet/api/system.windows.automation.provider.itextrangeprovider
- Implement UiaTextRange and UiaTextProvider to support text pattern in textbox controls
- Add tests
- Move IAutomationLiveRegion to Primitives
- Implement base integration to AccessibleObject - Add TextPattern support for TextBox (singleline and multiline) and MaskedTextBox - Disable managed UiaTextProvider for RichTextBox to use native provider as the native Win32 RichEdit control already supports TextPattern. Return ControlAccessibleObject as AccessibilityInstance instead TextBoxBaseAccessibleObject (the latter supports managed UiaTextProvider). - Add tests Fixes dotnet#1588
|
Testers approved the fix ✔️ |
|
@Pilchie : seeking approval to merge in 5.0-rc2 branch. |
|
@JeremyKuhne - you've got a |
JeremyKuhne
left a comment
There was a problem hiding this comment.
Discussed expectations with @RussKie last week. Given he has asked for M2 and testers have signed off this seems ok. Took another quick look and nothing jumped out.
|
Approved for .NET 5.0 RC2 pending an explicit code review sign-off. |
|
@JeremyKuhne standing by for your final review |
JeremyKuhne
left a comment
There was a problem hiding this comment.
I have some follow-up for master in #3853, but this one should be good.
Fixes #1588
Proposed changes
Customer Impact
Regression?
Risk
Screenshots
Before
Narrator does not announce the text navigation and selection of the TextBox, MaskedTextBox and up-down controls.
After
Narrator announces the text content of the text input controls (navigation, selection)
Test methodology
Accessibility testing
Test environment(s)
.NET Core SDK (reflecting any global.json):
Version: 5.0.100-alpha1-015763
Commit: 0d0c902b77
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100-alpha1-015763\
Host (useful for support):
Version: 5.0.0-alpha.1.19564.1
Commit: c77948d92a
.NET Core SDKs installed:
3.0.101 [C:\Program Files\dotnet\sdk]
3.1.100-preview3-014645 [C:\Program Files\dotnet\sdk]
5.0.100-alpha1-015763 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0-preview3.19555.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0-alpha1.19575.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.0-preview3.19553.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0-alpha.1.19564.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0-alpha.1.19564.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.0-preview3.19553.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.0-alpha.1.19564.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft Reviewers: Open in CodeFlow