[orca/gnome-3-20] Don't do SayAll for page fragments
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/gnome-3-20] Don't do SayAll for page fragments
- Date: Fri, 22 Apr 2016 02:33:25 +0000 (UTC)
commit cf605c14e27051bb542ad0c462b049286e9da325
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Thu Apr 21 18:33:32 2016 -0400
Don't do SayAll for page fragments
src/orca/scripts/web/script.py | 5 +++++
src/orca/scripts/web/script_utilities.py | 10 +++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index 0148fe0..a82814b 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -1172,6 +1172,9 @@ class Script(default.Script):
msg = "WEB: Not doing SayAll due to focusable context obj %s" % obj
debug.println(debug.LEVEL_INFO, msg, True)
speech.speak(self.speechGenerator.generateSpeech(obj))
+ elif self.utilities.documentFragment(event.source):
+ msg = "WEB: Not doing SayAll due to page fragment"
+ debug.println(debug.LEVEL_INFO, msg, True)
elif not _settingsManager.getSetting('sayAllOnLoad'):
msg = "WEB: Not doing SayAll due to sayAllOnLoad being False"
debug.println(debug.LEVEL_INFO, msg, True)
@@ -1566,6 +1569,8 @@ class Script(default.Script):
cause = "Context is not a non-focused link"
elif self.utilities.isChildOfCurrentFragment(obj):
cause = "Context is child of current fragment"
+ elif document == event.source and self.utilities.documentFragment(event.source):
+ cause = "Document URI is fragment"
else:
return False
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index d83733d..faa167a 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -232,8 +232,8 @@ class Utilities(script_utilities.Utilities):
return self.getDocumentForObject(obj or orca_state.locusOfFocus)
- def documentFrameURI(self):
- documentFrame = self.documentFrame()
+ def documentFrameURI(self, documentFrame=None):
+ documentFrame = documentFrame or self.documentFrame()
if documentFrame and not self.isZombie(documentFrame):
document = documentFrame.queryDocument()
return document.getAttributeValue('DocURL')
@@ -2571,6 +2571,10 @@ class Utilities(script_utilities.Utilities):
isSameFragment = lambda x: self._getID(x) == parseResult.fragment
return pyatspi.findAncestor(obj, isSameFragment) is not None
+ def documentFragment(self, documentFrame):
+ parseResult = urllib.parse.urlparse(self.documentFrameURI(documentFrame))
+ return parseResult.fragment
+
def isContentEditableWithEmbeddedObjects(self, obj):
if not (obj and obj.getState().contains(pyatspi.STATE_EDITABLE)):
return False
@@ -2744,7 +2748,7 @@ class Utilities(script_utilities.Utilities):
return obj, offset
def _getCaretContextPathRoleAndName(self, documentFrame=None):
- documentFrame = self.documentFrame()
+ documentFrame = documentFrame or self.documentFrame()
if not documentFrame:
return [-1], None, None
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]