Index: test/keystrokes/firefox/line_nav_bug_570757.py
===================================================================
--- test/keystrokes/firefox/line_nav_bug_570757.py	(revision 0)
+++ test/keystrokes/firefox/line_nav_bug_570757.py	(revision 0)
@@ -0,0 +1,133 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+"""Test of line navigation output of Firefox. 
+"""
+
+from macaroon.playback import *
+import utils
+
+sequence = MacroSequence()
+
+########################################################################
+# We wait for the focus to be on a blank Firefox window.
+#
+sequence.append(WaitForWindowActivate(utils.firefoxFrameNames, None))
+
+########################################################################
+# Load the test case.
+#
+sequence.append(KeyComboAction("<Control>l"))
+sequence.append(WaitForFocus(acc_role=pyatspi.ROLE_ENTRY))
+
+sequence.append(TypeAction(utils.htmlURLPrefix + "bug-570757.html"))
+sequence.append(KeyComboAction("Return"))
+
+sequence.append(WaitForDocLoad())
+
+sequence.append(WaitForFocus("",
+                             acc_role=pyatspi.ROLE_DOCUMENT_FRAME))
+
+########################################################################
+# Press Control+Home to move to the top.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Control>Home"))
+sequence.append(utils.AssertPresentationAction(
+    "Top of file",
+    ["BRAILLE LINE:  'This is a test.'",
+     "     VISIBLE:  'This is a test.', cursor=1",
+     "SPEECH OUTPUT: 'This is a test.'"]))
+
+########################################################################
+# Down Arrow.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+    "1. Line Down",
+    ["BRAILLE LINE:  'Solution'",
+     "     VISIBLE:  'Solution', cursor=1",
+     "SPEECH OUTPUT: 'Solution'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+    "2. Line Down",
+    ["BRAILLE LINE:  'Here is a step-by-step tutorial:'",
+     "     VISIBLE:  'Here is a step-by-step tutorial:', cursor=1",
+     "SPEECH OUTPUT: 'Here is a step-by-step tutorial: ",
+     " panel'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+    "3. Line Down",
+    ["BRAILLE LINE:  '• Do this thing'",
+     "     VISIBLE:  '• Do this thing', cursor=1",
+     "SPEECH OUTPUT: '• Do this thing'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+    "4. Line Down",
+    ["BRAILLE LINE:  '• Do this other thing'",
+     "     VISIBLE:  '• Do this other thing', cursor=1",
+     "SPEECH OUTPUT: '• Do this other thing'"]))
+
+########################################################################
+# Up Arrow.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Up"))
+sequence.append(utils.AssertPresentationAction(
+    "1. Line Up",
+    ["BRAILLE LINE:  '• Do this thing'",
+     "     VISIBLE:  '• Do this thing', cursor=1",
+     "SPEECH OUTPUT: '• Do this thing'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Up"))
+sequence.append(utils.AssertPresentationAction(
+    "2. Line Up",
+    ["BRAILLE LINE:  'Here is a step-by-step tutorial:'",
+     "     VISIBLE:  'Here is a step-by-step tutorial:', cursor=1",
+     "SPEECH OUTPUT: 'Here is a step-by-step tutorial: ",
+     " panel'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Up"))
+sequence.append(utils.AssertPresentationAction(
+    "3. Line Up",
+    ["BRAILLE LINE:  'Solution'",
+     "     VISIBLE:  'Solution', cursor=1",
+     "SPEECH OUTPUT: 'Solution'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Up"))
+sequence.append(utils.AssertPresentationAction(
+    "4. Line Up",
+    ["BRAILLE LINE:  'This is a test.'",
+     "     VISIBLE:  'This is a test.', cursor=1",
+     "SPEECH OUTPUT: 'This is a test.'"]))
+
+########################################################################
+# Move to the location bar by pressing Control+L.  When it has focus
+# type "about:blank" and press Return to restore the browser to the
+# conditions at the test's start.
+#
+sequence.append(KeyComboAction("<Control>l"))
+sequence.append(WaitForFocus(acc_role=pyatspi.ROLE_ENTRY))
+
+sequence.append(TypeAction("about:blank"))
+sequence.append(KeyComboAction("Return"))
+
+sequence.append(WaitForDocLoad())
+
+# Just a little extra wait to let some events get through.
+#
+sequence.append(PauseAction(3000))
+
+sequence.append(utils.AssertionSummaryAction())
+
+sequence.start()
Index: src/orca/scripts/toolkits/Gecko/script.py
===================================================================
--- src/orca/scripts/toolkits/Gecko/script.py	(revision 4615)
+++ src/orca/scripts/toolkits/Gecko/script.py	(working copy)
@@ -5223,7 +5223,8 @@
                             cOffset = childText.characterCount - 1
                             [cLine, cStart, cEnd] = \
                                 childText.getTextAtOffset(cOffset, boundary)
-                            if cStart == 0:
+                            if cStart == 0 \
+                               and obj.getRole() != pyatspi.ROLE_PANEL:
                                 # It starts on this line.
                                 #
                                 obj = child
