Skip to content

Adding TextPattern providers to TextBox and UpDown controls#2701

Merged
RussKie merged 2 commits intodotnet:release/5.0-rc2from
M-Lipin:dev/v-milipi/Issue_1588_TextPatternProviders
Sep 10, 2020
Merged

Adding TextPattern providers to TextBox and UpDown controls#2701
RussKie merged 2 commits intodotnet:release/5.0-rc2from
M-Lipin:dev/v-milipi/Issue_1588_TextPatternProviders

Conversation

@M-Lipin
Copy link
Contributor

@M-Lipin M-Lipin commented Jan 13, 2020

Fixes #1588

Proposed changes

  • Adding ITextPatternProvider and ITextPatternProvider2 and related imported accessibility interfaces to WinForms Accessibility.
  • Implementing TextPattern Provider functionality to allow accessibility client apps interact and announce (screen readers) text content of the Text controls.

Customer Impact

  • Visually impaired users will be able to read and interact with the text content of the input text elements.
  • Text inputs and up-down inputs will be fully accessible.

Regression?

  • No

Risk

  • Minimal

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

  • Manual testing.
  • Unit testing (to be implemented).
  • Automation tests.

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

@M-Lipin M-Lipin requested a review from a team as a code owner January 13, 2020 13:36
@M-Lipin M-Lipin changed the title Adding TextPattern providers to TextBox and UpDown controls WIP: Adding TextPattern providers to TextBox and UpDown controls Jan 13, 2020
@ghost ghost added the waiting-author-feedback The team requires more information from the author label Jan 16, 2020
Copy link
Contributor

@RussKie RussKie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Jan 28, 2020
@M-Lipin M-Lipin force-pushed the dev/v-milipi/Issue_1588_TextPatternProviders branch from d12296c to bae9d4c Compare January 29, 2020 11:01
Copy link
Contributor

@weltkante weltkante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ghost ghost added waiting-author-feedback The team requires more information from the author and removed waiting-author-feedback The team requires more information from the author labels Feb 10, 2020
@weltkante

This comment has been minimized.

@ghost ghost added the waiting-author-feedback The team requires more information from the author label Aug 21, 2020
@vladimir-krestov
Copy link
Contributor

@weltkante, thank you that you pointed to your comment above, I lost that.
But at this moment I responded to the comments. Thanks

Copy link
Member

@JeremyKuhne JeremyKuhne Aug 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if you have other control characters (Char.IsControl())? Or multiple in a row?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, reworked this. I return an upper-left point because a control character doesn't have a width (except \t)

Copy link
Member

@JeremyKuhne JeremyKuhne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some more comments.

@RussKie
Copy link
Contributor

RussKie commented Aug 26, 2020

Largely this PR is in a good shape modulo the outstanding comments in:

@codecov
Copy link

codecov bot commented Aug 27, 2020

Codecov Report

Merging #2701 into release/5.0-rc1 will decrease coverage by 31.05782%.
The diff coverage is 72.35495%.

@@                    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     
Flag Coverage Δ
#Debug 36.37429% <72.35495%> (-31.05782%) ⬇️
#production 36.37429% <72.35495%> (+0.20018%) ⬆️
#test ?

Flags with carried forward coverage won't be shown. Click here to find out more.

RussKie
RussKie previously approved these changes Aug 28, 2020
@vladimir-krestov
Copy link
Contributor

Removed supporting TextPattern for NumericUpDown and DomainUpDown from the fix because they have incorrect announcing by Narrator. It will be fixed as a separate fix.

RussKie
RussKie previously approved these changes Sep 7, 2020
- 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
@vladimir-krestov
Copy link
Contributor

vladimir-krestov commented Sep 7, 2020

Testers approved the fix ✔️

@vladimir-krestov
Copy link
Contributor

@Pilchie : seeking approval to merge in 5.0-rc2 branch.

@Pilchie
Copy link
Member

Pilchie commented Sep 8, 2020

@JeremyKuhne - you've got a request changes on this. Is that still valid?

Copy link
Member

@JeremyKuhne JeremyKuhne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Pilchie
Copy link
Member

Pilchie commented Sep 8, 2020

Approved for .NET 5.0 RC2 pending an explicit code review sign-off.

@RussKie
Copy link
Contributor

RussKie commented Sep 10, 2020

@JeremyKuhne standing by for your final review

Copy link
Member

@JeremyKuhne JeremyKuhne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some follow-up for master in #3853, but this one should be good.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

servicing-approved .NET Shiproom approved the PR for merge

Projects

None yet

10 participants