gecko-dev/dom/xul
Masayuki Nakano 4ce89d8f61 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

--HG--
extra : rebase_source : 1341273c4606298cb9b890b9312d9f5c8a75d144
2017-09-07 22:54:49 +09:00
..
crashtests Bug 1371577 - stylo: Update test expectations after fixing pseudo element matching for XBL stylesheets. r=emilio 2017-06-14 16:45:46 +08:00
templates Bug 1394694 (part 2) - Mark nsIAtom-using methods in nsIXUL*.idl as [noscript]. r=janv. 2017-09-05 08:36:21 +10:00
test Bug 1371219 - Add an inputSource attribute to XULCommandEvent. r=smaug 2017-07-20 17:45:56 +02:00
moz.build
nsForwardReference.h
nsIController.idl
nsIControllers.idl
nsIXULDocument.h
nsIXULOverlayProvider.idl
nsXULCommandDispatcher.cpp Bug 1369072 - part3: nsXBLPrototypeHandler::DispatchXBLCommand() should use controller of visible window r=smaug 2017-09-07 22:54:49 +09:00
nsXULCommandDispatcher.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsXULContentSink.cpp Bug 1390428 (part 9) - Remove nsXPIDLCString. r=erahm. 2017-08-17 15:29:03 +10:00
nsXULContentSink.h Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen 2017-06-18 20:37:50 +09:00
nsXULControllers.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsXULControllers.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsXULElement.cpp Bug 1390428 (part 9) - Remove nsXPIDLCString. r=erahm. 2017-08-17 15:29:03 +10:00
nsXULElement.h Bug 1391803 - Use nsStringFwd.h for forward declaring string classes. r=froydnj 2017-08-16 16:48:52 -07:00
nsXULPopupListener.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsXULPopupListener.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsXULPrototypeCache.cpp Bug 1326520 - Rename nsIURI.path to pathQueryRef. r=valentin.gosu 2017-07-29 20:50:21 +09:00
nsXULPrototypeCache.h Bug 1363640 Part 5 - Add a table in nsXULPrototypeCache to cache XBL documents with servo backend. r=bz,heycam 2017-05-19 15:18:00 -07:00
nsXULPrototypeDocument.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsXULPrototypeDocument.h
XULDocument.cpp Bug 1395636 - Convert code to use NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED. r=peterv 2017-08-31 16:29:22 -07:00
XULDocument.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00