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 - Narrator is not announcing more information about control #1911

Closed
M-Lipin opened this issue Sep 16, 2019 · 4 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

Repro Steps:​

  1. Launch .NET Core WinForms app with MonthCalendar control.
  2. Start Narrator.
  3. Verify that narrator is announcing the detailed information about calendar control or not.

Actual:
Narrator is not announcing the more information about Month Calendar.

Expected:
When narrator focus shifts on Month Calendar narrator should announce the selected date in proper format like dd/mm/yy.

User Impact:
Screen reader users will face difficulty understand the month calendar properties.

@M-Lipin
Copy link
Contributor Author

M-Lipin commented Sep 16, 2019

@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 - Narrator is not announcing more information about control MonthCalendar control - Narrator is not announcing more information about control 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
Copy link
Contributor Author

M-Lipin commented Oct 23, 2019

@merriemcgaw the fix implemented in #2090 implies changing MonthCalendar accessible control type to calendar like this is in WPF. One exception is the case when the label is added to the form just before MonthCalendar control (as a title for calendar): in this particular scenario, I've found out that if calendar control type is used here, Narrator does not announce the custom name of the control defined by this label, so for this specific case I'm keeping the MonthCalendar control type as table. It seems to me that this is acceptable and does not break things as table accessible control type was used before my changes.

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
@John-Qiao
Copy link
Member

Verified with latest .NET Core 5.0 5.0.100-alpha.1.20064.2 build, it works as Mikhail's description.
TestResult-1911

@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