Index: src/orca/scripts/toolkits/Gecko/script.py
===================================================================
--- src/orca/scripts/toolkits/Gecko/script.py	(revision 3892)
+++ src/orca/scripts/toolkits/Gecko/script.py	(working copy)
@@ -3764,11 +3764,35 @@
 
         return None
 
+    def getCellIndex(self, obj):
+        """Returns the index of the cell which should be used with the
+        table interface.  This is necessary because we cannot count on
+        the index we need being the same as the index in the parent.
+        See, for example, tables with captions and tables with rows
+        that have attributes."""
+
+        index = -1
+        parent = self.getAncestor(obj,
+                                 [pyatspi.ROLE_TABLE],
+                                 [pyatspi.ROLE_DOCUMENT_FRAME])
+        try:
+            table = parent.queryTable()
+        except:
+            pass
+        else:
+            attrs = dict([attr.split(':', 1) for attr in obj.getAttributes()])
+            index = attrs.get('table-cell-index')
+            if index:
+                index = int(index)
+            else:
+                index = obj.getIndexInParent()
+
+        return index
+
     def getCellCoordinates(self, obj):
         """Returns the [row, col] of a ROLE_TABLE_CELL or [0, 0]
         if the coordinates cannot be found.
         """
-
         if obj.getRole() != pyatspi.ROLE_TABLE_CELL:
             obj = self.getAncestor(obj,
                                    [pyatspi.ROLE_TABLE_CELL],
@@ -3780,30 +3804,34 @@
         except:
             pass
         else:
-            row = table.getRowAtIndex(obj.getIndexInParent())
-            col = table.getColumnAtIndex(obj.getIndexInParent())
+            index = self.getCellIndex(obj)
+            row = table.getRowAtIndex(index)
+            col = table.getColumnAtIndex(index)
             return [row, col]
 
         return [0, 0]
 
-    def isSameCell(self, obj, coordinates1, coordinates2):
+    def isSameCell(self, obj, coords1, coords2):
         """Returns True if coordinates1 and coordinates2 refer to the
         same cell in the specified table.
 
         Arguments:
         - obj: the table in which to compare the coordinates
-        - coordinates1: [row, col]
-        - coordinates2: [row, col]
+        - coords1: [row, col]
+        - coords2: [row, col]
         """
 
+        if coords1 == coords2:
+            return True
+
         try:
             table = obj.queryTable()
         except:
             pass
         else:
-            index1 = table.getIndexAt(coordinates1[0], coordinates1[1])
-            index2 = table.getIndexAt(coordinates2[0], coordinates2[1])
-            return (index1 == index2)
+            cell1 = table.getAccessibleAt(coords1[0], coords1[1])
+            cell2 = table.getAccessibleAt(coords2[0], coords2[1])
+            return self.isSameObject(cell1, cell2)
 
         return False
 
@@ -3869,12 +3897,20 @@
         """
 
         if obj and obj.getRole() == pyatspi.ROLE_TABLE_CELL:
-            table = obj.parent.queryTable()
-            row = table.getRowAtIndex(obj.getIndexInParent())
-            for col in xrange(table.nColumns):
-                cell = table.getAccessibleAt(row, col)
-                if not self.isHeader(cell):
-                    return False
+            parent = self.getAncestor(obj,
+                                      [pyatspi.ROLE_TABLE],
+                                      [pyatspi.ROLE_DOCUMENT_FRAME])
+            try:
+                table = parent.queryTable()
+            except:
+                return False
+            else:
+                index = self.getCellIndex(obj)
+                row = table.getRowAtIndex(index)
+                for col in xrange(table.nColumns):
+                    cell = table.getAccessibleAt(row, col)
+                    if not self.isHeader(cell):
+                        return False
 
         return True
 
@@ -3887,12 +3923,20 @@
         """
 
         if obj and obj.getRole() == pyatspi.ROLE_TABLE_CELL:
-            table = obj.parent.queryTable()
-            col = table.getColumnAtIndex(obj.getIndexInParent())
-            for row in xrange(table.nRows):
-                cell = table.getAccessibleAt(row, col)
-                if not self.isHeader(cell):
-                    return False
+            parent = self.getAncestor(obj,
+                                      [pyatspi.ROLE_TABLE],
+                                      [pyatspi.ROLE_DOCUMENT_FRAME])
+            try:
+                table = parent.queryTable()
+            except:
+                return False
+            else:
+                index = self.getCellIndex(obj)
+                col = table.getColumnAtIndex(index)
+                for row in xrange(table.nRows):
+                    cell = table.getAccessibleAt(row, col)
+                    if not self.isHeader(cell):
+                        return False
 
         return True
 
Index: src/orca/default.py
===================================================================
--- src/orca/default.py	(revision 3893)
+++ src/orca/default.py	(working copy)
@@ -5970,6 +5970,16 @@
 
         return -1
 
+    def getCellIndex(self, obj):
+        """Returns the index of the cell which should be used with the
+        table interface.  This is necessary because in some apps we
+        cannot count on getIndexInParent() returning the index we need.
+
+        Arguments:
+        -obj: the table cell whose index we need.
+        """
+        return obj.getIndexInParent()
+
     def isWordDelimiter(self, character):
         """Returns True if the given character is a word delimiter.
 
Index: src/orca/where_am_I.py
===================================================================
--- src/orca/where_am_I.py	(revision 3892)
+++ src/orca/where_am_I.py	(working copy)
@@ -545,13 +545,14 @@
             nColumns = 0
         else:
             nColumns = table.nColumns
-            column = table.getColumnAtIndex(obj.getIndexInParent())
+            index = self._script.getCellIndex(obj)
+            column = table.getColumnAtIndex(index)
             header = table.getColumnHeader(column)
             if header:
                 text = self._getObjName(header)
                 utterances.append(text)
 
-            row = table.getRowAtIndex(obj.getIndexInParent())
+            row = table.getRowAtIndex(index)
             header = table.getRowHeader(row)
             if header:
                 text = self._getObjName(header)
@@ -1189,8 +1190,8 @@
             debug.println(self._debugLevel, "??? parent=%s" % parent.getRole())
             return []
         else:
-            row = table.getRowAtIndex(obj.getIndexInParent())
-
+            index = self._script.getCellIndex(obj)
+            row = table.getRowAtIndex(index)
             for i in range(0, table.nColumns):
                 acc = table.getAccessibleAt(row, i)
                 utterances.append(self._getTableCell(acc))
