refactor!: Drop the ignored field and implement generic filtered tree traversal
#143
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think the
ignoredfield doesn't belong in the schema. Toolkit and application developers shouldn't be required to indicate which nodes should be excluded from the platform tree. This highlights a difference in design requirements between AccessKit and the Chromium accessibility schema; the latter is only intended for internal use within Chromium, not to be approachable to arbitrary toolkit or application developers.Also, the criteria for determining which nodes should be excluded from the platform tree may be platform-dependent. And there may be cases where we want to traverse only the nodes that meet very specific criteria. So I believe we need to modify
following_unignored_siblingsand related functions to take a caller-supplied filter function.It was convenient to mark arbitrary nodes as ignored for our tests, but we can accomplish the same thing using a test-only filter function alongside the test tree.
This PR does reverse an earlier optimization in the Windows adapter, that allowed it to navigate without resolving the target node. But this change enables a bigger optimization. By completely filtering out nodes that UIA clients don't need to see, we eliminate the process of allocating a platform node object, returning it, then going through all the steps for resolving the node when UIA calls a method like GetPropertyValue, all for a node that the UIA client doesn't need to see in the first place. This change will become important when we have numerous inline text box nodes, which don't need to be exposed as UIA elements. The same principle will likely apply to other platform adapters.