[orca] Improve presentation of regions
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Improve presentation of regions
- Date: Mon, 23 Jan 2017 15:04:53 +0000 (UTC)
commit 30556ab6ae12d30427593e3ddee7646aeb355dc6
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Mon Jan 23 16:02:35 2017 +0100
Improve presentation of regions
* Do not treat regions as landmarks unless they have a name
* Ensure we present landmark region names
src/orca/scripts/web/script_utilities.py | 2 ++
src/orca/scripts/web/speech_generator.py | 3 ++-
2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 4a7d322..a4903bb 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -2332,6 +2332,8 @@ class Utilities(script_utilities.Utilities):
if obj.getRole() == pyatspi.ROLE_LANDMARK:
rv = True
+ elif self.isLandmarkRegion(obj):
+ rv = bool(obj.name)
else:
roles = self._getXMLRoles(obj)
rv = bool(list(filter(lambda x: x in self.getLandmarkTypes(), roles)))
diff --git a/src/orca/scripts/web/speech_generator.py b/src/orca/scripts/web/speech_generator.py
index da75fb7..58bb78d 100644
--- a/src/orca/scripts/web/speech_generator.py
+++ b/src/orca/scripts/web/speech_generator.py
@@ -158,7 +158,8 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
return super()._generateLabelOrName(obj, **args)
def _generateName(self, obj, **args):
- if self._script.utilities.isTextBlockElement(obj):
+ if self._script.utilities.isTextBlockElement(obj) \
+ and not self._script.utilities.isLandmark(obj):
return []
# TODO - JD: Once the formatting strings are vastly cleaned up
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]