Skip to content
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

MonthCalendar control should support Grid and Table patterns accordingly to table control type #1909

Closed
M-Lipin opened this issue Sep 16, 2019 · 2 comments
Assignees
Labels
tenet-accessibility MAS violation, UIA issue; problems with accessibility standards

Comments

@M-Lipin
Copy link
Contributor

M-Lipin commented Sep 16, 2019

Issue Details

  1. Make sure the MonthCalendar control element has the appropriate ControlType property - table.
    Element path: table 'MonthCalendar'
  2. Start AccessibilityInsights tool and inspect the element.
  3. Observe that the MonthCalendar control does not support Table and Grid patterns.

This accessibility issue was found using Accessibility Insights for Windows, a tool that helps debug and find accessibility issues earlier. Get more information & download this tool at https://accessibilityinsights.io/

DevDiv issue: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/956702

@zsd4yr zsd4yr added the tenet-accessibility MAS violation, UIA issue; problems with accessibility standards label Sep 17, 2019
@zsd4yr zsd4yr changed the title Accessibility: MonthCalendar control should support Grid and Table patterns accordingly to table control type MonthCalendar control should support Grid and Table patterns accordingly to table control type Sep 17, 2019
@merriemcgaw merriemcgaw added this to the 3.1 milestone Oct 3, 2019
@ghost ghost added the 🚧 work in progress Work that is current in progress label Oct 17, 2019
M-Lipin pushed a commit that referenced this issue Nov 5, 2019
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
RussKie pushed a commit that referenced this issue Nov 5, 2019
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
@ghost ghost removed the 🚧 work in progress Work that is current in progress label Nov 5, 2019
@M-Lipin
Copy link
Contributor Author

M-Lipin commented Nov 6, 2019

Resolving this issue as the fixing PR #2090 is merged to release/3.1.

@M-Lipin M-Lipin closed this as completed Nov 6, 2019
@RussKie RussKie removed this from the 3.1 milestone Nov 6, 2019
@Vino-Wang
Copy link

Verified with latest .NET Core 3.1 3.1.100-GA-014700 build, this issue is fixed. The controlType of MonthCalendar is table once there is a label in front of it, otherwise, it will be calendar.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tenet-accessibility MAS violation, UIA issue; problems with accessibility standards
Projects
None yet
Development

No branches or pull requests

5 participants