gecko-dev/dom/events
Masayuki Nakano 36f73c43d8 Bug 1435717 - Make calling WidgetEvent::PreventDefault*() stop cross process forwarding too r=smaug
Currently, if an event is consumed in the main process, EventStateManager
does not send it to remote process.  However, this is unexpected behavior
for some WidgetKeyboardEvent dispatchers.  OS sometimes has consumed native
key events before sending applications.  For example, Alt key on Windows
should activate menu bar of focused window but Alt key may be consumed before
focused window receives the event.  In such case, we mark Alt keyboard event
as "consumed before dispatch", and chrome treat it like as its preventDefault()
is called in web content.  (Note that for compatibility with other browsers,
the consumed state is not exposed to web content.  So, Event.defaultPrevented
returns false in web content.)

Therefore, we need to treat "consumed" state and "cross process forwarding"
state separately.  This patch makes calling WidgetEvent::PreventDefault()
always stops cross process forwarding for backward compatibility.  Additionally,
for the special case mentioned above, this patch makes
WidgetEvent::PreventDefaultBeforeDispatch() take additional argument,
|aIfStopCrossProcessForwarding|.  If this is CrossProcessForwarding::eStop,
the event won't be sent to remote process as same as calling PreventDefault().
Otherwise, CrossProcessForwarding::eHold, PreventDefaultBeforeDispatch() call
does not change "cross process forwarding" state.  I.e., if the event's
StopCrossProcessForwarding() and PreventDefault() are not called until
EventStateManager::PostHandleEvent(), the event will be sent to remote process
as usual.

MozReview-Commit-ID: IQGWJvXetxV

