-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Accessibility]: Adding MonthCalendar control UI Automation providers to improve calendar control accessibility #2090
Conversation
src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## release/3.1 #2090 +/- ##
=====================================================
- Coverage 26.51476% 26.46751% -0.04725%
=====================================================
Files 804 805 +1
Lines 268062 268635 +573
Branches 38066 38113 +47
=====================================================
+ Hits 71076 71101 +25
- Misses 191907 192461 +554
+ Partials 5079 5073 -6
|
Codecov Report
@@ Coverage Diff @@
## release/3.1 #2090 +/- ##
=====================================================
- Coverage 26.52264% 26.39736% -0.12528%
=====================================================
Files 806 818 +12
Lines 268186 268811 +625
Branches 38086 38145 +59
=====================================================
- Hits 71130 70959 -171
- Misses 191983 192771 +788
- Partials 5073 5081 +8
|
src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs
Outdated
Show resolved
Hide resolved
Business case approved. Add servicing-consider when you've got this ready for Tactics. Tactics note - fixing this will close the final 4 outstanding issues being tracked centrally for accessibility compliance. |
src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.CalendarBodyAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.CalendarBodyAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.CalendarCellAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.CalendarChildType.cs
Show resolved
Hide resolved
...em.Windows.Forms/src/System/Windows/Forms/MonthCalendar.CalendarGridChildAccessibleObject.cs
Outdated
Show resolved
Hide resolved
...ystem.Windows.Forms/src/System/Windows/Forms/MonthCalendar.CalendarHeaderAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs
Outdated
Show resolved
Hide resolved
...System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.MonthCalendarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non blocking comments
src/Common/src/Interop/MonthCalendar/Interop.MonthCalendar.HitTest.cs
Outdated
Show resolved
Hide resolved
src/Common/src/Interop/MonthCalendar/Interop.MonthCalendar.Messages.cs
Outdated
Show resolved
Hide resolved
src/Common/src/Interop/MonthCalendar/Interop.MonthCalendar.Part.cs
Outdated
Show resolved
Hide resolved
src/Common/src/Interop/MonthCalendar/Interop.MonthCalendar.SizeColor.cs
Outdated
Show resolved
Hide resolved
src/Common/src/Interop/MonthCalendar/Interop.MonthCalendar.Styles.cs
Outdated
Show resolved
Hide resolved
...System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.MonthCalendarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
...System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.MonthCalendarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
...System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.MonthCalendarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
...System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.MonthCalendarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
...System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.MonthCalendarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/Common/src/Interop/MonthCalendar/Interop.MonthCalendar.SizeColor.cs
Outdated
Show resolved
Hide resolved
src/Common/src/Interop/MonthCalendar/Interop.MonthCalendar.SizeColor.cs
Outdated
Show resolved
Hide resolved
src/Common/src/Interop/MonthCalendar/Interop.MonthCalendar.SizeColor.cs
Outdated
Show resolved
Hide resolved
src/Common/src/Interop/MonthCalendar/Interop.MonthCalendar.SizeColor.cs
Outdated
Show resolved
Hide resolved
src/Common/src/Interop/MonthCalendar/Interop.MonthCalendar.SizeColor.cs
Outdated
Show resolved
Hide resolved
src/Common/src/Interop/MonthCalendar/Interop.MonthCalendar.SizeColor.cs
Outdated
Show resolved
Hide resolved
src/Common/src/Interop/MonthCalendar/Interop.MonthCalendar.SizeColor.cs
Outdated
Show resolved
Hide resolved
src/Common/src/Interop/MonthCalendar/Interop.MonthCalendar.SizeColor.cs
Outdated
Show resolved
Hide resolved
src/Common/src/Interop/MonthCalendar/Interop.MonthCalendar.Styles.cs
Outdated
Show resolved
Hide resolved
@Vino-Wang has your team tested these changes yet? Can you double check the calendar control still passes Accessibility Insights? |
b67edee
to
9875455
Compare
Found one more issue and fixed it: Narrator users are available to navigate across MonthCalendar child items using CAPS+Arrow keys and now available to call default action for navigated element using CAPS+Enter. |
...System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.MonthCalendarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
...System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.MonthCalendarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good besides the minor comments above
I and QA team have performed additional verification iteration and the results are good - no regressions, Accessibility Insights do not report issues with MonthCalendar control, automation tests passed. |
Proposed changes: * Added UI Automation server providers to MonthCalendar and switched the accessibility model from MSAA-provided to UIA. * Added/moved from combined Safe/Unsafe NativeMethods native structure definitions and constants: MCGIF, MCGIP, MCGRIDINFO, MCHITTESTINFO, MCHT, MCM, MCS, MCSC, POINT, SYSTEMTIME, MOUSEEVENTF. Description for all definitions can be found in Windows API reference. Some managed-code definitions for structures were moved with changing the class-defined to structure-defined, so changed corresponding native methods to pass corresponding objects by ref. * Implemented wrappers for native method calls to fetch month calendar control inf (bounding rectangles, dates, texts). Implemented marshaling for accessible names/texts with passing strings of defined length. Passing string or pointer with length which does not correspond to passed length of text may lead to heap corruption. Passing null will lead to protected memory write violation. Adding required resources for month calendar elements which text/name cannot be fetched from Windows API calls. * Implemented the hierarchy of MonthCalendar control accessibility children with navigation in all directions using FragmentNavigation (UIA server provided navigation - UIA providers support should be set to true), implemented navigation for all calendar view types (dates, months, years, decades). * Added Table and Grid providers for the root element (but not for the calendar body to prevent announcing "table exit" when navigating to calendar header or today button. Added TableItem and GridItem providers for calendar items (date/months/years/decades). Note: getting number of rows and number of columns is little tricky as there is no documented API for that, so getting these basing on the dimensions and coordinates of cells and container calendar body. * Added Runtime IDs to elements to correctly associate navigated element and its properties in Inspect tree tab and properties tab. * Implemented accessibility hit test to allow getting month calendar child accessible element by specific coordinates. * Implemented accessibility default action invoke (trigger mouse click on the coordinates of specific child element to invoke its native click handler) - same as in client providers. * Improved Narrator support: allowing CAPS+Arrow/Arrow navigation accompanied with blue rectangle emphasizing, correct and detailed announcement for cells, headers, buttons and other MonthCalendar UI elements. Allowed triggering default action/click for MonthCalendar child element using CAPS+Enter. * Changed accessible control type from table to calendar except the case when there is a label before the MonthCalendar control with custom name for below MonthCalendar control. * Fixed AccessibilityInsights issues. Resolves #1908 Resolves #1909 Resolves #1910 Resolves #1911
ac3eeb6
to
b862078
Compare
Fixes #1908
Fixes #1909
Fixes #1910
Fixes #1911
Proposed changes
Customer Impact
Regression?
Risk
Screenshots
Before
After
Test methodology
Accessibility testing
Test environment(s)
.NET Core SDK (reflecting any global.json):
Version: 3.1.100-preview1-014044
Commit: dca04e7030
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18362
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.100-preview1-014044\
Host (useful for support):
Version: 3.1.0-preview1.19463.3
Commit: 1e35b022cb
.NET Core SDKs installed:
2.1.700-preview-009601 [C:\Program Files\dotnet\sdk]
2.1.801 [C:\Program Files\dotnet\sdk]
3.0.100-preview8-012929 [C:\Program Files\dotnet\sdk]
3.0.100-preview9-014004 [C:\Program Files\dotnet\sdk]
3.1.100-preview1-014044 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-preview8.19351.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-preview9.19424.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-rc2.19462.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0-preview8-27907-09 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0-preview9-19423-09 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.0-preview1.19463.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0-preview8-27907-09 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.0.0-preview9-19423-09 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.0-preview1.19463.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft Reviewers: Open in CodeFlow