[orca] Chromium: Also present results count for each find-in-page match
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Chromium: Also present results count for each find-in-page match
- Date: Thu, 1 Aug 2019 18:22:10 +0000 (UTC)
commit d657919fccfe4140ff711f20296736e27f440850
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Thu Aug 1 14:21:22 2019 -0400
Chromium: Also present results count for each find-in-page match
src/orca/script_utilities.py | 3 +++
src/orca/scripts/toolkits/Chromium/script_utilities.py | 11 ++++++++++-
src/orca/scripts/web/script.py | 5 +++++
3 files changed, 18 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index f05cf9c95..607ebe5f0 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -724,6 +724,9 @@ class Utilities:
return toolbar is not None
+ def getFindResultsCount(self, root=None):
+ return ""
+
def isAnchor(self, obj):
return False
diff --git a/src/orca/scripts/toolkits/Chromium/script_utilities.py
b/src/orca/scripts/toolkits/Chromium/script_utilities.py
index b03e5cab0..76c30f928 100644
--- a/src/orca/scripts/toolkits/Chromium/script_utilities.py
+++ b/src/orca/scripts/toolkits/Chromium/script_utilities.py
@@ -48,6 +48,7 @@ class Utilities(web.Utilities):
self._isPseudoElement = {}
self._isListItemMarker = {}
self._topLevelObject = {}
+ self._findDialog = None
def clearCachedObjects(self):
super().clearCachedObjects()
@@ -55,6 +56,7 @@ class Utilities(web.Utilities):
self._isPseudoElement = {}
self._isListItemMarker = {}
self._topLevelObject = {}
+ self._findDialog = None
def isStaticTextLeaf(self, obj):
if not (obj and self.inDocumentContent(obj)):
@@ -363,7 +365,8 @@ class Utilities(web.Utilities):
return super().handleAsLiveRegion(event)
- def getFindResultsCount(self, root):
+ def getFindResultsCount(self, root=None):
+ root = root or self._findDialog
if not root:
return ""
@@ -373,6 +376,7 @@ class Utilities(web.Utilities):
return ""
bar = statusBars[0]
+ bar.clearCache()
if len(re.findall("\d+", bar.name)) == 2:
return bar.name
@@ -382,6 +386,9 @@ class Utilities(web.Utilities):
if not obj or self.inDocumentContent(obj):
return False
+ if obj == self._findDialog:
+ return True
+
if obj.getRole() != pyatspi.ROLE_DIALOG:
return False
@@ -389,6 +396,7 @@ class Utilities(web.Utilities):
if result:
msg = "CHROMIUM: %s believed to be find-in-page dialog (%s)" % (obj, result)
debug.println(debug.LEVEL_INFO, msg, True)
+ self._findDialog = obj
return True
# When there are no results due to the absence of a search term, the status
@@ -415,6 +423,7 @@ class Utilities(web.Utilities):
msg = "CHROMIUM: %s believed to be find-in-page dialog (accessibility tree)" % obj
debug.println(debug.LEVEL_INFO, msg, True)
+ self._findDialog = obj
return True
def inFindToolbar(self, obj=None):
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index a73b4b399..7e05855d2 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -667,6 +667,11 @@ class Script(default.Script):
contents = self.utilities.getLineContentsAtOffset(obj, offset)
self.speakContents(contents)
self.updateBraille(obj)
+
+ resultsCount = self.utilities.getFindResultsCount()
+ if resultsCount:
+ self.presentMessage(resultsCount)
+
self._madeFindAnnouncement = True
def sayAll(self, inputEvent, obj=None, offset=None):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]