[orca] Present "editable content" role for non-entry items which are editable



commit 081638c2fc6ce9ad1b0389fea279f4b07cc68bd7
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Feb 7 10:49:49 2018 -0500

    Present "editable content" role for non-entry items which are editable

 src/orca/object_properties.py            |    6 ++++++
 src/orca/scripts/web/speech_generator.py |    7 ++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/object_properties.py b/src/orca/object_properties.py
index 8faf1dd..07fbce4 100644
--- a/src/orca/object_properties.py
+++ b/src/orca/object_properties.py
@@ -74,6 +74,12 @@ ROLE_EDITABLE_COMBO_BOX = _("editable combo box")
 
 # Translators: This string should be treated as a role describing an object.
 # Examples of roles include "checkbox", "radio button", "paragraph", and "link."
+# This role is to describe elements in web content which have the contenteditable
+# attribute set to true, indicating that the element can be edited by the user.
+ROLE_EDITABLE_CONTENT = _("editable content")
+
+# Translators: This string should be treated as a role describing an object.
+# Examples of roles include "checkbox", "radio button", "paragraph", and "link."
 # The feed role is a scrollable list of articles where scrolling may cause
 # articles to be added to or removed from either end of the list.
 # http://rawgit.com/w3c/aria/master/aria/aria.html#feed
diff --git a/src/orca/scripts/web/speech_generator.py b/src/orca/scripts/web/speech_generator.py
index 837f2f9..3a6435c 100644
--- a/src/orca/scripts/web/speech_generator.py
+++ b/src/orca/scripts/web/speech_generator.py
@@ -315,8 +315,13 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
                 text = self._script.utilities.queryNonEmptyText(obj)
                 if text and end not in [None, text.characterCount]:
                     return []
-            if role not in doNotSpeak:
+            if role in [pyatspi.ROLE_ENTRY, pyatspi.ROLE_PASSWORD_TEXT]:
                 result.append(self.getLocalizedRoleName(obj, **args))
+            elif obj.parent and not obj.parent.getState().contains(pyatspi.STATE_EDITABLE):
+                result.append(object_properties.ROLE_EDITABLE_CONTENT)
+            elif role not in doNotSpeak:
+                result.append(self.getLocalizedRoleName(obj, **args))
+            if result:
                 result.extend(acss)
 
         elif role == pyatspi.ROLE_HEADING:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]