Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Mozilla specific setFocus implementation which waits for a focus event before returning. #10584

Merged
merged 1 commit into from
Dec 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions source/NVDAObjects/IAccessible/mozilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,11 @@
import textInfos.offsets
from NVDAObjects.behaviors import RowWithFakeNavigation
from virtualBuffers import VirtualBuffer
import api
from . import IA2TextTextInfo
from . import ia2Web

class Mozilla(ia2Web.Ia2Web):

def _getPhysicalFocus(self):
try:
paccParent=self.IAccessibleObject.accParent
except COMError:
paccParent=None
if not paccParent:
return
try:
paccFocus=paccParent.accFocus
except COMError:
paccFocus=None
if not paccFocus:
return
return IAccessible(IAccessibleObject=IAccessibleHandler.normalizeIAccessible(paccFocus),IAccessibleChildID=0)

def setFocus(self):
oldFocus=self._getPhysicalFocus()
super(Mozilla,self).setFocus()
# Although all versions of Firefox block inSetFocus or in accFocus until the physical focus has moved,
# Firefox 57 and above return before they fire a focus winEvent communicating the focus change to ATs.
# Therefore, If the call to setFocus did change the physical focus,
# Wait for a focus event to be queued to NVDA before returning.
newFocus=self._getPhysicalFocus()
if newFocus and newFocus!=oldFocus:
while not eventHandler.isPendingEvents("gainFocus"):
api.processPendingEvents(processEventQueue=False)

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)
Expand Down