orca r4508 - in branches/gnome-2-24: . src/orca src/orca/scripts/toolkits/Gecko
- From: wwalker svn gnome org
- To: svn-commits-list gnome org
- Subject: orca r4508 - in branches/gnome-2-24: . src/orca src/orca/scripts/toolkits/Gecko
- Date: Sun, 8 Feb 2009 19:40:32 +0000 (UTC)
Author: wwalker
Date: Sun Feb 8 19:40:32 2009
New Revision: 4508
URL: http://svn.gnome.org/viewvc/orca?rev=4508&view=rev
Log:
Fix for bug #555540 - Add support for additional landmark roles
Modified:
branches/gnome-2-24/ChangeLog
branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/script.py
branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/script_settings.py
branches/gnome-2-24/src/orca/settings.py
branches/gnome-2-24/src/orca/structural_navigation.py
Modified: branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/script.py
==============================================================================
--- branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/script.py (original)
+++ branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/script.py Sun Feb 8 19:40:32 2009
@@ -2816,7 +2816,9 @@
attrs = self._getAttrDictionary(orca_state.locusOfFocus)
try:
# ARIA landmark widgets
- if attrs['xml-roles'] in script_settings.ARIA_LANDMARKS:
+ import sets
+ if sets.Set(attrs['xml-roles'].split()).intersection(\
+ sets.Set(settings.ariaLandmarks)):
return True
# ARIA live region
elif 'container-live' in attrs:
@@ -2891,19 +2893,19 @@
if 'xml-roles' in attrs:
# This eliminates all ARIA widgets that are not
# considered live
- if attrs['xml-roles'] != 'alert' \
- and attrs['xml-roles'] != 'tooltip':
+ attrList = attrs['xml-roles'].split()
+ if not 'alert' in attrList \
+ and not 'tooltip' in attrList:
return False
# Only present tooltips when user wants them presented
- elif attrs['xml-roles'] == 'tooltip' \
- and not settings.presentToolTips:
+ elif 'tooltip' in attrList and not settings.presentToolTips:
return False
else:
# Some alerts have been seen without the :system postfix.
# We will take care of them separately.
attrs = self._getAttrDictionary(event.any_data)
if 'xml-roles' in attrs \
- and attrs['xml-roles'] == 'alert':
+ and 'alert' in attrs['xml-roles'].split():
return True
else:
return False
Modified: branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/script_settings.py
==============================================================================
--- branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/script_settings.py (original)
+++ branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/script_settings.py Sun Feb 8 19:40:32 2009
@@ -68,6 +68,3 @@
# that may be too verbose so it's configurable.
#
onlySpeakChangedLinesDuringFind = False
-
-ARIA_LANDMARKS = ["banner", "contentinfo", "definition", "main", "navigation",
- "note", "search", "secondary", "seealso"]
Modified: branches/gnome-2-24/src/orca/settings.py
==============================================================================
--- branches/gnome-2-24/src/orca/settings.py (original)
+++ branches/gnome-2-24/src/orca/settings.py Sun Feb 8 19:40:32 2009
@@ -713,6 +713,30 @@
#
repeatCharacterLimit = 4
+# Tags associated with ARIA landmarks.
+#
+ariaLandmarks = [
+ "application",
+ "article",
+ "banner",
+ "complementary",
+ "contentinfo",
+ "definition",
+ "directory",
+ "document",
+ "grid",
+ "log",
+ "main",
+ "menubar",
+ "navigation",
+ "note",
+ "region",
+ "search",
+ "secondary",
+ "seealso",
+ "status",
+]
+
# Script developer feature. If False, just the default script
# will be used. Helps determine difference between custom
# scripts and the default script behavior.
Modified: branches/gnome-2-24/src/orca/structural_navigation.py
==============================================================================
--- branches/gnome-2-24/src/orca/structural_navigation.py (original)
+++ branches/gnome-2-24/src/orca/structural_navigation.py Sun Feb 8 19:40:32 2009
@@ -471,12 +471,6 @@
pyatspi.ROLE_SPIN_BUTTON,
pyatspi.ROLE_TEXT]
- # Tags associated with ARIA landmarks.
- #
- ARIA_LANDMARKS = ["banner", "contentinfo", "definition", "main",
- "navigation", "note", "search", "secondary",
- "seealso"]
-
# Roles which are recognized as being potential "large objects"
# or "chunks." Note that this refers to AT-SPI roles.
#
@@ -2665,8 +2659,18 @@
the criteria (e.g. the level of a heading).
"""
+ # NOTE: there is a limitation in the AT-SPI Collections interface
+ # when it comes to an attribute whose value can be a list. For
+ # example, the xml-roles attribute can be a space-separate list
+ # of roles. We'd like to make a match if the xml-roles attribute
+ # has one (or any) of the roles we care about. Instead, we're
+ # restricted to an exact match. So, the below will only work in
+ # the cases where the xml-roles attribute value consists solely of a
+ # single role. In practice, this seems to be the case that we run
+ # into for the landmark roles.
+ #
attrs = []
- for landmark in self.ARIA_LANDMARKS:
+ for landmark in settings.ariaLandmarks:
attrs.append('xml-roles:' + landmark)
return MatchCriteria(collection, objAttrs=attrs)
@@ -2686,7 +2690,9 @@
attrs = dict([attr.split(':', 1) for attr in obj.getAttributes()])
try:
- if attrs['xml-roles'] in self.ARIA_LANDMARKS:
+ import sets
+ if sets.Set(attrs['xml-roles']).intersection(\
+ sets.Set(settings.ariaLandmarks)):
return True
else:
return False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]