Index: test/harness/utils.py
===================================================================
--- test/harness/utils.py	(revision 4394)
+++ test/harness/utils.py	(working copy)
@@ -28,6 +28,7 @@
 #
 firefoxAppNames = "(Firefox|Minefield)"
 firefoxFrameNames = "(Mozilla Firefox|Mozilla Firefox 3.1 Beta 2|Minefield)"
+firefoxLocationBarNames = "(Location|Search Bookmarks and History)"
 
 # Various OpenOffice names as a regex.  These are needed because OOo likes
 # to do various things with its window titles from release to release. 
Index: test/keystrokes/firefox/xul_role_menu_bar.py
===================================================================
--- test/keystrokes/firefox/xul_role_menu_bar.py	(revision 4394)
+++ test/keystrokes/firefox/xul_role_menu_bar.py	(working copy)
@@ -67,41 +67,53 @@
 sequence.append(KeyComboAction("Right"))
 sequence.append(utils.AssertPresentationAction(
     "Right Arrow on menu bar",
-    ["BUG? - We're speaking the tree level for a non-tree",
-     "BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar View Menu <x> Navigation Toolbar CheckItem'",
+    ["BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar View Menu <x> Navigation Toolbar CheckItem'",
      "     VISIBLE:  '<x> Navigation Toolbar CheckItem', cursor=1",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'Navigation Toolbar check item checked'",
-     "SPEECH OUTPUT: 'tree level 1'"]))
+     "SPEECH OUTPUT: 'Navigation Toolbar check item checked'"]))
 
 ########################################################################
 # Press Left Arrow to move backward menu by menu
 #
