Add logic to expose "display: none" nodes to accessibility behind flag
This is CL [3/4] in a series of CLs to expose "display: none" elements to the browser process AXTree. 1. Add and improve tests for CSS display and visibility. 2. Introduce new command line flag and chrome://flags entry. 3. Update AXObject::ComputeAccessibilityIsIgnoredButIncludedInTree and relevant logic for the feature to work, disabled using the feature flag. 4. Enable the feature in tests; update expectation files. --- This change hooks up everything required to expose nodes that are "display: none" to be exposed to the browser-side AX tree with the State::kIgnored, but behind a RuntimeEnabledFeatures. Doing so allows elements with "display: none" to be returned from UIA_DescribedByPropertyId and UIA_LabeledByPropertyId. This change can be observed in the update to AXObject::ComputeAccessibilityIsIgnoredButIncludedInTree(). --- There was a bug with AXNodePosition::AsUnignoredTextPosition when a leaf text position was the first or last in a document. It would fail to find the next/previous unignored position because it only searched in one direction. In the case where the last node in a document is ignored, we must search in reverse order if no unignored position can be found in the forward direction. --- In response to AXEventGenerator::Event::IGNORED_CHANGED, we now also need to fire menu opened / closed events for MSAA and UIA. This is because when a menu goes from ignored to unignored it is exposed to the accessibility tree as a new node, similar to if a new unignored menu was added to the DOM via script. --- Modifying AXObjectCacheImpl::HandleRoleChangeWithCleanLayout so that it will create the AXObject if it doesn't exist already. This fixes an invalidation issue when changing the role of an element where the parent object may not be invalidated for a change in its children. This is needed to fix : blink/web_tests/accessibility/is-ignored-change-sends-notification.html I tested |divWithoutRoleContainer| in isolation without my change and it appears that test case was providing a false-positive before. --- Deferring ax::mojom::Event::kBlur and ::kFocus when calling |AXObjectCacheImpl::HandleFocusedUIElementChanged|. I needed to defer this event due to my changes in |AXObject::ComputeAccessibilityIsIgnoredButIncludedInTree|. This is because the following stack will have a DCHECK failure : Check failed: !GetDocument().NeedsLayoutTreeUpdateForNode( *this, true ) ``` blink::Element::EnsureComputedStyle blink::AXObject::IsHiddenForTextAlternativeCalculation blink::AXObject::ComputeAccessibilityIsIgnoredButIncludedInTree blink::AXObject::UpdateCachedAttributeValuesIfNeeded blink::AXObject::AccessibilityIsIgnored blink::AXObjectCacheImpl::GetOrCreate blink::AXObjectCacheImpl::FocusedObject blink::AXObjectCacheImpl::HandleFocusedUIElementChanged ``` --- Bug: 651614 Change-Id: Ieef8e43d19de147beb827139e761085b1d13d0e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808430 Commit-Queue: Adam Ettenberger <adettenb@microsoft.com> Reviewed-by:Dominic Mazzoni <dmazzoni@chromium.org> Reviewed-by:
Kurt Catti-Schmidt <kschmi@microsoft.com> Cr-Commit-Position: refs/heads/master@{#699012}
Showing
Please register or sign in to comment