gecko-dev/dom/events
Masayuki Nakano e256502715 Bug 1674044 - Make `IMEStateManager` put off to handle focused browser change while the application becomes activated r=hsivonen
`IMEStateManager::OnFocusMovedBetweenBrowsers()` is called by
`BrowserParent::UnsetTopLevelWebFocusAll()` from
`nsFocusManager::WindowRaised()` when a window becomes active from the app
itself is deactivated.  At this time, `aBlur` is  set to the last
`BrowserParent` which had focus before inactivated, and `aFocus` is always
`nullptr` because of assuming the following code in
`nsFocusManager::WindowRised()` will call `OnFocusMovedBetweenBrowsers()` to
set focus to focused browser part at that time.  However, the first call of
`OnFocusMovedBetweenBrowsers()` requesting to commit composition if there is
a composition because it believes that the focused process is just blurred and
nobody would take focus.

So, `IMEStateManager::OnFocusMovedBetweenBrowsers()` needs to wait to handle
its jobs until another its call for setting focus to the remote process when
the app is activated.

Therefore, this patch makes `IMEStateManager` manage whether the process is
active or not from the point of view of IME handling.  I.e., in the main
process, it can be treated as active when a window is the focused window in
the desktop, and in a content process, it can be treated as active when the
process has focus.  So, this is managed by `sIsActive`.