+
+# The location bar has different names. Where the cursor is will depend
+# on the length of the name.
+#
+cursorPosition = utils.firefoxLocationBarNames
+for name in cursorPosition[1:-1].split("|"):
+    cursorPosition = cursorPosition.replace(name, "%s" % (len(name) + 2))
+
 sequence.append(utils.StartRecordingAction())
 sequence.append(KeyComboAction("Left"))
 sequence.append(utils.AssertPresentationAction(
     "Left Arrow on menu bar",
-    ["BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar AutoComplete Location  \$l'",
-     "     VISIBLE:  'Location  $l', cursor=10",
+    ["BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar AutoComplete " + utils.firefoxLocationBarNames + "  \$l'",
+     "     VISIBLE:  '" + utils.firefoxLocationBarNames + "  \$l', cursor=%s" % cursorPosition,
      "BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar Toolbars Menu'",
      "     VISIBLE:  'Toolbars Menu', cursor=1",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'Location text '",
+     "SPEECH OUTPUT: '" + utils.firefoxLocationBarNames + " text '",
      "SPEECH OUTPUT: 'View menu'",
      "SPEECH OUTPUT: 'Toolbars menu'",]))
 
+# This seems to vary depending on whether or not something is in the
+# clipboard. Therefore, we'll check for either.
+#
+menuItem = "(Paste|Select All)"
+itemShortcut = "(V|A)"
+
 sequence.append(utils.StartRecordingAction())
 sequence.append(KeyComboAction("Left"))
 sequence.append(utils.AssertPresentationAction(
     "Left Arrow on menu bar",
     ["BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Edit Menu'",
      "     VISIBLE:  'Edit Menu', cursor=1",
-     "BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar Paste\(Control V\)'",
-     "     VISIBLE:  'Paste(Control V)', cursor=1",
+     "BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar " + menuItem + "\(Control " + itemShortcut + "\)'",
+     "     VISIBLE:  '" + menuItem + "\(Control " + itemShortcut + "\)', cursor=1",
      "SPEECH OUTPUT: ''",
      "SPEECH OUTPUT: 'Edit menu'",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'Paste Control V'"]))
+     "SPEECH OUTPUT: '" + menuItem + " Control " + itemShortcut + "'"]))
 
 ########################################################################
 # Dismiss the menu by pressing Escape and wait for the location bar
Index: test/keystrokes/firefox/xul_role_tree_table.py
===================================================================
--- test/keystrokes/firefox/xul_role_tree_table.py	(revision 4394)
+++ test/keystrokes/firefox/xul_role_tree_table.py	(working copy)
@@ -44,14 +44,36 @@
 sequence.append(PauseAction(3000))
 
 ########################################################################
+# Press Down Arrow to get to the first item in the tree and Up Arrow to
+# get back. We'll do this because in Firefox 3.1 we are not getting the
+# correct events until we Alt+Tab out of and then back into the window.
+# This does not seem to be an issue for Firefox 3.0
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+    "Down Arrow in tree table",
+    ["KNOWN ISSUE - Firefox 3.1 is not giving us anything here, but Firefox 3.0 is. If we have output, the bug is not present."]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Up"))
+sequence.append(utils.AssertPresentationAction(
+    "Up Arrow in tree table",
+    ["KNOWN ISSUE - Firefox 3.1 is not giving us anything here, but Firefox 3.0 is. If we have output, the bug is not present."]))
+
+sequence.append(KeyComboAction("<Alt>Tab"))
+sequence.append(WaitForWindowActivate(utils.firefoxFrameNames, None))
+sequence.append(KeyComboAction("<Alt>Tab"))
+sequence.append(WaitForWindowActivate("Library", None))
+
+########################################################################
 # Press Down Arrow to get to the first item in the tree.  
 #
 sequence.append(utils.StartRecordingAction())
 sequence.append(KeyComboAction("Down"))
 sequence.append(utils.AssertPresentationAction(
     "Down Arrow in tree table",
-    ["BUG? - We're not speaking the tree level",
-     "BRAILLE LINE:  '" + utils.firefoxAppNames + " Application Library Frame ScrollPane TreeTable Name ColumnHeader Bookmarks Menu   TREE LEVEL 1'",
+    ["BRAILLE LINE:  '" + utils.firefoxAppNames + " Application Library Frame ScrollPane TreeTable Name ColumnHeader Bookmarks Menu   TREE LEVEL 1'",
      "     VISIBLE:  'Bookmarks Menu   TREE LEVEL 1', cursor=1",
      "SPEECH OUTPUT: ''",
      "SPEECH OUTPUT: 'Bookmarks Menu  '"]))
Index: test/keystrokes/firefox/xul_role_radio_menu_item.py
===================================================================
--- test/keystrokes/firefox/xul_role_radio_menu_item.py	(revision 4394)
+++ test/keystrokes/firefox/xul_role_radio_menu_item.py	(working copy)
@@ -34,16 +34,14 @@
 sequence.append(KeyComboAction("y"))
 sequence.append(utils.AssertPresentationAction(
     "y for Page Style menu",
-    ["BUG? - We're speaking a tree level for a non tree item",
-     "BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar Page Style Menu'",
+    ["BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar Page Style Menu'",
      "     VISIBLE:  'Page Style Menu', cursor=1",
      "BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar View Menu & y No Style RadioItem'",
      "     VISIBLE:  '& y No Style RadioItem', cursor=1",
      "SPEECH OUTPUT: ''",
      "SPEECH OUTPUT: 'Page Style menu'",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'No Style not selected radio menu item'",
-     "SPEECH OUTPUT: 'tree level 1'"]))
+     "SPEECH OUTPUT: 'No Style not selected radio menu item'"]))
 
 ########################################################################
 # Do a basic "Where Am I" via KP_Enter. 
Index: src/orca/scripts/toolkits/Gecko/script.py
===================================================================
--- src/orca/scripts/toolkits/Gecko/script.py	(revision 4394)
+++ src/orca/scripts/toolkits/Gecko/script.py	(working copy)
@@ -3510,7 +3510,8 @@
         object attribute 'level'.  To be consistent with default.getNodeLevel()
         this value is 0-based (Gecko return is 1-based) """
 
-        if obj is None or obj.getRole() == pyatspi.ROLE_HEADING:
+        if obj is None or obj.getRole() == pyatspi.ROLE_HEADING \
+           or obj.parent.getRole() == pyatspi.ROLE_MENU:
             return -1
 
         try:
