[orca] Chromium: Call getAccessibleAtPoint() twice
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Chromium: Call getAccessibleAtPoint() twice
- Date: Wed, 12 Feb 2020 19:57:43 +0000 (UTC)
commit 2a9efeb66fe1fdb8040f5cd6b99d26fb799ae6f5
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Feb 12 20:56:17 2020 +0100
Chromium: Call getAccessibleAtPoint() twice
Chromium cannot do a hit test of web content synchronously. So what it
does is return a guess, then fire off an async hit test. The next time
one calls it, Chromium returns the previous async hit test result if
the point is still within its bounds. Therefore, we need to call
getAccessibleAtPoint() twice to be safe.
src/orca/scripts/toolkits/Chromium/script_utilities.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Chromium/script_utilities.py
b/src/orca/scripts/toolkits/Chromium/script_utilities.py
index 3cc5685a1..168d83ee3 100644
--- a/src/orca/scripts/toolkits/Chromium/script_utilities.py
+++ b/src/orca/scripts/toolkits/Chromium/script_utilities.py
@@ -486,6 +486,14 @@ class Utilities(web.Utilities):
return None
result = component.getAccessibleAtPoint(x, y, coordType)
+
+ # Chromium cannot do a hit test of web content synchronously. So what it
+ # does is return a guess, then fire off an async hit test. The next time
+ # one calls it, Chromium returns the previous async hit test result if
+ # the point is still within its bounds. Therefore, we need to call
+ # getAccessibleAtPoint() twice to be safe.
+ result = component.getAccessibleAtPoint(x, y, coordType)
+
msg = "CHROMIUM: %s is descendant of %s at (%i, %i)" % (result, root, x, y)
debug.println(debug.LEVEL_INFO, msg, True)
return result
@@ -497,9 +505,6 @@ class Utilities(web.Utilities):
result = None
if self.isDocument(root):
result = self._accessibleAtPoint(root, x, y, coordType)
- if self.isTextBlockElement(result) and not self.isStaticTextLeaf(result):
- child = self._accessibleAtPoint(result, x, y, coordType)
- result = child or result
root = result or root
result = super().descendantAtPoint(root, x, y, coordType)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]