diff --git a/src/orca/scripts/toolkits/Gecko/speech_generator.py b/src/orca/scripts/toolkits/Gecko/speech_generator.py
index 4b004a8..c64535f 100644
--- a/src/orca/scripts/toolkits/Gecko/speech_generator.py
+++ b/src/orca/scripts/toolkits/Gecko/speech_generator.py
@@ -549,3 +549,106 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
                                            generateSpeech(self, obj, **args))
             del args['useDefaultFormatting']
         return result
+
+    def getAttribute(self, obj, attributeName):
+        attributes = obj.getAttributes()
+        for attribute in attributes:
+            if attribute.startswith(attributeName):
+		    return attribute.split(":")[1]
+
+    def _generatePositionInList(self, obj, **args):
+        """Returns an array of strings (and possibly voice and audio
+        specifications) that represent the relative position of an
+        object in a list.
+        """
+        if _settingsManager.getSetting('onlySpeakDisplayedText') \
+           or not (_settingsManager.getSetting('enablePositionSpeaking') \
+                   or args.get('forceList', False)):
+            return []
+
+        result = []
+        acss = self.voice(speech_generator.SYSTEM)
+        position = -1
+        index = 0
+        total = 0
+        name = self._generateName(obj)
+	child = obj
+        # TODO - JD: There might be a better way to do this (e.g. pass
+        # roles in maybe?).
+        #
+        role = args.get('role', obj.getRole())
+        if role == pyatspi.ROLE_COMBO_BOX:
+            obj = obj[0]
+        elif role in [pyatspi.ROLE_PAGE_TAB,
+                      pyatspi.ROLE_MENU,
+                      pyatspi.ROLE_MENU_ITEM,
+                      pyatspi.ROLE_CHECK_MENU_ITEM,
+                      pyatspi.ROLE_RADIO_MENU_ITEM]:
+            obj = obj.parent
+        elif role == pyatspi.ROLE_LIST_ITEM:
+            parent = obj.parent
+            for relation in obj.getRelationSet():
+                if relation.getRelationType() == \
+                        pyatspi.RELATION_NODE_CHILD_OF:
+                    # childNodes assumes that we have an accessible table
+                    # interface to work with. If we don't, it will fail. So
+                    # don't set the parent until verifying the interface we
+                    # expect actually exists.
+                    #
+                    target = relation.getTarget(0)
+                    try:
+                        target.parent.queryTable()
+                    except:
+                        pass
+                    else:
+                        parent = target
+                    break
+            obj = parent
+        else:
+            obj = obj.parent
+
+        # We want to return the position relative to this hierarchical
+        # level and not the entire list.  If the object in question
+        # uses the NODE_CHILD_OF relationship, we need to use it instead
+        # of the childCount.
+        #
+        childNodes = self._script.utilities.childNodes(obj)
+        total = len(childNodes)
+        for i in range(0, total):
+            childName = self._generateName(childNodes[i])
+            if childName == name:
+                position = i+1
+                break
+
+        if not total:
+	    position = self.getAttribute(child, "posinset")
+	    total = self.getAttribute(child, "setsize")
+	    if position and total:
+	        position = int(position)
+	        total = int(total)
+	else:
+                for child in obj:
+                    nextName = self._generateName(child)
+                    state = child.getState()
+                    if not nextName or nextName[0] in ["", "Empty", "separator"] \
+                       or not state.contains(pyatspi.STATE_VISIBLE):
+                        continue
+
+                    index += 1
+		    total += 1
+
+                if     nextName == name:
+                    position = index
+
+        if (_settingsManager.getSetting('enablePositionSpeaking') \
+             or args.get('forceList', False)) \
+           and position >= 0:
+            result.append(self._script.formatting.getString(
+                              mode='speech',
+                              stringType='groupindex') \
+                          % {"index" : position,
+                             "total" : total})
+            result.extend(acss)
+        return result
+
+
