Commit 625c3e9f authored by Brian Liu Xu's avatar Brian Liu Xu Committed by Commit Bot

Fix IsExpanded check in TreeView::PopulateAccessibilityData

Updates PopulateAccessibilityData() in |TreeView| to ensure it does not lookup row/depth information for nodes inside collapsed subtrees via GetRowForInternalNode(). Previously, the check only worked when the node's immediate parent was collapsed. This changelist expands it to examine ancestors as well.

PopulateAccessibilityData() can happen when assistive technologies attempt to retrieve property information for arbitrary tree items inside |TreeView| subtrees. Previously, this would lead to a DCHECK failure during row/depth lookup at GetRowForInternalNode().

Bug: 811277
Change-Id: I83e1a127adfcf24dac7a3a9643a659b42a198cff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2146134
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Auto-Submit: Brian Liu Xu <brx@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#758843}
parent 0302b7bf
...@@ -895,7 +895,7 @@ void TreeView::PopulateAccessibilityData(InternalNode* node, ...@@ -895,7 +895,7 @@ void TreeView::PopulateAccessibilityData(InternalNode* node,
} else { } else {
// !IsRoot(node)) && node->parent() != nullptr. // !IsRoot(node)) && node->parent() != nullptr.
if (node->parent()->is_expanded()) { if (IsExpanded(node->parent()->model_node())) {
int depth = 0; int depth = 0;
row = GetRowForInternalNode(node, &depth); row = GetRowForInternalNode(node, &depth);
if (depth >= 0) { if (depth >= 0) {
......
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