[orca] Chromium: Prune static text leaf nodes from flat review contents
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Chromium: Prune static text leaf nodes from flat review contents
- Date: Mon, 15 Apr 2019 17:54:20 +0000 (UTC)
commit c33ece704261bad9203104175af4c0669d008ea1
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Mon Apr 15 13:53:12 2019 -0400
Chromium: Prune static text leaf nodes from flat review contents
We get the content from the parent element.
src/orca/script_utilities.py | 6 +++++-
src/orca/scripts/toolkits/Chromium/script_utilities.py | 14 ++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 604bc666f..62a925d49 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -1954,6 +1954,9 @@ class Utilities:
return pyatspi.findAncestor(obj, inSelectedMenu) is not None
+ def isStaticTextLeaf(self, obj):
+ return False
+
def getOnScreenObjects(self, root, extents=None):
if not self.isOnScreen(root, extents):
return []
@@ -2003,7 +2006,8 @@ class Utilities:
objects.append(root)
for child in root:
- objects.extend(self.getOnScreenObjects(child, extents))
+ if not self.isStaticTextLeaf(child):
+ objects.extend(self.getOnScreenObjects(child, extents))
if role == pyatspi.ROLE_MENU_BAR:
self._selectedMenuBarMenu[hash(root)] = None
diff --git a/src/orca/scripts/toolkits/Chromium/script_utilities.py
b/src/orca/scripts/toolkits/Chromium/script_utilities.py
index c5d081bf3..9b368734e 100644
--- a/src/orca/scripts/toolkits/Chromium/script_utilities.py
+++ b/src/orca/scripts/toolkits/Chromium/script_utilities.py
@@ -47,6 +47,20 @@ class Utilities(web.Utilities):
def clearCachedObjects(self):
super().clearCachedObjects()
+ def isStaticTextLeaf(self, obj):
+ if not (obj and self.inDocumentContent(obj)):
+ return super().isStaticTextLeaf(obj)
+
+ if obj.getRole() != pyatspi.ROLE_TEXT:
+ return False
+
+ if self._getTag(obj):
+ return False
+
+ msg = "CHROMIUM: %s believed to be static text leaf" % obj
+ debug.println(debug.LEVEL_INFO, msg, True)
+ return True
+
def selectedChildCount(self, obj):
count = super().selectedChildCount(obj)
if count or "Selection" in pyatspi.listInterfaces(obj):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]