--HG--
extra : rebase_source : 4ccdd500e80b8fe29e469ac3b85578e1c07c8358
2018-06-25 18:17:18 +09:00
..
crashtests
test Bug 1468198 - remove tests that only run on b2g. r=smaug,mcmanus,whimboo 2018-06-27 09:52:19 -04:00
AnimationEvent.cpp Bug 1436902 part 2. Use NS_INLINE_DECL_REFCOUNTING_INHERITED for some classes that have otherwise-empty QI impls. r=mccr8 2018-02-12 15:43:55 -05:00
AnimationEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
AsyncEventDispatcher.cpp Bug 1470545: Add chromeonly "shadowrootattached" event for devtools. r=smaug 2018-06-27 11:24:43 +02:00
AsyncEventDispatcher.h Bug 1470545: Add chromeonly "shadowrootattached" event for devtools. r=smaug 2018-06-27 11:24:43 +02:00
BeforeUnloadEvent.cpp Bug 1436902 part 2. Use NS_INLINE_DECL_REFCOUNTING_INHERITED for some classes that have otherwise-empty QI impls. r=mccr8 2018-02-12 15:43:55 -05:00
BeforeUnloadEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
ClipboardEvent.cpp Bug 1444919 part 2. Remove nsIDOMClipboardEvent. r=mystor 2018-03-13 00:59:24 -04:00
ClipboardEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
CommandEvent.cpp Bug 1436902 part 2. Use NS_INLINE_DECL_REFCOUNTING_INHERITED for some classes that have otherwise-empty QI impls. r=mccr8 2018-02-12 15:43:55 -05:00
CommandEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
CompositionEvent.cpp
CompositionEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
ConstructibleEventTarget.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
ConstructibleEventTarget.h
ContentEventHandler.cpp Bug 1387143 part 28. Remove nsISelection::AsSelection(). r=mats 2018-05-08 13:52:42 -04:00
ContentEventHandler.h Bug 1433883: Remove weak pres context pointer from ContentEventHandler. r=masayuki 2018-01-29 13:04:00 +01:00
CustomEvent.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
CustomEvent.h Bug 1447472 part 2. Remove nsIDOMCustomEvent. r=qdot 2018-03-26 14:53:51 -04:00
DataTransfer.cpp Bug 1470540 - Improve performance of DataTransfer::CacheExternalClipboardFormats, r=baku,mccr8 2018-06-22 14:28:27 -04:00
DataTransfer.h Bug 1470540 - Improve performance of DataTransfer::CacheExternalClipboardFormats, r=baku,mccr8 2018-06-22 14:28:27 -04:00
DataTransferItem.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
DataTransferItem.h
DataTransferItemList.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
DataTransferItemList.h
DeviceMotionEvent.cpp
DeviceMotionEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
DOMEventTargetHelper.cpp Bug 1455052 part 8. Stop using nsIDOMEvent in docshell and dom. r=masayuki 2018-04-20 12:55:30 -04:00
DOMEventTargetHelper.h Bug 1466121 part 1 - Rename JSCompartment to JS::Compartment. r=luke 2018-06-07 16:44:40 +02:00
DragEvent.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
DragEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
Event.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
Event.h Bug 1470930: Use enums for passing arguments for event dispatch. r=smaug 2018-06-26 18:22:06 +02:00
EventDispatcher.cpp Bug 1469329, ensure mRetargetedTouchTargets has touch objects before using it, r=masayuki 2018-06-19 11:48:40 +03:00
EventDispatcher.h bug 1429572, touch.target retargeting in shadow DOM, r=masayuki 2018-05-25 18:02:59 +03:00
EventListenerManager.cpp Bug 1436409 - Remove the layout.event-regions.enabled pref and bake it in as false everywhere. r=tnikkel 2018-06-08 17:31:27 -04:00
EventListenerManager.h Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
EventListenerService.cpp Bug 1461292 part 1 - Rename JSAutoCompartment to JSAutoRealm. r=bz,luke 2018-05-16 10:53:16 +02:00
EventListenerService.h Bug 1461292 part 1 - Rename JSAutoCompartment to JSAutoRealm. r=bz,luke 2018-05-16 10:53:16 +02:00
EventNameList.h
EventStateManager.cpp Bug 1435717 - Make calling WidgetEvent::PreventDefault*() stop cross process forwarding too r=smaug 2018-06-25 18:17:18 +09:00
EventStateManager.h Bug 1461299: Make ESM not point to unbound NAC in the hover / active chain. r=smaug 2018-05-15 10:43:46 +02:00
EventStates.h Bug 1331334 - Implement :defined pseudo-class for custom elements, r=emilio 2018-06-28 14:55:45 +03:00
EventTarget.cpp Bug 1449631 part 11. Remove nsIDOMEventTarget::AddSystemEventListener. r=smaug 2018-04-05 13:42:42 -04:00
EventTarget.h Bug 1429903 part 4. Remove nsIDOMEventTarget. r=mccr8 2018-04-20 00:49:30 -04:00
FocusEvent.cpp Bug 1446708. Get rid of nsIDOMFocusEvent. r=qdot 2018-03-19 15:50:19 -04:00
FocusEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
ImageCaptureError.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
ImageCaptureError.h
IMEContentObserver.cpp Bug 1453795 - DOM/Events - Initialize member fields in classes/ structures. r=smaug 2018-06-14 22:26:29 +03:00
IMEContentObserver.h Bug 1387143 part 29. Remove nsISelection. r=mats 2018-05-08 13:52:42 -04:00
IMEStateManager.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
IMEStateManager.h Bug 1387143 part 29. Remove nsISelection. r=mats 2018-05-08 13:52:42 -04:00
InputEvent.cpp Bug 1446527 part 5. Remove unused nsIDOMUIEvent bits. r=qdot 2018-03-26 14:53:02 -04:00
InputEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
InternalMutationEvent.h Bug 1455676 part 14. Remove most use of nsIDOMNode in dom/. r=qdot 2018-05-29 22:58:49 -04:00
JSEventHandler.cpp Bug 1455055 part 6. Clean up HandleEvent implementations in dom. r=masayuki 2018-04-20 00:49:30 -04:00
JSEventHandler.h Bug 1436508 part 12. Remove nsIDOMKeyEvent. r=masayuki 2018-02-09 11:17:10 -05:00
KeyboardEvent.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
KeyboardEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
KeyNameList.h
MessageEvent.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
MessageEvent.h Bug 1470930: Use enums for passing arguments for event dispatch. r=smaug 2018-06-26 18:22:06 +02:00
MouseEvent.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
MouseEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
MouseScrollEvent.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
MouseScrollEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
moz.build Bug 1435530 - part 1: Add automated tests to check Alt + D works as Ctrl + L when Alt is content access key's modifier r=enndeakin+6102 2018-02-05 18:01:25 +09:00
MutationEvent.cpp Bug 1455676 part 14. Remove most use of nsIDOMNode in dom/. r=qdot 2018-05-29 22:58:49 -04:00
MutationEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
NotifyPaintEvent.cpp Bug 1455052 part 10. Remove various unused nsIDOMEvent bits. r=masayuki 2018-04-20 12:55:31 -04:00
NotifyPaintEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
nsIEventListenerService.idl Bug 1429903 part 2. Stop using nsIDOMEventTarget in xpidl. r=mccr8 2018-04-20 00:49:30 -04:00
PaintRequest.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
PaintRequest.h Bug 1455052 part 8. Stop using nsIDOMEvent in docshell and dom. r=masayuki 2018-04-20 12:55:30 -04:00
PhysicalKeyCodeNameList.h
PointerEvent.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
PointerEvent.h
PointerEventHandler.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
PointerEventHandler.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
ScrollAreaEvent.cpp Bug 1455052 part 10. Remove various unused nsIDOMEvent bits. r=masayuki 2018-04-20 12:55:31 -04:00
ScrollAreaEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
SimpleGestureEvent.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
SimpleGestureEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
SpeechRecognitionError.cpp
SpeechRecognitionError.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
StorageEvent.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
StorageEvent.h
TextClause.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
TextClause.h
TextComposition.cpp
TextComposition.h Bug 1453795 - DOM/Events - Initialize member fields in classes/ structures. r=smaug 2018-06-14 22:26:29 +03:00
Touch.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
Touch.h bug 1429572, touch.target retargeting in shadow DOM, r=masayuki 2018-05-25 18:02:59 +03:00
TouchEvent.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
TouchEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
TransitionEvent.cpp Bug 1436902 part 2. Use NS_INLINE_DECL_REFCOUNTING_INHERITED for some classes that have otherwise-empty QI impls. r=mccr8 2018-02-12 15:43:55 -05:00
TransitionEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
UIEvent.cpp Bug 1455676 part 14. Remove most use of nsIDOMNode in dom/. r=qdot 2018-05-29 22:58:49 -04:00
UIEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
VirtualKeyCodeList.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
WheelEvent.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
WheelEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
WheelHandlingHelper.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
WheelHandlingHelper.h Bug 1453795 - DOM/Events - Initialize member fields in classes/ structures. r=smaug 2018-06-14 22:26:29 +03:00
XULCommandEvent.cpp Bug 1453795 - DOM/Events - Initialize member fields in classes/ structures. r=smaug 2018-06-14 22:26:29 +03:00
XULCommandEvent.h Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00