Index: src/orca/Gecko.py
===================================================================
--- src/orca/Gecko.py	(revision 2436)
+++ src/orca/Gecko.py	(working copy)
@@ -2480,7 +2480,10 @@
         # Otherwise, we'll just assume that the thing in which the caret
         # moved is the locus of focus.
         #
-        orca.setLocusOfFocus(event, event.source, False)
+        if orca_state.locusOfFocus \
+            and not orca_state.locusOfFocus.state.count(
+                        atspi.Accessibility.STATE_FOCUSED):
+            orca.setLocusOfFocus(event, event.source, False)
 
         # We need to handle HTML content differently because we do our
         # own navigation and we also handle the
@@ -2776,6 +2779,7 @@
         if event.type == "object:state-changed:busy":
             if event.source \
                 and (event.source.role == rolenames.ROLE_DOCUMENT_FRAME):
+                finishedLoading = False
                 if orca_state.locusOfFocus \
                     and (orca_state.locusOfFocus.role \
                          == rolenames.ROLE_LIST_ITEM) \
@@ -2799,16 +2803,39 @@
                     # Translators: this is in reference to loading a web page.
                     #
                     message = _("Finished loading %s.") % event.source.name
+                    finishedLoading = True
 
                 else:
                     # Translators: this is in reference to loading a web page.
                     #
                     message = _("Finished loading.")
+                    finishedLoading = True
 
                 braille.displayMessage(message)
                 speech.stop()
                 speech.speak(message)
 
+                if finishedLoading and self.inDocumentContent():
+                    [obj, characterOffset] = self.getCaretContext()
+                    if not obj:
+                        self.caretContext = self.findNextCaretInOrder()
+                        [obj, characterOffset] = self.caretContext
+                    if not obj:
+                        return
+
+                    print "HEREL", obj.role, characterOffset
+                    self.outlineAccessible(obj)
+                    self.updateBraille(obj)
+                    if obj.state.count(atspi.Accessibility.STATE_EDITABLE):
+                        self.speakContents(
+                            self.getObjectContentsAtOffset(obj,
+                                                           characterOffset))
+                    elif settings.enableSpeech:
+                        #self.sayAll(None)
+                        self.speakContents(
+                            self.getLineContentsAtOffset(obj,
+                                                         characterOffset))
+
             return
 
         default.Script.onStateChanged(self, event)
@@ -2850,17 +2877,22 @@
                 % (documentFrame.name,
                    rolenames.rolenames[rolenames.ROLE_PAGE_TAB].speech))
 
-            # [[[TODO: WDW - commented this out.  It is an attempt to
-            # read the line at the current character offset for the
-            # window, but it doesn't seem to be reliable.]]]
-            #
-            #if self.caretContext:
-            #    [obj, characterOffset] = self.caretContext
-            #    self.updateBraille(obj)
-            #    self.speakContents(
-            #        self.getLineContentsAtOffset(obj,
-            #                                     characterOffset))
+            if not self.inDocumentContent():
+                return
 
+            [obj, characterOffset] = self.getCaretContext()
+            if not obj:
+                self.caretContext = self.findNextCaretInOrder()
+                [obj, characterOffset] = self.caretContext
+            if not obj:
+                return
+
+            print "HEREP", obj.role, characterOffset
+            self.outlineAccessible(obj)
+            self.updateBraille(obj)
+            self.speakContents(
+                self.getLineContentsAtOffset(obj, characterOffset))
+
     def visualAppearanceChanged(self, event, obj):
         """Called when the visual appearance of an object changes.  This
         method should not be called for objects whose visual appearance
@@ -2917,8 +2949,9 @@
         # they're the same, then the oldLocusOfFocus and the newLocusOfFocus
         # are the same object.
         #
-        if self.isFormField(newLocusOfFocus) and \
-           oldLocusOfFocus.role == newLocusOfFocus.role:
+        if oldLocusOfFocus and newLocusOfFocus \
+           and (oldLocusOfFocus.role == newLocusOfFocus.role) \
+           and self.isFormField(newLocusOfFocus):
             oldExtents = oldLocusOfFocus.component.getExtents(0)
             newExtents = newLocusOfFocus.component.getExtents(0)
             if oldExtents.x == newExtents.x and \
@@ -3012,7 +3045,7 @@
                                            newLocusOfFocus)
 
     def updateBraille(self, obj, extraRegion=None):
-        """Updates the braille display to show the give object.
+        """Updates the braille display to show the given object.
 
         Arguments:
         - obj: the Accessible
