[orca] Replace some more calls to pyatspi's findAllDescendants with our own version
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Replace some more calls to pyatspi's findAllDescendants with our own version
- Date: Wed, 15 May 2019 17:11:57 +0000 (UTC)
commit 39da978d60d27bee3030a77a5e34a7292b2dcb90
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed May 15 19:09:59 2019 +0200
Replace some more calls to pyatspi's findAllDescendants with our own version
src/orca/scripts/web/script_utilities.py | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 57b1b14d3..ac1748692 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -2585,13 +2585,7 @@ class Utilities(script_utilities.Utilities):
def iframeForDetachedDocument(self, obj, root=None):
root = root or self.documentFrame()
isIframe = lambda x: x and x.getRole() == pyatspi.ROLE_INTERNAL_FRAME
- try:
- iframes = pyatspi.findAllDescendants(root, isIframe)
- except:
- msg = "WEB: Exception getting descendant iframes of %s" % root
- debug.println(debug.LEVEL_INFO, msg, True)
- return None
-
+ iframes = self.findAllDescendants(root, isIframe)
for iframe in iframes:
if obj in iframe:
# We won't change behavior, but we do want to log all bogosity.
@@ -3109,14 +3103,8 @@ class Utilities(script_utilities.Utilities):
return rv
isCanvas = lambda x: x and x.getRole() == pyatspi.ROLE_CANVAS
- try:
- canvases = pyatspi.findAllDescendants(obj, isCanvas)
- except:
- msg = "WEB: Exception getting descendant canvases of %s" % obj
- debug.println(debug.LEVEL_INFO, msg, True)
- rv = False
- else:
- rv = len(list(filter(self.isUselessImage, canvases))) > 0
+ canvases = self.findAllDescendants(obj, isCanvas)
+ rv = len(list(filter(self.isUselessImage, canvases))) > 0
self._hasUselessCanvasDescendant[hash(obj)] = rv
return rv
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]