Index: src/orca/Gecko.py
===================================================================
--- src/orca/Gecko.py	(revision 2736)
+++ src/orca/Gecko.py	(working copy)
@@ -1633,6 +1633,12 @@
         # means we need to know if that has already taken place.
         #
         self.madeFindAnnouncement = False
+
+        # We need to be able to distinguish focus events that are triggered
+        # by the call to grabFocus() in setCaretPosition() from those that
+        # are valid.  See bug #471537.
+        #
+        self._objectForFocusGrab = None
         
     def getWhereAmI(self):
         """Returns the "where am I" class for this script.
@@ -3172,6 +3178,14 @@
 
             return
 
+        # Possibility #4: We called grabFocus() on this item because it has
+        # the overflow:auto; style associated with it.  We need to ignore
+        # this event.  See bug #471537.
+        #
+        if event.source and event.source == self._objectForFocusGrab:
+            self._objectForFocusGrab = None
+            return
+
         # If Orca is controlling the caret, it is possible to arrow into
         # a menu item inside of a combo box.  This is something that is
         # not possible in Firefox caret browsing mode and seems to confuse
@@ -3357,6 +3371,15 @@
         return
 
     def onFocus(self, event):
+
+        # If this event is the result of our calling grabFocus() on
+        # this object in setCaretPosition(), we want to ignore it.
+        # See bug #471537.
+        #
+        if event.source and event.source == self._objectForFocusGrab:
+            orca.setLocusOfFocus(event, event.source, False)
+            return
+            
         # We're going to ignore focus events on the frame.  They
         # are often intermingled with menu activity, wreaking havoc
         # on the context.
@@ -6713,6 +6736,7 @@
                 #
                 #if objectForFocus.role == rolenames.ROLE_DOCUMENT_FRAME:
                 #    objectForFocus = objectForFocus.parent
+                self._objectForFocusGrab = objectForFocus
                 focusGrabbed = objectForFocus.component.grabFocus()
 
         # If there is a character there, we'd like to position the
