Index: src/orca/default.py
===================================================================
--- src/orca/default.py	(revision 3463)
+++ src/orca/default.py	(working copy)
@@ -2106,6 +2106,11 @@
         if a == b:
             return a
 
+        if self.isSameObject(a, b.parent):
+            return a
+        elif self.isSameObject(b, a.parent):
+            return b
+
         aParents = [a]
         try:
             parent = a.parent
Index: src/orca/Gecko.py
===================================================================
--- src/orca/Gecko.py	(revision 3463)
+++ src/orca/Gecko.py	(working copy)
@@ -3942,8 +3942,9 @@
             and (event.source.getRole() == pyatspi.ROLE_DOCUMENT_FRAME):
             try:
                 [obj, characterOffset] = self.getCaretContext()
-                orca.setLocusOfFocus(event, obj)
-                return
+                if not obj.getState().contains(pyatspi.STATE_FOCUSABLE):
+                    orca.setLocusOfFocus(event, obj)
+                    return
             except:
                 pass
 
