Index: src/orca/Gecko.py
===================================================================
--- src/orca/Gecko.py	(revision 2591)
+++ src/orca/Gecko.py	(working copy)
@@ -5683,7 +5683,7 @@
         if not obj:
             obj = self.getDocumentFrame()
 
-        if not obj:
+        if not obj or not self.inDocumentContent(obj):
             return [None, -1]
 
         if obj.text:
@@ -5759,7 +5759,7 @@
         if not obj:
             obj = self.getDocumentFrame()
 
-        if not obj:
+        if not obj or not self.inDocumentContent(obj):
             return [None, -1]
 
         if obj.text:
