mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 1582619 - Return DocAccessible if doc root element is passed to GetAccessibleOrDescendant. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D47365 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
18deeb8110
commit
cc288d94bb
@ -1215,12 +1215,12 @@ Accessible* DocAccessible::GetAccessibleOrDescendant(nsINode* aNode) const {
|
||||
Accessible* acc = GetAccessible(aNode);
|
||||
if (acc) return acc;
|
||||
|
||||
acc = GetContainerAccessible(aNode);
|
||||
if (acc == this && aNode == mContent) {
|
||||
// The body node is the doc's content node.
|
||||
return acc;
|
||||
if (aNode == mContent || aNode == mDocumentNode->GetRootElement()) {
|
||||
// If the node is the doc's body or root element, return the doc accessible.
|
||||
return const_cast<DocAccessible*>(this);
|
||||
}
|
||||
|
||||
acc = GetContainerAccessible(aNode);
|
||||
if (acc) {
|
||||
// We access the `mChildren` array directly so that we don't access
|
||||
// lazily created children in places like `XULTreeAccessible` and
|
||||
|
Loading…
Reference in New Issue
Block a user