Commit Graph

3 Commits

Author SHA1 Message Date
Masayuki Nakano
87466056af Bug 1369072 - part3: nsXBLPrototypeHandler::DispatchXBLCommand() should use controller of visible window r=smaug
With previous change, KeyboardEvent is dispatched even when invisible window
has focus.  However, nsRootWindow::GetControllerForCommand() returns controller
for focused window even when the window is invisible because it uses
nsFocusManager::GetFocusedDescendant() to retrieve focused window.

Perhaps, we can assume that users won't expect to do something with invisible
window when they type some keys.  Then, nsRootWindow::GetControllerForCommand()
should return controller for visible ancestor window if focused window is
invisible.

This patch makes nsFocusManager::GetFocusedDescendant() can return only visible
descendants.  However, it already has a bool argument.  Therefore, it should
have a flag instead of adding new flag.  Most changes of this patch is replacing
its callers.

Then, nsRootWindow::GetControllerForCommand() and nsRootWindow::GetControllers()
should have a bool flag if it should return controller(s) for visible window.
This patch adds a bool flag for it.  Fortunately, the interface isn't scriptable.

Finally, this patch makes nsXBLPrototypeHandler::DispatchXBLCommand() and
EventStateManager::DoContentCommandEvent() retrieve controller for visible
window since they are always handles user input.

MozReview-Commit-ID: GygttTHuKRm
2017-09-07 22:54:49 +09:00
Mats Palmgren
15d95588ce Bug 1372268 - Use LookupForAdd instead of Get+Put to avoid unnecessary hashtable lookups. r=froydnj
MozReview-Commit-ID: 1WVLTschGsj
2017-06-14 16:11:22 +02:00
Myk Melez
c3a3384c53 Bug 1309049 - move embedding/ files out of that directory, r=jst,mossop 2017-01-12 13:47:27 -08:00