Then, `IMEStateManager` needs information of first blurred `BrowserParent`
and `last focused `BrowserParent` in the case for putting off to handle its
jobs.  Therefore, this patch adds
`IMEStateManager::sPendingFocusedBrowserSwitchingData` to manage them.

Finally, this patch makes `IMEStateManager::OnFocusMovedBetweenBrowsers()`
cancel pending handling if first blurred `BrowserParent` and last focused
`RrowserParent`are same.  And also making
`IMEStateManager::OnFocusChangeInternal()` call `OnFocusMoveBetweenBrowsers()`
if there is pending jobs of `OnFocusMoveBetweenBrowsers()`.

UThis requires an API to create the case to all windows deactive to test it.
However, there is no way to do that.  Therefore, this patch does not have
any tests.

Differential Revision: https://phabricator.services.mozilla.com/D97687
2020-11-20 14:55:31 +00:00
..
android Bug 1654103: Standardize on Black for Python code in `mozilla-central`. 2020-10-26 18:34:53 +00:00
crashtests
emacs Bug 1654103: Standardize on Black for Python code in `mozilla-central`. 2020-10-26 18:34:53 +00:00
mac Bug 1654103: Standardize on Black for Python code in `mozilla-central`. 2020-10-26 18:34:53 +00:00
test Bug 1335347 - Make `nsMenuBarListener::KeyUp` wait replay event if a content process has focus r=smaug 2020-11-20 03:49:55 +00:00
unix Bug 1654103: Standardize on Black for Python code in `mozilla-central`. 2020-10-26 18:34:53 +00:00
win Bug 1654103: Standardize on Black for Python code in `mozilla-central`. 2020-10-26 18:34:53 +00:00
AnimationEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
AnimationEvent.h
AsyncEventDispatcher.cpp Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi 2020-09-23 15:17:15 +00:00
AsyncEventDispatcher.h
BeforeUnloadEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
BeforeUnloadEvent.h
Clipboard.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
Clipboard.h
ClipboardEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
ClipboardEvent.h
CommandEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
CommandEvent.h
CompositionEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
CompositionEvent.h
ConstructibleEventTarget.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
ConstructibleEventTarget.h
ContentEventHandler.cpp Bug 1623918 - part 2: Mark `nsINode::GetSelectionRootContent()` and its root callers as `MOZ_CAN_RUN_SCRIPT` as far as possible r=smaug 2020-10-09 02:37:47 +00:00
ContentEventHandler.h Bug 1623918 - part 2: Mark `nsINode::GetSelectionRootContent()` and its root callers as `MOZ_CAN_RUN_SCRIPT` as far as possible r=smaug 2020-10-09 02:37:47 +00:00
CustomEvent.cpp
CustomEvent.h
DOMEventTargetHelper.cpp
DOMEventTargetHelper.h
DataTransfer.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
DataTransfer.h Bug 1671641 - Make `dom/events` buildable outside of `unified-build` environment. r=sg 2020-10-21 08:00:18 +00:00
DataTransferItem.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
DataTransferItem.h Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj 2020-07-01 08:29:29 +00:00
DataTransferItemList.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
DataTransferItemList.h
DeviceMotionEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
DeviceMotionEvent.h
DragEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
DragEvent.h
Event.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
Event.h
EventDispatcher.cpp Bug 1677396 - Redirect composition payloads through the refresh driver. r=smaug 2020-11-19 04:02:46 +00:00
EventDispatcher.h
EventListenerManager.cpp Bug 1671641 - Make `dom/events` buildable outside of `unified-build` environment. r=sg 2020-10-21 08:00:18 +00:00
EventListenerManager.h Bug 1668870 - Ignore touch listeners in the system group for event retargeting. r=smaug 2020-10-06 18:03:25 +00:00
EventListenerService.cpp Bug 1645339 - Use range-based for with nsTObserverArray in dom/events. r=smaug 2020-06-16 10:15:22 +00:00
EventListenerService.h
EventNameList.h Bug 1666497 - Don't flush layout from popuppositioned events. r=mconley,Gijs,smaug 2020-10-06 16:28:41 +00:00
EventStateManager.cpp Bug 1641270 - Part 8: Make the Drag&Drop to use the correct cookieJarSettings to download the url. r=smaug,dimi 2020-11-11 11:14:05 +00:00
EventStateManager.h Bug 1641270 - Part 8: Make the Drag&Drop to use the correct cookieJarSettings to download the url. r=smaug,dimi 2020-11-11 11:14:05 +00:00
EventStates.h Bug 1675349: Replace plugin behavior with a basic fallback r=jmathies,mixedpuppy 2020-11-18 15:55:34 +00:00
EventTarget.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
EventTarget.h
FocusEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
FocusEvent.h
GlobalKeyListener.cpp Bug 1671641 - Make `dom/events` buildable outside of `unified-build` environment. r=sg 2020-10-21 08:00:18 +00:00
GlobalKeyListener.h
IMEContentObserver.cpp Bug 1671641 - Make `dom/events` buildable outside of `unified-build` environment. r=sg 2020-10-21 08:00:18 +00:00
IMEContentObserver.h Bug 1623918 - part 2: Mark `nsINode::GetSelectionRootContent()` and its root callers as `MOZ_CAN_RUN_SCRIPT` as far as possible r=smaug 2020-10-09 02:37:47 +00:00
IMEStateManager.cpp Bug 1674044 - Make `IMEStateManager` put off to handle focused browser change while the application becomes activated r=hsivonen 2020-11-20 14:55:31 +00:00
IMEStateManager.h Bug 1674044 - Make `IMEStateManager` put off to handle focused browser change while the application becomes activated r=hsivonen 2020-11-20 14:55:31 +00:00
ImageCaptureError.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
ImageCaptureError.h
InputEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
InputEvent.h
InputEventOptions.h Bug 1607131 - Make `beforeinput` event for `MozEditableElement.setUserInput()` not cancelable by default r=smaug 2020-10-20 00:13:43 +00:00
InputTypeList.h
InternalMutationEvent.h
JSEventHandler.cpp
JSEventHandler.h
KeyEventHandler.cpp Bug 1671641 - Make `dom/events` buildable outside of `unified-build` environment. r=sg 2020-10-21 08:00:18 +00:00
KeyEventHandler.h
KeyNameList.h
KeyboardEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
KeyboardEvent.h
MessageEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
MessageEvent.h Bug 1653229 - Remove unnecessary includes for BindingUtils.h. r=jgilbert 2020-07-22 15:12:10 +00:00
MouseEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
MouseEvent.h
MouseScrollEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
MouseScrollEvent.h
MutationEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
MutationEvent.h
NotifyPaintEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
NotifyPaintEvent.h
PaintRequest.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
PaintRequest.h
PendingFullscreenEvent.h Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj 2020-07-01 08:29:29 +00:00
PhysicalKeyCodeNameList.h
PointerEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
PointerEvent.h
PointerEventHandler.cpp Bug 1606061 - move TouchEventsOverride to BrowsingContext. r=farre,devtools-backward-compat-reviewers 2020-11-10 15:57:30 +00:00
PointerEventHandler.h Bug 1671657 - setPointerCapture should do nothing if the element's node document is not active document for the pointer; r=smaug 2020-10-30 08:31:42 +00:00
RemoteDragStartData.cpp Bug 1641270 - Part 8: Make the Drag&Drop to use the correct cookieJarSettings to download the url. r=smaug,dimi 2020-11-11 11:14:05 +00:00
RemoteDragStartData.h Bug 1641270 - Part 8: Make the Drag&Drop to use the correct cookieJarSettings to download the url. r=smaug,dimi 2020-11-11 11:14:05 +00:00
ScrollAreaEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
ScrollAreaEvent.h
ShortcutKeyDefinitionsForBrowserCommon.h
ShortcutKeyDefinitionsForEditorCommon.h
ShortcutKeyDefinitionsForInputCommon.h
ShortcutKeyDefinitionsForTextAreaCommon.h
ShortcutKeys.cpp
ShortcutKeys.h
SimpleGestureEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
SimpleGestureEvent.h
SpeechRecognitionError.cpp Bug 1213512 use UTF8 for MediaMgrError and SpeechRecognitionError message r=jib 2020-11-15 21:59:05 +00:00
SpeechRecognitionError.h Bug 1213512 use UTF8 for MediaMgrError and SpeechRecognitionError message r=jib 2020-11-15 21:59:05 +00:00
StorageEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
StorageEvent.h Bug 1653229 - Remove unnecessary includes for BindingUtils.h. r=jgilbert 2020-07-22 15:12:10 +00:00
TextClause.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
TextClause.h Bug 1671641 - Make `dom/events` buildable outside of `unified-build` environment. r=sg 2020-10-21 08:00:18 +00:00
TextComposition.cpp Bug 1672095 - Always send NOTIFY_IME_OF_BLUR on GeckoView. r=masayuki 2020-10-23 08:07:02 +00:00
TextComposition.h Bug 1623918 - part 2: Mark `nsINode::GetSelectionRootContent()` and its root callers as `MOZ_CAN_RUN_SCRIPT` as far as possible r=smaug 2020-10-09 02:37:47 +00:00
Touch.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
Touch.h
TouchEvent.cpp Bug 1606061 - move TouchEventsOverride to BrowsingContext. r=farre,devtools-backward-compat-reviewers 2020-11-10 15:57:30 +00:00
TouchEvent.h
TransitionEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
TransitionEvent.h
UIEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
UIEvent.h Bug 1667594 - Avoid including nsLayoutUtils.h from various headers. r=kats 2020-09-26 17:55:00 +00:00
VirtualKeyCodeList.h
WheelEvent.cpp Bug 1519636 - Reformat recent changes to the Google coding style r=andi,necko-reviewers,dragana 2020-11-16 22:09:25 +00:00
WheelEvent.h Bug 1392460 - Add a couple prefs to expose DOM_DELTA_PIXEL rather than DOM_DELTA_LINES to the web. r=masayuki,smaug 2020-11-07 16:12:34 +00:00
WheelHandlingHelper.cpp Bug 1671641 - Make `dom/events` buildable outside of `unified-build` environment. r=sg 2020-10-21 08:00:18 +00:00
WheelHandlingHelper.h Bug 1652017 - Remove unnecessary includes for expensive nsIFrame.h. r=emilio 2020-07-15 13:44:39 +00:00
XULCommandEvent.cpp Bug 1674637 - Use nested namespaces in dom/ r=sg,andi 2020-11-04 17:04:01 +00:00
XULCommandEvent.h
moz.build Bug 1654103: Standardize on Black for Python code in `mozilla-central`. 2020-10-26 18:34:53 +00:00
nsIEventListenerService.idl