Commit 1b3288c7 authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Chromium LUCI CQ

Only compute live region root where appropriate

Pulled out from CL:2528573. This change makes sense on its own, but
is required for tests in the child CL to pass.

Bug: None
Change-Id: I5392c62dee345b0fa422c08f07029b325ced440a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627997Reviewed-by: default avatarAlice Boxhall <aboxhall@chromium.org>
Commit-Queue: Alice Boxhall <aboxhall@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843285}
parent e1812c07
...@@ -1578,11 +1578,21 @@ void AXObject::UpdateCachedAttributeValuesIfNeeded() const { ...@@ -1578,11 +1578,21 @@ void AXObject::UpdateCachedAttributeValuesIfNeeded() const {
// "off", or from an automatic ARIA live value, e.g. from role="status". // "off", or from an automatic ARIA live value, e.g. from role="status".
// TODO(dmazzoni): remove this const_cast. // TODO(dmazzoni): remove this const_cast.
AtomicString aria_live; AtomicString aria_live;
cached_live_region_root_ = if (GetNode() && IsA<Document>(GetNode())) {
IsLiveRegionRoot() // The document is never a live region root. This extra bit of logic also
? const_cast<AXObject*>(this) // protects against going up the parent chain from a popup document, into
: (ParentObjectIfExists() ? ParentObjectIfExists()->LiveRegionRoot() // a parent document with unclean layout.
: nullptr); cached_live_region_root_ = nullptr;
} else if (RoleValue() == ax::mojom::blink::Role::kInlineTextBox) {
// Inline text boxes do not need live region properties.
cached_live_region_root_ = nullptr;
} else {
cached_live_region_root_ =
IsLiveRegionRoot()
? const_cast<AXObject*>(this)
: (ParentObjectIfExists() ? ParentObjectIfExists()->LiveRegionRoot()
: nullptr);
}
cached_aria_column_index_ = ComputeAriaColumnIndex(); cached_aria_column_index_ = ComputeAriaColumnIndex();
cached_aria_row_index_ = ComputeAriaRowIndex(); cached_aria_row_index_ = ComputeAriaRowIndex();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment