microsoft / perfview

PerfView is a CPU and memory performance-analysis tool
http://channel9.msdn.com/Series/PerfView-Tutorial
MIT License
4.2k stars 712 forks source link

Address accessibility issues #2120

Closed caaavik-msft closed 1 month ago

caaavik-msft commented 1 month ago

An accessibility review was completed on PerfView which identified a number of accessibility issues with PerfView, this PR addresses as many of the Sev 1 and Sev 2 accessibility issues that were possible without too much work. There are some other issues which were not addressed in this PR because they would require a significant amount of work to fix or it needed some more investigation.

Replaced ActiveX with WebView2 for all web browser components

The ActiveX-based WebBrowser control has been replaced with WebView2 controls. A large number of accessibility issues that were identified were in places we were using the WebBrowser as it wasn't generating a very accessible UI. WebView2 was a (mostly) drop-in replacement that was able to address every accessibility issue that was reported. The WebView2 package includes inside it the driver/dll, so it is all self-contained and won't require the user to install anything to get it to work. Some of the subscribed event handlers on the browser control had to be updated to support the different event handler argument types as well.

It is worth mentioning that the latest version of WebView2 does not officially support Windows 7/8 (source), however it will still likely work it is just that they aren't testing that it works (see https://github.com/MicrosoftEdge/WebView2Feedback/issues/3404). If we want to be extra sure, we can roll back the WebView2 SDK version to 1.0.1519.0 though.

Added AutomationProperties.Name for many elements

This property is used by accessibility software such as Narrator to describe what the currently highlighted element is. If an element is a text block or contains some content, the narrator will use that content by default as this name, but for other elements such as input elements, we need to specify it manually as it isn't able to extract it automatically from any adjacent labels.

There are also some cases like TreeView or ListBox where the items inside the control use the ToString() method on the object to get the AutomationProperties.Name, which in some cases was undesirable as it was not user-friendly. For these cases we make use of a Setter to override the AutomationProperties.Name binding to a better value. There were also some other places that needed some specific work done to get the UI name to show up when WPF was unable to determine the correct value from the content or if the content was too long and needed to be shortened.

Other changes