Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix browse mode in Firefox extension popups. #7809
Link to issue number:
Summary of the issue:
Firefox extensions can pop up documents to provide access to their functionality without creating a new browser tab. For example, both the LastPass and bitwarden password managers pop up a document allowing you to access your vault, add a site, etc. when you press their button on the toolbar. Currently, browse mode only works in these documents when you are focused on the document itself. If you focus something inside the document (e.g. a link, a button or a text box), browse mode functionality ceases to work. This can happen even if you move the browse mode cursor, so you are suddenly "thrown out" of browse mode.
Description of how this pull request fixes the issue:
This occurred because the Gecko vbuf code to handle combo box popups was being incorrectly used in this case. It only checked for Mozilla popup windows, but these popup documents are also popup windows. It walked to the nearest ancestor with a different HWND, but that meant that the document was skipped. Thus, anything inside the document was never considered to be part of the document.
This PR tightens the code to deal with combo box popups so that it only matches those.
Known issues with pull request:
Change log entry:
It's true that I can do just return instead of return None. However, I think it is clearer to be explicit here. The key point is that the caller expects and examines the return value, rather than there being no possibility of a return value (like a void return in C++). Think of it like return nullptr in C++, as opposed to just return (for a void).