Index: src/orca/scripts/Thunderbird.py
===================================================================
--- src/orca/scripts/Thunderbird.py	(revision 2254)
+++ src/orca/scripts/Thunderbird.py	(working copy)
@@ -63,70 +63,6 @@
         """
         debug.println(self.debugLevel, "Thunderbird.SpeechGenerator: "+msg)
 
-    def getSpeechContext(self, obj, stopAncestor=None):
-        """Get the speech that describes the names and role of
-        the container hierarchy of the object, stopping at and
-        not including the stopAncestor.
-
-        This code is almost identical to the getSpeechContext
-        in Gecko.py. If Gecko.getSpeechContext changes, this
-        method may need to be modified too.
-
-        Arguments:
-        - obj: the object
-        - stopAncestor: the ancestor to stop at and not include (None
-          means include all ancestors)
-
-        Returns a list of utterances to be spoken.
-        """
-
-        utterances = []
-
-        if not obj:
-            return utterances
-
-        if obj is stopAncestor:
-            return utterances
-
-        parent = obj.parent
-        while parent and (parent.parent != parent):
-            if parent == stopAncestor:
-                break
-
-            # Skip these containers
-            if (parent.role == rolenames.ROLE_FILLER) \
-                or (parent.role == rolenames.ROLE_AUTOCOMPLETE) \
-                or (parent.role == rolenames.ROLE_PANEL) \
-                or (parent.role == rolenames.ROLE_FORM) \
-                or (parent.role == rolenames.ROLE_LIST_ITEM) \
-                or (parent.role == rolenames.ROLE_LIST) \
-                or (parent.role == rolenames.ROLE_PARAGRAPH) \
-                or (parent.role == rolenames.ROLE_SECTION) \
-                or (parent.role == rolenames.ROLE_LAYERED_PANE) \
-                or (parent.role == rolenames.ROLE_SPLIT_PANE) \
-                or (parent.role == rolenames.ROLE_SCROLL_PANE) \
-                or (parent.role == rolenames.ROLE_UNKNOWN) \
-                or (self._script.isLayoutOnly(parent)):
-                parent = parent.parent
-                continue
-
-            # Append the text and label. Skip displayed text
-            # that starts with "chrome://"
-            text = self._script.getDisplayedText(parent)
-            label = self._script.getDisplayedLabel(parent)
-            if text and (text != label) and len(text) \
-                and (not text.startswith("chrome://")):
-                utterances.append(text)
-            if label and len(label):
-                utterances.append(label)
-
-            parent = parent.parent
-
-        utterances.reverse()
-        self._debug("'%s'" % utterances)
-
-        return utterances
-
 ########################################################################
 #                                                                      #
 # The Thunderbird script class.                                        #
Index: src/orca/speechgenerator.py
===================================================================
--- src/orca/speechgenerator.py	(revision 2254)
+++ src/orca/speechgenerator.py	(working copy)
@@ -26,7 +26,7 @@
 __id__        = "$Id$"
 __version__   = "$Revision$"
 __date__      = "$Date$"
-__copyright__ = "Copyright (c) 2005-2006 Sun Microsystems Inc."
+__copyright__ = "Copyright (c) 2005-2007 Sun Microsystems Inc."
 __license__   = "LGPL"
 
 import math
@@ -1562,17 +1562,6 @@
         if obj is stopAncestor:
             return utterances
 
-        # We try to ignore fillers and panels without names.
-        # [[[TODO: WDW - HACK sometimes table cells can be children
-        # of table cells (see the "Browse" dialog of gnome-terminal
-        # via "Edit" -> "Current Profile" -> "General" Tab ->
-        # "Profile icon:" button -> "Browse..." button - each element
-        # in the list is a compound table cell where the icon and
-        # text are child table cells of the table cell).  So...
-        # we happily ignore those as well.  One thing we might
-        # want to do is treat the parent as a compound object.
-        # Logged as bugzilla bug 319751.]]]
-        #
         parent = obj.parent
         if parent \
             and (obj.role == rolenames.ROLE_TABLE_CELL) \
@@ -1582,45 +1571,21 @@
         while parent and (parent.parent != parent):
             if parent == stopAncestor:
                 break
-            if (parent.role != rolenames.ROLE_FILLER) \
-                and (parent.role != rolenames.ROLE_SECTION) \
-                and (parent.role != rolenames.ROLE_LAYERED_PANE) \
-                and (parent.role != rolenames.ROLE_SPLIT_PANE) \
-                and (parent.role != rolenames.ROLE_SCROLL_PANE) \
-                and (parent.role != rolenames.ROLE_UNKNOWN) \
-                and (not self._script.isLayoutOnly(parent)):
-
-                # Announce the label and text of the object in the hierarchy.
-                #
-                text = self._script.getDisplayedText(parent)
-                label = self._script.getDisplayedLabel(parent)
-
-                # Push announcement of cell after text and label.
-                #
-                if parent.role != rolenames.ROLE_TABLE_CELL:
-                    utterances.append(rolenames.getSpeechForRoleName(parent))
-
-                if text and len(text):
+            if not self._script.isLayoutOnly(parent):
+                text = self._script.getDisplayedLabel(parent)
+                if not text and parent.text:
+                    text = self._script.getDisplayedText(parent)
+                if text and len(text.strip()):
+                    # Push announcement of cell to the end
+                    #
+                    if not parent.role in [rolenames.ROLE_TABLE_CELL,
+                                           rolenames.ROLE_FILLER]:
+                        utterances.append(\
+                            rolenames.getSpeechForRoleName(parent))
                     utterances.append(text)
-                if label and len(label):
-                    utterances.append(label)
-
-                if parent.role == rolenames.ROLE_TABLE_CELL:
-                    utterances.append(rolenames.getSpeechForRoleName(parent))
-
-            # [[[TODO: HACK - we've discovered oddness in hierarchies
-            # such as the gedit Edit->Preferences dialog.  In this
-            # dialog, we have labeled groupings of objects.  The
-            # grouping is done via a FILLER with two children - one
-            # child is the overall label, and the other is the
-            # container for the grouped objects.  When we detect this,
-            # we add the label to the overall context.]]]
-            #
-            if parent.role == rolenames.ROLE_FILLER:
-                label = self._script.getDisplayedLabel(parent)
-                if label and len (label):
-                    utterances.append(label)
-
+                    if parent.role == rolenames.ROLE_TABLE_CELL:
+                        utterances.append(\
+                            rolenames.getSpeechForRoleName(parent))
             parent = parent.parent
 
         utterances.reverse()
Index: src/orca/Gecko.py
===================================================================
--- src/orca/Gecko.py	(revision 2254)
+++ src/orca/Gecko.py	(working copy)
@@ -629,20 +629,9 @@
             if parent == stopAncestor:
                 break
 
-            # We try to omit things like fillers off the bat...
+            # We try to omit layout things right off the bat.
             #
-            if (parent.role == rolenames.ROLE_FILLER) \
-                or (parent.role == rolenames.ROLE_FORM) \
-                or (parent.role == rolenames.ROLE_LINK) \
-                or (parent.role == rolenames.ROLE_LIST_ITEM) \
-                or (parent.role == rolenames.ROLE_LIST) \
-                or (parent.role == rolenames.ROLE_PARAGRAPH) \
-                or (parent.role == rolenames.ROLE_SECTION) \
-                or (parent.role == rolenames.ROLE_LAYERED_PANE) \
-                or (parent.role == rolenames.ROLE_SPLIT_PANE) \
-                or (parent.role == rolenames.ROLE_SCROLL_PANE) \
-                or (parent.role == rolenames.ROLE_UNKNOWN) \
-                or (self._script.isLayoutOnly(parent)):
+            if self._script.isLayoutOnly(parent):
                 parent = parent.parent
                 continue
 
@@ -655,12 +644,6 @@
                 parent = parent.parent
                 continue
 
-            # Well...if we made it this far, we will now append the
-            # role, then the text, and then the label.
-            #
-            if parent.role != rolenames.ROLE_TABLE_CELL:
-                utterances.append(rolenames.getSpeechForRoleName(parent))
-
             # Now...autocompletes are wierd.  We'll let the handling of
             # the entry give us the name.
             #
@@ -688,11 +671,23 @@
             #
             text = self._script.getDisplayedText(parent)
             label = self._script.getDisplayedLabel(parent)
-            if text and (text != label) and len(text):
-                utterances.append(text)
-            if label and len(label):
-                utterances.append(label)
+            newUtterances = []
+            if text and (text != label) and len(text.strip()) \
+                and (not text.startswith("chrome://")):
+                newUtterances.append(text)
+            if label and len(label.strip()):
+                newUtterances.append(label)
 
+            # Well...if we made it this far, we will now append the
+            # role, then the text, and then the label.
+            #
+            if not parent.role in [rolenames.ROLE_TABLE_CELL,
+                                   rolenames.ROLE_FILLER] \
+                and len(newUtterances):
+                    utterances.append(rolenames.getSpeechForRoleName(parent))
+                    
+            utterances.extend(newUtterances)            
+                
             parent = parent.parent
 
         utterances.reverse()
