-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Enable scanning of chromium content (#967)
#### Details In #951, we intentionally excluded all elements inside a Chromium document from scan results. This makes sense for most developers, since the conversion from HTML to UIA is convoluted and outside the control of the HTML developer. However, the Edge team relies on this functionality to help improve their HTML-to-UIA conversion code. This PR defaults to excluding the elements inside a Chromium document, but adds a way to request that scan results include elements within a Chromium document. This option is exposed in 3 places: 1. In the `Automation` layer 2. In the CLI 3. In the `SelectAction` class (for future use from Accessibility Insights for Windows) ##### Motivation Requested by the Edge team ##### Results [Comparison.zip](https://github.com/microsoft/axe-windows/files/12480720/Comparison.zip) contains `Default.a11ytest` and `WithChromiumContent.a11ytest`, which were captured by running the CLI on the same instance of Edge. The rule comparison is as follows: Message | Default Count | WithChromiumContent count --- | --- | --- An on-screen element must not have a null BoundingRectangle property | 5 | 5 Chromium components should be scanned with an web-based scanner | 2 | 2 The Name must not include the same text as the LocalizedControlType | 2 | 2 The Name property must not include the element's control type | 2 | 2 An element must not have the same Name and LocalizedControlType as its parent | 0 | 4 An element of the given ControlType must support the Text pattern | 0 | 1 The elements that are unique to the WithChromiumContent file are all within the Chromium document ##### Screenshots Case | Snapshot (click to enlarge) | Results (click to enlarge) --- | --- | --- Default | ![image](https://github.com/microsoft/axe-windows/assets/45672944/1665bb43-a93b-44b8-aaf8-94d4af9680ee) |![image](https://github.com/microsoft/axe-windows/assets/45672944/e2f6cd73-8628-46e7-b7db-3f89f0d12438) WithChromiumContent | ![image](https://github.com/microsoft/axe-windows/assets/45672944/8702cb77-fda3-40eb-9fc2-a4f360f790d3) | ![image](https://github.com/microsoft/axe-windows/assets/45672944/79b6bae7-afc5-4e6b-8b9f-37d1356bac9f) Delta | ![image](https://github.com/microsoft/axe-windows/assets/45672944/aa68946e-ca5c-464e-826c-1914500517a3) | ![image](https://github.com/microsoft/axe-windows/assets/45672944/6e7da53a-4f5d-4dd6-bc43-e23e957b5a90) ##### Context <!-- Are there any parts that you've intentionally left out-of-scope for a later PR to handle? --> - The `Actions` project didn't previously reference the `Rules` project directly, so the plumbing may be non-ideal. If we were to use the existing dependencies, `Actions` would call into `Desktop`, which would call into `RuleSelection`, which would call into `Rules`. We can add the 2 missing layers if we think there's value there. - The flag to enable Chromium content is basically global. This will work as expected in the CLI, in AI-Win, and in AccChecker. It will fail if someone creates a scenario where concurrent scans want to have different Chromium behavior. I've taken a YAGNI approach for now, and we can always make it more complex at a future time, should that prove necessary. <!-- Were there any alternative approaches you considered? What tradeoffs did you consider? --> #### Pull request checklist <!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox --> - [n/a] Addresses an existing issue:
- Loading branch information
Showing
21 changed files
with
163 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Axe.Windows.Rules | ||
{ | ||
/// <summary> | ||
/// This class contains settings that influence the behavior of the rules engine. It is currently | ||
/// static for simplicity. This is a potential problem in the scenario of concurrent scans where the | ||
/// settings change in the middle of a scan. Given the very limited scope of the current settings, | ||
/// we are choosing to accept this limitation for now. | ||
/// </summary> | ||
internal static class RulesSettings | ||
{ | ||
/// <summary> | ||
/// This setting controls whether the rules engine should test all Chromium content. This exists | ||
/// to allow browser teams to debug code that converts from HTML to UIA. It should be set to false | ||
/// in all other scenarios. | ||
/// </summary> | ||
internal static bool ShouldTestAllChromiumContent { get; set; } | ||
} | ||
} |
Oops, something went wrong.