[orca] Revert "Mouse Review: Do full tree dive to locate all document candidates at point"
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Revert "Mouse Review: Do full tree dive to locate all document candidates at point"
- Date: Thu, 21 Nov 2019 13:41:16 +0000 (UTC)
commit 4446b3ad258c185b9fee8b9655019e50b355ed40
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Thu Nov 21 08:40:59 2019 -0500
Revert "Mouse Review: Do full tree dive to locate all document candidates at point"
This reverts commit 31c118d7d6f2e3b1f3d11de0fc192a7e71d0188a.
src/orca/scripts/web/script_utilities.py | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 79d1cb651..bce0d639e 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -4581,15 +4581,22 @@ class Utilities(script_utilities.Utilities):
if coordType is None:
coordType = pyatspi.DESKTOP_COORDS
- if not self.inDocumentContent(root):
+ if not (root and self.inDocumentContent(root)):
return super().descendantAtPoint(root, x, y, coordType)
- isMatch = lambda o: self.containsPoint(o, x, y, coordType)
- candidates = self.findAllDescendants(root, isMatch)
+ if self.containsPoint(root, x, y, coordType):
+ return super().descendantAtPoint(root, x, y, coordType)
- isPresentable = lambda x: x and (x.name or self.hasPresentableText(x))
- candidates = list(filter(isPresentable, candidates))
- if len(candidates) == 1:
- return candidates[0]
+ # Authoring can cause user agents to expose containers with a bounding
+ # box that doesn't contain the child container at the specified point.
+ obj = root
+ for child in root:
+ if self.containsPoint(child, x, y, coordType):
+ obj = child
+ break
+ else:
+ child = root.queryComponent().getAccessibleAtPoint(x, y, coordType)
+ if child and self.containsPoint(child, x, y, coordType):
+ return child
- return super().descendantAtPoint(root, x, y, coordType)
+ return super().descendantAtPoint(obj, x, y, coordType)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]