[orca] Make a convenience method for checking if an object can have the caret context
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Make a convenience method for checking if an object can have the caret context
- Date: Tue, 23 Apr 2019 00:19:15 +0000 (UTC)
commit 0047cac21a43f46d1ef9df396bf8c7bcb70c6652
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Mon Apr 22 20:17:39 2019 -0400
Make a convenience method for checking if an object can have the caret context
src/orca/scripts/web/script_utilities.py | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 37ab493d9..bb235ab80 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -3528,6 +3528,16 @@ class Utilities(script_utilities.Utilities):
self._hasNoSize[hash(obj)] = rv
return rv
+ def _canHaveCaretContext(self, obj):
+ if self.isHidden(obj):
+ return False
+ if self.isOffScreenLabel(obj):
+ return False
+ if self.isNonNavigablePopup(obj):
+ return False
+
+ return True
+
def doNotDescendForCaret(self, obj):
if not obj or self.isZombie(obj):
return True
@@ -3811,7 +3821,7 @@ class Utilities(script_utilities.Utilities):
if not obj or not self.inDocumentContent(obj):
return None, -1
- if not (self.isHidden(obj) or self.isOffScreenLabel(obj) or self.isNonNavigablePopup(obj)):
+ if self._canHaveCaretContext(obj):
text = self.queryNonEmptyText(obj)
if text:
allText = text.getText(0, -1)
@@ -3875,7 +3885,7 @@ class Utilities(script_utilities.Utilities):
if not obj or not self.inDocumentContent(obj):
return None, -1
- if not (self.isHidden(obj) or self.isOffScreenLabel(obj) or self.isNonNavigablePopup(obj)):
+ if self._canHaveCaretContext(obj):
text = self.queryNonEmptyText(obj)
if text:
allText = text.getText(0, -1)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]