[orca/570658] Cache inDocumentContent results
- From: William Walker <wwalker src gnome org>
- To: svn-commits-list gnome org
- Subject: [orca/570658] Cache inDocumentContent results
- Date: Thu, 2 Jul 2009 18:32:11 +0000 (UTC)
commit 05690074dc283867246542bcec287f6cceccd350
Author: Willie Walker <william walker sun com>
Date: Thu Jul 2 14:29:01 2009 -0400
Cache inDocumentContent results
src/orca/scripts/toolkits/Gecko/script.py | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/script.py b/src/orca/scripts/toolkits/Gecko/script.py
index e7b479f..9901a99 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -2690,15 +2690,22 @@ class Script(default.Script):
"""
if not obj:
obj = orca_state.locusOfFocus
-
+ try:
+ return self.generatorCache['inDocumentContent'][obj]
+ except:
+ if not self.generatorCache.has_key('inDocumentContent'):
+ self.generatorCache['inDocumentContent'] = {}
+ result = False
while obj:
role = obj.getRole()
if role == pyatspi.ROLE_DOCUMENT_FRAME \
or role == pyatspi.ROLE_EMBEDDED:
- return True
+ result = True
+ break
else:
obj = obj.parent
- return False
+ self.generatorCache['inDocumentContent'][obj] = result
+ return self.generatorCache['inDocumentContent'][obj]
def getDocumentFrame(self):
"""Returns the document frame that holds the content being shown."""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]