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
Fix browse mode in Firefox extension popups. #7809
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
#A part of NonVisual Desktop Access (NVDA) | ||
#This file is covered by the GNU General Public License. | ||
#See the file COPYING for more details. | ||
#Copyright (C) 2008-2017 NV Access Limited, Babbage B.V. | ||
#Copyright (C) 2008-2017 NV Access Limited, Babbage B.V., Mozilla Corporation | ||
|
||
from . import VirtualBuffer, VirtualBufferTextInfo, VBufStorage_findMatch_word, VBufStorage_findMatch_notEmpty | ||
import treeInterceptorHandler | ||
|
@@ -99,14 +99,29 @@ def _get_shouldPrepare(self): | |
return False | ||
return True | ||
|
||
def _getExpandedComboBox(self, obj): | ||
"""If obj is an item in an expanded combo box, get the combo box. | ||
""" | ||
if not (obj.windowClassName.startswith('Mozilla') and obj.windowStyle & winUser.WS_POPUP): | ||
# This is not a Mozilla popup window, so it can't be an expanded combo box. | ||
return None | ||
if obj.role not in (controlTypes.ROLE_LISTITEM, controlTypes.ROLE_LIST): | ||
return None | ||
parent = obj.parent | ||
# Try a maximum of 2 ancestors, since we might be on the list item or the list. | ||
for i in xrange(2): | ||
obj = obj.parent | ||
if not obj: | ||
return None | ||
if obj.role == controlTypes.ROLE_COMBOBOX: | ||
return obj | ||
return None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: return None is just return |
||
|
||
def __contains__(self,obj): | ||
#Special code to handle Mozilla combobox lists | ||
if obj.windowClassName.startswith('Mozilla') and winUser.getWindowStyle(obj.windowHandle)&winUser.WS_POPUP: | ||
parent=obj.parent | ||
while parent and parent.windowHandle==obj.windowHandle: | ||
parent=parent.parent | ||
if parent: | ||
obj=parent.parent | ||
# if this is a Mozilla combo box popup, we want to work with the combo box. | ||
combo = self._getExpandedComboBox(obj) | ||
if combo: | ||
obj = combo | ||
if not (isinstance(obj,NVDAObjects.IAccessible.IAccessible) and isinstance(obj.IAccessibleObject,IAccessibleHandler.IAccessible2)) or not obj.windowClassName.startswith('Mozilla') or not winUser.isDescendantWindow(self.rootNVDAObject.windowHandle,obj.windowHandle): | ||
return False | ||
if self.rootNVDAObject.windowHandle==obj.windowHandle: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same NIT as below.