Esempio n. 1
0
 def _get_parent(self):
     parent = super(GeckoPluginWindowRoot, self).parent
     if parent.IAccessibleRole == oleacc.ROLE_SYSTEM_CLIENT:
         # Skip the window wrapping the plugin window,
         # which doesn't expose a Gecko accessible in Gecko >= 11.
         parent = parent.parent.parent
     ver = getGeckoVersion(parent)
     if ver and ver.major != 1:
         res = IAccessibleHandler.accNavigate(
             parent.IAccessibleObject, 0,
             IAccessibleHandler.NAVRELATION_EMBEDS)
         if res:
             obj = IAccessible(IAccessibleObject=res[0],
                               IAccessibleChildID=res[1])
             if obj:
                 if controlTypes.STATE_OFFSCREEN not in obj.states:
                     return obj
                 else:
                     log.debugWarning(
                         "NAVRELATION_EMBEDS returned an offscreen document, name %r"
                         % obj.name)
             else:
                 log.debugWarning(
                     "NAVRELATION_EMBEDS returned an invalid object")
         else:
             log.debugWarning("NAVRELATION_EMBEDS failed")
     return parent
Esempio n. 2
0
	def _get_parent(self):
		#Special code to support Mozilla node_child_of relation (for comboboxes)
		res=IAccessibleHandler.accNavigate(self.IAccessibleObject,self.IAccessibleChildID,IAccessibleHandler.NAVRELATION_NODE_CHILD_OF)
		if res and res!=(self.IAccessibleObject,self.IAccessibleChildID):
			newObj=IAccessible(IAccessibleObject=res[0],IAccessibleChildID=res[1])
			if newObj:
				return newObj
		return super(Mozilla,self).parent
Esempio n. 3
0
	def _get_parent(self):
		parent=super(GeckoPluginWindowRoot,self).parent
		ver=_getGeckoVersion(parent)
		if ver and not ver.startswith('1.'):
			res=IAccessibleHandler.accNavigate(parent.IAccessibleObject,0,IAccessibleHandler.NAVRELATION_EMBEDS)
			if res:
				obj=IAccessible(IAccessibleObject=res[0],IAccessibleChildID=res[1])
				if obj and controlTypes.STATE_OFFSCREEN not in obj.states:
					return obj
		return parent
Esempio n. 4
0
 def _get_parent(self):
     res = IAccessibleHandler.accParent(self.IAccessibleObject,
                                        self.IAccessibleChildID)
     if not res:
         # accParent is broken in Firefox for same-process iframe documents.
         # Use NODE_CHILD_OF instead.
         res = IAccessibleHandler.accNavigate(
             self.IAccessibleObject, self.IAccessibleChildID,
             IAccessibleHandler.NAVRELATION_NODE_CHILD_OF)
     if not res:
         return None
     return IAccessible(IAccessibleObject=res[0], IAccessibleChildID=res[1])
Esempio n. 5
0
	def _get_parent(self):
		#Special code to support Mozilla node_child_of relation (for comboboxes)
		res=IAccessibleHandler.accNavigate(self.IAccessibleObject,self.IAccessibleChildID,IAccessibleHandler.NAVRELATION_NODE_CHILD_OF)
		if res and res!=(self.IAccessibleObject,self.IAccessibleChildID):
			#Gecko can sometimes give back a broken application node with a windowHandle of 0
			#The application node is annoying, even if it wasn't broken
			#So only use the node_child_of object if it has a valid IAccessible2 windowHandle
			try:
				windowHandle=res[0].windowHandle
			except (COMError,AttributeError):
				windowHandle=None
			if windowHandle:
				newObj=IAccessible(windowHandle=windowHandle,IAccessibleObject=res[0],IAccessibleChildID=res[1])
				if newObj:
					return newObj
		return super(Mozilla,self).parent
Esempio n. 6
0
 def _get_parent(self):
     #Special code to support Mozilla node_child_of relation (for comboboxes)
     res = IAccessibleHandler.accNavigate(
         self.IAccessibleObject, self.IAccessibleChildID,
         IAccessibleHandler.NAVRELATION_NODE_CHILD_OF)
     if res and res != (self.IAccessibleObject, self.IAccessibleChildID):
         #Gecko can sometimes give back a broken application node with a windowHandle of 0
         #The application node is annoying, even if it wasn't broken
         #So only use the node_child_of object if it has a valid IAccessible2 windowHandle
         try:
             windowHandle = res[0].windowHandle
         except (COMError, AttributeError):
             windowHandle = None
         if windowHandle:
             newObj = IAccessible(windowHandle=windowHandle,
                                  IAccessibleObject=res[0],
                                  IAccessibleChildID=res[1])
             if newObj:
                 return newObj
     return super(Mozilla, self).parent
Esempio n. 7
0
 def _get_parent(self):
     parent = super(GeckoPluginWindowRoot, self).parent
     if parent.IAccessibleRole == oleacc.ROLE_SYSTEM_CLIENT:
         # Skip the window wrapping the plugin window,
         # which doesn't expose a Gecko accessible in Gecko >= 11.
         parent = parent.parent.parent
     ver = getGeckoVersion(parent)
     if ver and ver.major != 1:
         res = IAccessibleHandler.accNavigate(parent.IAccessibleObject, 0, IAccessibleHandler.NAVRELATION_EMBEDS)
         if res:
             obj = IAccessible(IAccessibleObject=res[0], IAccessibleChildID=res[1])
             if obj:
                 if controlTypes.STATE_OFFSCREEN not in obj.states:
                     return obj
                 else:
                     log.debugWarning("NAVRELATION_EMBEDS returned an offscreen document, name %r" % obj.name)
             else:
                 log.debugWarning("NAVRELATION_EMBEDS returned an invalid object")
         else:
             log.debugWarning("NAVRELATION_EMBEDS failed")
     return parent
Esempio n. 8
0
 def appliesTo(cls, obj):
     return obj.childCount > 0 and not IAccessibleHandler.accNavigate(
         obj.IAccessibleObject, obj.IAccessibleChildID, oleacc.NAVDIR_FIRSTCHILD
     )
Esempio n. 9
0
 def appliesTo(cls, obj):
     return obj.childCount > 0 and not IAccessibleHandler.accNavigate(
         obj.IAccessibleObject, obj.IAccessibleChildID,
         oleacc.NAVDIR_FIRSTCHILD)