[orca] Web: Ensure we treat ARIA regions as text objects
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Web: Ensure we treat ARIA regions as text objects
- Date: Fri, 4 Dec 2020 12:49:07 +0000 (UTC)
commit 3bc70e09b12c967c3a219a3a753821b34c88ba5c
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Dec 4 13:26:40 2020 +0100
Web: Ensure we treat ARIA regions as text objects
Orca was assuming that region text would be in accessible children
of the region rather than directly in that object. As a result, we
were presenting the name only.
src/orca/formatting.py | 4 ++++
src/orca/generator.py | 2 ++
src/orca/speech_generator.py | 4 +++-
3 files changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/formatting.py b/src/orca/formatting.py
index 3b0026653..883391443 100644
--- a/src/orca/formatting.py
+++ b/src/orca/formatting.py
@@ -411,6 +411,10 @@ formatting = {
'unfocused': 'labelOrName + radioState + roleName + availability + ' + MNEMONIC + ' +
accelerator + positionInList',
'basicWhereAmI': 'ancestors + labelOrName + roleName + radioState + accelerator + positionInList
+ ' + MNEMONIC
},
+ 'ROLE_REGION': {
+ 'focused': 'leaving or (roleName + labelOrName)',
+ 'unfocused': 'labelOrName + roleName + currentLineText + allTextSelection'
+ },
pyatspi.ROLE_ROW_HEADER: {
'focused': 'labelAndName + roleName + pause + sortOrder',
'unfocused': '((substring and currentLineText) or labelAndName) + roleName + pause + sortOrder'
diff --git a/src/orca/generator.py b/src/orca/generator.py
index 57ec472a3..a79de21b2 100644
--- a/src/orca/generator.py
+++ b/src/orca/generator.py
@@ -1280,6 +1280,8 @@ class Generator:
if self._script.utilities.isContentSuggestion(obj):
return 'ROLE_CONTENT_SUGGESTION'
if self._script.utilities.isLandmark(obj):
+ if self._script.utilities.isLandmarkRegion(obj):
+ return 'ROLE_REGION'
return pyatspi.ROLE_LANDMARK
if self._script.utilities.isFocusableLabel(obj):
return pyatspi.ROLE_LIST_ITEM
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index cdba115b2..a89ddbcea 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -1817,6 +1817,7 @@ class SpeechGenerator(generator.Generator):
pyatspi.ROLE_LANDMARK,
pyatspi.ROLE_LIST,
pyatspi.ROLE_PANEL,
+ 'ROLE_REGION',
pyatspi.ROLE_TABLE,
pyatspi.ROLE_TOOL_TIP]
@@ -1844,7 +1845,7 @@ class SpeechGenerator(generator.Generator):
if _settingsManager.getSetting('speakContextBlockquote'):
enabled.append(pyatspi.ROLE_BLOCK_QUOTE)
if _settingsManager.getSetting('speakContextLandmark'):
- enabled.extend([pyatspi.ROLE_LANDMARK, 'ROLE_DPUB_LANDMARK'])
+ enabled.extend([pyatspi.ROLE_LANDMARK, 'ROLE_DPUB_LANDMARK', 'ROLE_REGION'])
if _settingsManager.getSetting('speakContextList'):
enabled.append(pyatspi.ROLE_LIST)
if _settingsManager.getSetting('speakContextPanel'):
@@ -2132,6 +2133,7 @@ class SpeechGenerator(generator.Generator):
'ROLE_DPUB_SECTION',
pyatspi.ROLE_LIST,
pyatspi.ROLE_PANEL,
+ 'ROLE_REGION',
pyatspi.ROLE_TABLE,
pyatspi.ROLE_TOOL_TIP]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]