Browse Source

import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 895274 part.25 Rename NS_MOUSE_MOVE to eMouseMove r=smaug (fd637481f2)
- Bug 895274 part.26 Rename NS_MOUSE_BUTTON_UP to eMouseUp r=smaug (01314a434b)
- Bug 895274 part.27 Rename NS_MOUSE_BUTTON_DOWN to eMouseDown r=smaug (b4839f190c)
- Bug 895274 part.28 Rename NS_MOUSE_ENTER_WIDGET to eMouseEnterIntoWidget r=smaug (148807ec51)
- Bug 895274 part.29 Rename NS_MOUSE_EXIT_WIDGET to eMouseExitFromWidget r=smaug (249a5db8de)
- Bug 1157195, null check for widget before generating drag events, r=masayuki (ca08721f76)
- Bug 1156964, consume tab key also in e10s, r=felipe (4f169cb329)
- Bug 1158633, if EventStateManager::mGestureDownContent is non-null, so should mGestureDownFrameOwner be, r=enndeakin (8975a44344)
- Bug 895274 part.30 Rename NS_MOUSE_DOUBLECLICK to eMouseDoubleClick r=smaug (fe39991215)
- style (5b3468be0c)
- Bug 895274 part.31 Rename NS_MOUSE_CLICK to eMouseClick r=smaug (c442dc8a76)
- Bug 895274 part.32 Rename NS_MOUSE_ACTIVATE to eMouseActivate r=smaug (46e3e0712a)
- Bug 895274 part.33 Rename NS_MOUSE_OVER to eMouseOver r=smaug (fd9f4ad861)
- Bug 895274 part.33 Rename NS_MOUSE_OVER to eMouseOver r=smaug (2631639696)
- missing parts of Bug 1173725 - part 1: force top border to be visible on windows 10 (2533fe48c3)
- Bug 1184942 - Use DPI scaling factor to ensure top window border is correct thickness. r=jimm (e0ffd4538a)
- Bug 1163113 - Implement -moz-window-dragging on Windows for Graphene r=jimm (d4c02f04dd)
- Bug 895274 part.35 Rename NS_MOUSE_MOZHITTEST to eMouseHitTest r=smaug (aea1520561)
- reinstatiate full WebRTC configure options (7519d9431a)
- Bug 1106958 - Use android.media.MediaCodec for decoding in WebRTC stack. r=snorp, r=gcp, r=ted (0a9f2ca886)
- ... and add back missing file critical_section_win.cc in webrtc
master
roytam1 2 months ago
parent
commit
2cbd76aba8
  1. 4
      accessible/base/nsCoreUtils.cpp
  2. 8
      accessible/generic/Accessible.cpp
  3. 2
      build/gyp.mozbuild
  4. 64
      configure.in
  5. 20
      dom/base/Element.cpp
  6. 6
      dom/base/FragmentOrElement.cpp
  7. 12
      dom/base/nsContentUtils.cpp
  8. 8
      dom/base/nsGlobalWindow.cpp
  9. 12
      dom/events/Event.cpp
  10. 16
      dom/events/EventNameList.h
  11. 116
      dom/events/EventStateManager.cpp
  12. 4
      dom/events/EventStateManager.h
  13. 4
      dom/events/IMEContentObserver.cpp
  14. 10
      dom/events/WheelHandlingHelper.cpp
  15. 10
      dom/html/HTMLButtonElement.cpp
  16. 36
      dom/html/HTMLInputElement.cpp
  17. 10
      dom/html/HTMLLabelElement.cpp
  18. 4
      dom/html/HTMLMenuItemElement.cpp
  19. 2
      dom/html/HTMLTextAreaElement.cpp
  20. 10
      dom/html/nsGenericHTMLElement.cpp
  21. 6
      dom/ipc/TabChild.cpp
  22. 6
      dom/ipc/TabParent.cpp
  23. 92
      dom/plugins/base/nsPluginInstanceOwner.cpp
  24. 131
      dom/xul/nsXULElement.cpp
  25. 12
      editor/libeditor/nsEditorEventListener.cpp
  26. 10
      gfx/layers/apz/src/APZCTreeManager.cpp
  27. 12
      gfx/layers/apz/util/APZCCallbackHelper.cpp
  28. 18
      layout/base/AccessibleCaretEventHub.cpp
  29. 6
      layout/base/SelectionCarets.cpp
  30. 6
      layout/base/TouchCaret.cpp
  31. 6
      layout/base/gtest/TestAccessibleCaretEventHub.cpp
  32. 49
      layout/base/nsPresShell.cpp
  33. 2
      layout/forms/nsComboboxControlFrame.cpp
  34. 2
      layout/forms/nsImageControlFrame.cpp
  35. 6
      layout/forms/nsListControlFrame.cpp
  36. 10
      layout/generic/nsFrame.cpp
  37. 6
      layout/generic/nsFrameSetFrame.cpp
  38. 6
      layout/generic/nsImageFrame.cpp
  39. 6
      layout/generic/nsPluginFrame.cpp
  40. 2
      layout/xul/nsButtonBoxFrame.cpp
  41. 10
      layout/xul/nsMenuFrame.cpp
  42. 10
      layout/xul/nsResizerFrame.cpp
  43. 2
      layout/xul/nsRootBoxFrame.cpp
  44. 10
      layout/xul/nsScrollBoxFrame.cpp
  45. 8
      layout/xul/nsScrollbarButtonFrame.cpp
  46. 18
      layout/xul/nsSliderFrame.cpp
  47. 4
      layout/xul/nsSplitterFrame.cpp
  48. 8
      layout/xul/nsTitleBarFrame.cpp
  49. 4
      layout/xul/tree/nsTreeBodyFrame.cpp
  50. 3
      media/webrtc/moz.build
  51. 14
      media/webrtc/signaling/signaling.gyp
  52. 31
      media/webrtc/signaling/src/media-conduit/MediaCodecVideoCodec.cpp
  53. 31
      media/webrtc/signaling/src/media-conduit/MediaCodecVideoCodec.h
  54. 1004
      media/webrtc/signaling/src/media-conduit/WebrtcMediaCodecVP8VideoCodec.cpp
  55. 114
      media/webrtc/signaling/src/media-conduit/WebrtcMediaCodecVP8VideoCodec.h
  56. 68
      media/webrtc/signaling/src/peerconnection/MediaPipelineFactory.cpp
  57. 30
      media/webrtc/trunk/webrtc/system_wrappers/source/critical_section_win.cc
  58. 4
      view/nsViewManager.cpp
  59. 23
      widget/EventMessageList.h
  60. 16
      widget/InputData.cpp
  61. 2
      widget/MouseEvents.h
  62. 22
      widget/WidgetEventImpl.cpp
  63. 24
      widget/cocoa/nsChildView.mm
  64. 17
      widget/gtk/nsWindow.cpp
  65. 20
      widget/nsBaseWidget.cpp
  66. 11
      widget/qt/nsWindow.cpp
  67. 6
      widget/uikit/nsWindow.mm
  68. 3
      widget/windows/IMMHandler.cpp
  69. 10
      widget/windows/TSFTextStore.cpp
  70. 8
      widget/windows/WinUtils.cpp
  71. 164
      widget/windows/nsWindow.cpp
  72. 4
      widget/windows/nsWindow.h

4
accessible/base/nsCoreUtils.cpp

@ -110,10 +110,10 @@ nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
presContext->AppUnitsToDevPixels(offset.y);
// XUL is just desktop, so there is no real reason for senfing touch events.
DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, cnvdX, cnvdY,
DispatchMouseEvent(eMouseDown, cnvdX, cnvdY,
tcContent, tcFrame, presShell, rootWidget);
DispatchMouseEvent(NS_MOUSE_BUTTON_UP, cnvdX, cnvdY,
DispatchMouseEvent(eMouseUp, cnvdX, cnvdY,
tcContent, tcFrame, presShell, rootWidget);
}

8
accessible/generic/Accessible.cpp

@ -537,7 +537,7 @@ Accessible::ChildAtPoint(int32_t aX, int32_t aY,
nsIntRect rootRect;
rootWidget->GetScreenBounds(rootRect);
WidgetMouseEvent dummyEvent(true, NS_MOUSE_MOVE, rootWidget,
WidgetMouseEvent dummyEvent(true, eMouseMove, rootWidget,
WidgetMouseEvent::eSynthesized);
dummyEvent.refPoint = LayoutDeviceIntPoint(aX - rootRect.x, aY - rootRect.y);
@ -1832,9 +1832,11 @@ Accessible::DispatchClickEvent(nsIContent *aContent, uint32_t aActionIndex)
// Simulate a touch interaction by dispatching touch events with mouse events.
nsCoreUtils::DispatchTouchEvent(NS_TOUCH_START, x, y, aContent, frame, presShell, widget);
nsCoreUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, x, y, aContent, frame, presShell, widget);
nsCoreUtils::DispatchMouseEvent(eMouseDown, x, y, aContent, frame,
presShell, widget);
nsCoreUtils::DispatchTouchEvent(NS_TOUCH_END, x, y, aContent, frame, presShell, widget);
nsCoreUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_UP, x, y, aContent, frame, presShell, widget);
nsCoreUtils::DispatchMouseEvent(eMouseUp, x, y, aContent, frame,
presShell, widget);
}
void

2
build/gyp.mozbuild

@ -44,6 +44,7 @@ gyp_vars = {
'moz_widget_toolkit_gonk': 0,
'moz_webrtc_omx': 0,
'moz_webrtc_mediacodec': 0,
# (for vp8) chromium sets to 0 also
'use_temporal_layers': 0,
@ -80,6 +81,7 @@ elif os == 'Android':
else:
gyp_vars.update(
gtest_target_type='executable',
moz_webrtc_mediacodec=1,
android_toolchain=CONFIG['ANDROID_TOOLCHAIN'],
)

64
configure.in

@ -3737,7 +3737,10 @@ else
MOZ_FMP4=
fi
MOZ_FFMPEG=
MOZ_WEBRTC=
MOZ_WEBRTC=1
MOZ_WEBRTC_SIGNALING=
MOZ_WEBRTC_ASSERT_ALWAYS=1
MOZ_WEBRTC_HARDWARE_AEC_NS=
MOZ_ANDROID_OMX=
MOZ_MEDIA_NAVIGATOR=
MOZ_OMX_PLUGIN=
@ -4898,13 +4901,46 @@ if test "${MOZ_WIDGET_TOOLKIT}" = "linuxgl" -a "$ACCESSIBILITY" != "1"; then
AC_MSG_ERROR(["Accessibility is required for the linuxgl widget backend"])
fi
dnl Turn off webrtc for OS's we don't handle yet, but allow
dnl --enable-webrtc to override. Can disable for everything in
dnl the master list above.
if test -n "$MOZ_WEBRTC"; then
case "$target" in
*-linux*|*-mingw*|*-darwin*|*-android*|*-linuxandroid*|*-dragonfly*|*-freebsd*|*-netbsd*|*-openbsd*)
dnl Leave enabled
;;
*)
dnl default to disabled for all others
MOZ_WEBRTC=
;;
esac
fi
AC_TRY_COMPILE([#include <linux/ethtool.h>],
[ struct ethtool_cmd cmd; cmd.speed_hi = 0; ],
MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI=1)
AC_SUBST(MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI)
# target_arch is from {ia32|x64|arm|ppc}
case "$CPU_ARCH" in
x86_64 | arm | x86 | ppc* | ia64)
:
;;
*)
# unsupported arch for webrtc
MOZ_WEBRTC=
;;
esac
dnl ========================================================
dnl = Enable WebRTC code
dnl = Disable WebRTC code
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(webrtc,
[ --enable-webrtc Enable support for WebRTC],
MOZ_WEBRTC=1,
MOZ_WEBRTC=)
MOZ_ARG_DISABLE_BOOL(webrtc,
[ --disable-webrtc Disable support for WebRTC],
MOZ_WEBRTC=,
MOZ_WEBRTC=1)
if test -n "$MOZ_WEBRTC"; then
AC_DEFINE(MOZ_WEBRTC)
@ -4932,16 +4968,28 @@ else
MOZ_SYNTH_PICO=
fi
dnl ========================================================
dnl = Force hardware AEC, disable webrtc.org AEC
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(hardware-aec-ns,
[ --enable-hardware-aec-ns Enable support for hardware AEC and noise suppression],
MOZ_WEBRTC_HARDWARE_AEC_NS=1,
MOZ_WEBRTC_HARDWARE_AEC_NS=)
if test -n "$MOZ_WEBRTC_HARDWARE_AEC_NS"; then
AC_DEFINE(MOZ_WEBRTC_HARDWARE_AEC_NS)
fi
AC_SUBST(MOZ_WEBRTC)
AC_SUBST(MOZ_WEBRTC_LEAKING_TESTS)
AC_SUBST(MOZ_WEBRTC_SIGNALING)
AC_SUBST(MOZ_PEERCONNECTION)
AC_SUBST(MOZ_WEBRTC_ASSERT_ALWAYS)
AC_SUBST(MOZ_WEBRTC_HARDWARE_AEC_NS)
AC_SUBST(MOZ_SCTP)
AC_SUBST(MOZ_SRTP)
AC_SUBST_LIST(MOZ_WEBRTC_X11_LIBS)
dnl ========================================================
dnl Use integers over floats for audio on B2G and Android
dnl (regarless of the CPU architecture, because audio
dnl backends for those platforms don't support floats. We also

20
dom/base/Element.cpp

@ -2089,7 +2089,7 @@ Element::DispatchClickEvent(nsPresContext* aPresContext,
NS_PRECONDITION(aSourceEvent, "Must have source event");
NS_PRECONDITION(aStatus, "Null out param?");
WidgetMouseEvent event(aSourceEvent->mFlags.mIsTrusted, NS_MOUSE_CLICK,
WidgetMouseEvent event(aSourceEvent->mFlags.mIsTrusted, eMouseClick,
aSourceEvent->widget, WidgetMouseEvent::eReal);
event.refPoint = aSourceEvent->refPoint;
uint32_t clickCount = 1;
@ -2903,7 +2903,7 @@ Element::CheckHandleEventForLinksPrecondition(EventChainVisitor& aVisitor,
{
if (aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault ||
(!aVisitor.mEvent->mFlags.mIsTrusted &&
(aVisitor.mEvent->mMessage != NS_MOUSE_CLICK) &&
(aVisitor.mEvent->mMessage != eMouseClick) &&
(aVisitor.mEvent->mMessage != eKeyPress) &&
(aVisitor.mEvent->mMessage != NS_UI_ACTIVATE)) ||
!aVisitor.mPresContext ||
@ -2921,9 +2921,9 @@ Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor)
// Optimisation: return early if this event doesn't interest us.
// IMPORTANT: this switch and the switch below it must be kept in sync!
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_OVER:
case eMouseOver:
case NS_FOCUS_CONTENT:
case NS_MOUSE_OUT:
case eMouseOut:
case NS_BLUR_CONTENT:
break;
default:
@ -2942,7 +2942,7 @@ Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor)
// updated even if the event is consumed before we have a chance to set it.
switch (aVisitor.mEvent->mMessage) {
// Set the status bar similarly for mouseover and focus
case NS_MOUSE_OVER:
case eMouseOver:
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
// FALL THROUGH
case NS_FOCUS_CONTENT: {
@ -2957,7 +2957,7 @@ Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor)
}
break;
}
case NS_MOUSE_OUT:
case eMouseOut:
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
// FALL THROUGH
case NS_BLUR_CONTENT:
@ -2982,8 +2982,8 @@ Element::PostHandleEventForLinks(EventChainPostVisitor& aVisitor)
// Optimisation: return early if this event doesn't interest us.
// IMPORTANT: this switch and the switch below it must be kept in sync!
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_CLICK:
case eMouseDown:
case eMouseClick:
case NS_UI_ACTIVATE:
case eKeyPress:
break;
@ -3000,7 +3000,7 @@ Element::PostHandleEventForLinks(EventChainPostVisitor& aVisitor)
nsresult rv = NS_OK;
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
{
if (aVisitor.mEvent->AsMouseEvent()->button ==
WidgetMouseEvent::eLeftButton) {
@ -3023,7 +3023,7 @@ Element::PostHandleEventForLinks(EventChainPostVisitor& aVisitor)
}
break;
case NS_MOUSE_CLICK: {
case eMouseClick: {
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
if (mouseEvent->IsLeftClickEvent()) {
if (mouseEvent->IsControl() || mouseEvent->IsMeta() ||

6
dom/base/FragmentOrElement.cpp

@ -677,8 +677,8 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
// Don't propagate mouseover and mouseout events when mouse is moving
// inside chrome access only content.
bool isAnonForEvents = IsRootOfChromeAccessOnlySubtree();
if ((aVisitor.mEvent->mMessage == NS_MOUSE_OVER ||
aVisitor.mEvent->mMessage == NS_MOUSE_OUT ||
if ((aVisitor.mEvent->mMessage == eMouseOver ||
aVisitor.mEvent->mMessage == eMouseOut ||
aVisitor.mEvent->mMessage == NS_POINTER_OVER ||
aVisitor.mEvent->mMessage == NS_POINTER_OUT) &&
// Check if we should stop event propagation when event has just been
@ -739,7 +739,7 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
printf("Stopping %s propagation:"
"\n\toriginalTarget=%s \n\tcurrentTarget=%s %s"
"\n\trelatedTarget=%s %s \n%s",
(aVisitor.mEvent->mMessage == NS_MOUSE_OVER)
(aVisitor.mEvent->mMessage == eMouseOver)
? "mouseover" : "mouseout",
NS_ConvertUTF16toUTF8(ot).get(),
NS_ConvertUTF16toUTF8(ct).get(),

12
dom/base/nsContentUtils.cpp

@ -7839,20 +7839,20 @@ nsContentUtils::SendMouseEvent(nsCOMPtr<nsIPresShell> aPresShell,
EventMessage msg;
bool contextMenuKey = false;
if (aType.EqualsLiteral("mousedown"))
msg = NS_MOUSE_BUTTON_DOWN;
msg = eMouseDown;
else if (aType.EqualsLiteral("mouseup"))
msg = NS_MOUSE_BUTTON_UP;
msg = eMouseUp;
else if (aType.EqualsLiteral("mousemove"))
msg = NS_MOUSE_MOVE;
msg = eMouseMove;
else if (aType.EqualsLiteral("mouseover"))
msg = NS_MOUSE_ENTER_WIDGET;
msg = eMouseEnterIntoWidget;
else if (aType.EqualsLiteral("mouseout"))
msg = NS_MOUSE_EXIT_WIDGET;
msg = eMouseExitFromWidget;
else if (aType.EqualsLiteral("contextmenu")) {
msg = NS_CONTEXTMENU;
contextMenuKey = (aButton == 0);
} else if (aType.EqualsLiteral("MozMouseHittest"))
msg = NS_MOUSE_MOZHITTEST;
msg = eMouseHitTest;
else
return NS_ERROR_FAILURE;

8
dom/base/nsGlobalWindow.cpp

@ -3056,7 +3056,7 @@ nsGlobalWindow::PreHandleEvent(EventChainPreVisitor& aVisitor)
aVisitor.mCanHandle = true;
aVisitor.mForceContentDispatch = true; //FIXME! Bug 329119
if ((msg == NS_MOUSE_MOVE) && gEntropyCollector) {
if (msg == eMouseMove && gEntropyCollector) {
//Chances are this counter will overflow during the life of the
//process, but that's OK for our case. Means we get a little
//more entropy.
@ -3079,11 +3079,9 @@ nsGlobalWindow::PreHandleEvent(EventChainPreVisitor& aVisitor)
if (window) {
mIsHandlingResizeEvent = true;
}
} else if (msg == NS_MOUSE_BUTTON_DOWN &&
aVisitor.mEvent->mFlags.mIsTrusted) {
} else if (msg == eMouseDown && aVisitor.mEvent->mFlags.mIsTrusted) {
gMouseDown = true;
} else if ((msg == NS_MOUSE_BUTTON_UP ||
msg == NS_DRAGDROP_END) &&
} else if ((msg == eMouseUp || msg == NS_DRAGDROP_END) &&
aVisitor.mEvent->mFlags.mIsTrusted) {
gMouseDown = false;
if (gDragServiceDisabled) {

12
dom/events/Event.cpp

@ -771,7 +771,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
uint32_t key = aEvent->AsKeyboardEvent()->keyCode;
switch(aEvent->mMessage) {
case eKeyPress:
// return key on focused button. see note at NS_MOUSE_CLICK.
// return key on focused button. see note at eMouseClick.
if (key == nsIDOMKeyEvent::DOM_VK_RETURN) {
abuse = openAllowed;
} else if (PopupAllowedForEvent("keypress")) {
@ -779,7 +779,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
}
break;
case eKeyUp:
// space key on focused button. see note at NS_MOUSE_CLICK.
// space key on focused button. see note at eMouseClick.
if (key == nsIDOMKeyEvent::DOM_VK_SPACE) {
abuse = openAllowed;
} else if (PopupAllowedForEvent("keyup")) {
@ -818,17 +818,17 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
if (aEvent->mFlags.mIsTrusted &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
switch(aEvent->mMessage) {
case NS_MOUSE_BUTTON_UP :
case eMouseUp:
if (PopupAllowedForEvent("mouseup")) {
abuse = openControlled;
}
break;
case NS_MOUSE_BUTTON_DOWN :
case eMouseDown:
if (PopupAllowedForEvent("mousedown")) {
abuse = openControlled;
}
break;
case NS_MOUSE_CLICK :
case eMouseClick:
/* Click events get special treatment because of their
historical status as a more legitimate event handler. If
click popups are enabled in the prefs, clear the popup
@ -837,7 +837,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
abuse = openAllowed;
}
break;
case NS_MOUSE_DOUBLECLICK :
case eMouseDoubleClick:
if (PopupAllowedForEvent("dblclick")) {
abuse = openControlled;
}

16
dom/events/EventNameList.h

@ -165,7 +165,7 @@ EVENT(change,
EventNameType_HTMLXUL,
eBasicEventClass)
EVENT(click,
NS_MOUSE_CLICK,
eMouseClick,
EventNameType_All,
eMouseEventClass)
EVENT(contextmenu,
@ -175,7 +175,7 @@ EVENT(contextmenu,
// Not supported yet
// EVENT(cuechange)
EVENT(dblclick,
NS_MOUSE_DOUBLECLICK,
eMouseDoubleClick,
EventNameType_HTMLXUL,
eMouseEventClass)
EVENT(drag,
@ -267,7 +267,7 @@ EVENT(loadstart,
EventNameType_HTML,
eBasicEventClass)
EVENT(mousedown,
NS_MOUSE_BUTTON_DOWN,
eMouseDown,
EventNameType_All,
eMouseEventClass)
EVENT(mouseenter,
@ -279,19 +279,19 @@ EVENT(mouseleave,
EventNameType_All,
eMouseEventClass)
EVENT(mousemove,
NS_MOUSE_MOVE,
eMouseMove,
EventNameType_All,
eMouseEventClass)
EVENT(mouseout,
NS_MOUSE_OUT,
eMouseOut,
EventNameType_All,
eMouseEventClass)
EVENT(mouseover,
NS_MOUSE_OVER,
eMouseOver,
EventNameType_All,
eMouseEventClass)
EVENT(mouseup,
NS_MOUSE_BUTTON_UP,
eMouseUp,
EventNameType_All,
eMouseEventClass)
EVENT(mozfullscreenchange,
@ -602,7 +602,7 @@ DOCUMENT_ONLY_EVENT(visibilitychange,
eBasicEventClass)
NON_IDL_EVENT(MozMouseHittest,
NS_MOUSE_MOZHITTEST,
eMouseHitTest,
EventNameType_None,
eMouseEventClass)

116
dom/events/EventStateManager.cpp

@ -494,13 +494,13 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
mCurrentTarget = aTargetFrame;
mCurrentTargetContent = nullptr;
// Do not take account NS_MOUSE_ENTER_WIDGET/EXIT_WIDGET so that loading a page
// when user is not active doesn't change the state to active.
// Do not take account eMouseEnterIntoWidget/ExitFromWidget so that loading
// a page when user is not active doesn't change the state to active.
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
if (aEvent->mFlags.mIsTrusted &&
((mouseEvent && mouseEvent->IsReal() &&
mouseEvent->mMessage != NS_MOUSE_ENTER_WIDGET &&
mouseEvent->mMessage != NS_MOUSE_EXIT_WIDGET) ||
mouseEvent->mMessage != eMouseEnterIntoWidget &&
mouseEvent->mMessage != eMouseExitFromWidget) ||
aEvent->mClass == eWheelEventClass ||
aEvent->mClass == ePointerEventClass ||
aEvent->mClass == eTouchEventClass ||
@ -518,7 +518,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
nsCOMPtr<nsINode> node = do_QueryInterface(aTargetContent);
if (node &&
(aEvent->mMessage == eKeyUp || aEvent->mMessage == NS_MOUSE_BUTTON_UP ||
(aEvent->mMessage == eKeyUp || aEvent->mMessage == eMouseUp ||
aEvent->mMessage == NS_WHEEL_WHEEL || aEvent->mMessage == NS_TOUCH_END ||
aEvent->mMessage == NS_POINTER_UP)) {
nsIDocument* doc = node->OwnerDoc();
@ -564,7 +564,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
return NS_ERROR_DOM_INVALID_STATE_ERR;
}
break;
case NS_MOUSE_BUTTON_DOWN: {
case eMouseDown: {
switch (mouseEvent->button) {
case WidgetMouseEvent::eLeftButton:
BeginTrackingDragGesture(aPresContext, mouseEvent, aTargetFrame);
@ -583,7 +583,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
}
break;
}
case NS_MOUSE_BUTTON_UP: {
case eMouseUp: {
switch (mouseEvent->button) {
case WidgetMouseEvent::eLeftButton:
if (Prefs::ClickHoldContextMenu()) {
@ -599,8 +599,8 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
}
break;
}
case NS_MOUSE_ENTER_WIDGET:
// In some cases on e10s NS_MOUSE_ENTER_WIDGET
case eMouseEnterIntoWidget:
// In some cases on e10s eMouseEnterIntoWidget
// event was sent twice into child process of content.
// (From specific widget code (sending is not permanent) and
// from ESM::DispatchMouseOrPointerEvent (sending is permanent)).
@ -608,20 +608,21 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
// suppress sending accidental event from widget code.
aEvent->mFlags.mNoCrossProcessBoundaryForwarding = true;
break;
case NS_MOUSE_EXIT_WIDGET:
// If this is a remote frame, we receive NS_MOUSE_EXIT_WIDGET from the parent
// the mouse exits our content. Since the parent may update the cursor
// while the mouse is outside our frame, and since PuppetWidget caches the
// current cursor internally, re-entering our content (say from over a
// window edge) wont update the cursor if the cached value and the current
// cursor match. So when the mouse exits a remote frame, clear the cached
// widget cursor so a proper update will occur when the mouse re-enters.
case eMouseExitFromWidget:
// If this is a remote frame, we receive eMouseExitFromWidget from the
// parent the mouse exits our content. Since the parent may update the
// cursor while the mouse is outside our frame, and since PuppetWidget
// caches the current cursor internally, re-entering our content (say from
// over a window edge) wont update the cursor if the cached value and the
// current cursor match. So when the mouse exits a remote frame, clear the
// cached widget cursor so a proper update will occur when the mouse
// re-enters.
if (XRE_IsContentProcess()) {
ClearCachedWidgetCursor(mCurrentTarget);
}
// Flag helps to suppress double event sending into process of content.
// For more information see comment above, at NS_MOUSE_ENTER_WIDGET case.
// For more information see comment above, at eMouseEnterIntoWidget case.
aEvent->mFlags.mNoCrossProcessBoundaryForwarding = true;
// If the event is not a top-level window exit, then it's not
@ -631,7 +632,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
// Treat it as a synthetic move so we don't generate spurious
// "exit" or "move" events. Any necessary "out" or "over" events
// will be generated by GenerateMouseEnterExit
mouseEvent->mMessage = NS_MOUSE_MOVE;
mouseEvent->mMessage = eMouseMove;
mouseEvent->reason = WidgetMouseEvent::eSynthesized;
// then fall through...
} else {
@ -644,7 +645,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
aEvent->mMessage = eVoidEvent;
break;
}
case NS_MOUSE_MOVE:
case eMouseMove:
case NS_POINTER_DOWN:
case NS_POINTER_MOVE: {
// on the Mac, GenerateDragGesture() may not return until the drag
@ -1186,12 +1187,12 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
return true;
case eMouseEventClass:
switch (aEvent.mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_BUTTON_UP:
case NS_MOUSE_MOVE:
case eMouseDown:
case eMouseUp:
case eMouseMove:
case NS_CONTEXTMENU:
case NS_MOUSE_ENTER_WIDGET:
case NS_MOUSE_EXIT_WIDGET:
case eMouseEnterIntoWidget:
case eMouseExitFromWidget:
return true;
default:
return false;
@ -1538,6 +1539,9 @@ EventStateManager::BeginTrackingDragGesture(nsPresContext* aPresContext,
getter_AddRefs(mGestureDownContent));
mGestureDownFrameOwner = inDownFrame->GetContent();
if (!mGestureDownFrameOwner) {
mGestureDownFrameOwner = mGestureDownContent;
}
}
mGestureModifiers = inDownEvent->modifiers;
mGestureDownButtons = inDownEvent->buttons;
@ -1596,7 +1600,7 @@ EventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
if (IsTrackingDragGesture()) {
mCurrentTarget = mGestureDownFrameOwner->GetPrimaryFrame();
if (!mCurrentTarget) {
if (!mCurrentTarget || !mCurrentTarget->GetNearestWidget()) {
StopTrackingDragGesture();
return;
}
@ -2745,6 +2749,8 @@ EventStateManager::PostHandleKeyboardEvent(WidgetKeyboardEvent* aKeyboardEvent,
case NS_VK_F6:
// This is to prevent keyboard scrolling while alt modifier in use.
if (!aKeyboardEvent->IsAlt()) {
aStatus = nsEventStatus_eConsumeNoDefault;
// Handling the tab event after it was sent to content is bad,
// because to the FocusManager the remote-browser looks like one
// element, so we would just move the focus to the next element
@ -2768,7 +2774,6 @@ EventStateManager::PostHandleKeyboardEvent(WidgetKeyboardEvent* aKeyboardEvent,
nsIFocusManager::FLAG_BYKEY,
getter_AddRefs(result));
}
aStatus = nsEventStatus_eConsumeNoDefault;
}
return;
case 0:
@ -2807,8 +2812,8 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
// Most of the events we handle below require a frame.
// Add special cases here.
if (!mCurrentTarget && aEvent->mMessage != NS_MOUSE_BUTTON_UP &&
aEvent->mMessage != NS_MOUSE_BUTTON_DOWN) {
if (!mCurrentTarget && aEvent->mMessage != eMouseUp &&
aEvent->mMessage != eMouseDown) {
return NS_OK;
}
@ -2817,7 +2822,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
nsresult ret = NS_OK;
switch (aEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
{
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
if (mouseEvent->button == WidgetMouseEvent::eLeftButton &&
@ -3029,7 +3034,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
}
break;
}
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
{
ClearGlobalActiveContent(this);
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
@ -3348,7 +3353,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
}
break;
case NS_MOUSE_ENTER_WIDGET:
case eMouseEnterIntoWidget:
if (mCurrentTarget) {
nsCOMPtr<nsIContent> targetContent;
mCurrentTarget->GetContentForEvent(aEvent, getter_AddRefs(targetContent));
@ -3357,7 +3362,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
break;
#ifdef XP_MACOSX
case NS_MOUSE_ACTIVATE:
case eMouseActivate:
if (mCurrentTarget) {
nsCOMPtr<nsIContent> targetContent;
mCurrentTarget->GetContentForEvent(aEvent, getter_AddRefs(targetContent));
@ -3773,8 +3778,8 @@ EventStateManager::DispatchMouseOrPointerEvent(WidgetMouseEvent* aMouseEvent,
if (sIsPointerLocked &&
(aMessage == NS_MOUSELEAVE ||
aMessage == NS_MOUSEENTER ||
aMessage == NS_MOUSE_OVER ||
aMessage == NS_MOUSE_OUT)) {
aMessage == eMouseOver ||
aMessage == eMouseOut)) {
mCurrentTargetContent = nullptr;
nsCOMPtr<Element> pointerLockedElement =
do_QueryReferent(EventStateManager::sPointerLockedElement);
@ -3822,10 +3827,10 @@ EventStateManager::DispatchMouseOrPointerEvent(WidgetMouseEvent* aMouseEvent,
// If we are entering/leaving remote content, dispatch a mouse enter/exit
// event to the remote frame.
if (IsRemoteTarget(aTargetContent)) {
if (aMessage == NS_MOUSE_OUT) {
if (aMessage == eMouseOut) {
// For remote content, send a "top-level" widget mouse exit event.
nsAutoPtr<WidgetMouseEvent> remoteEvent;
CreateMouseOrPointerWidgetEvent(aMouseEvent, NS_MOUSE_EXIT_WIDGET,
CreateMouseOrPointerWidgetEvent(aMouseEvent, eMouseExitFromWidget,
aRelatedContent, remoteEvent);
remoteEvent->exit = WidgetMouseEvent::eTopLevel;
@ -3835,9 +3840,9 @@ EventStateManager::DispatchMouseOrPointerEvent(WidgetMouseEvent* aMouseEvent,
// proper target via GetEventTarget which will return mCurrentTarget.
mCurrentTarget = targetFrame;
HandleCrossProcessEvent(remoteEvent, &status);
} else if (aMessage == NS_MOUSE_OVER) {
} else if (aMessage == eMouseOver) {
nsAutoPtr<WidgetMouseEvent> remoteEvent;
CreateMouseOrPointerWidgetEvent(aMouseEvent, NS_MOUSE_ENTER_WIDGET,
CreateMouseOrPointerWidgetEvent(aMouseEvent, eMouseEnterIntoWidget,
aRelatedContent, remoteEvent);
HandleCrossProcessEvent(remoteEvent, &status);
}
@ -3963,7 +3968,7 @@ EventStateManager::NotifyMouseOut(WidgetMouseEvent* aMouseEvent,
NS_MOUSELEAVE);
// Fire mouseout
DispatchMouseOrPointerEvent(aMouseEvent, isPointer ? NS_POINTER_OUT : NS_MOUSE_OUT,
DispatchMouseOrPointerEvent(aMouseEvent, isPointer ? NS_POINTER_OUT : eMouseOut,
wrapper->mLastOverElement, aMovingInto);
wrapper->mLastOverFrame = nullptr;
@ -4037,7 +4042,7 @@ EventStateManager::NotifyMouseOver(WidgetMouseEvent* aMouseEvent,
// Fire mouseover
wrapper->mLastOverFrame =
DispatchMouseOrPointerEvent(aMouseEvent,
isPointer ? NS_POINTER_OVER : NS_MOUSE_OVER,
isPointer ? NS_POINTER_OVER : eMouseOver,
aContent, lastOverElement);
wrapper->mLastOverElement = aContent;
} else {
@ -4112,7 +4117,7 @@ EventStateManager::GenerateMouseEnterExit(WidgetMouseEvent* aMouseEvent)
nsCOMPtr<nsIContent> targetBeforeEvent = mCurrentTargetContent;
switch(aMouseEvent->mMessage) {
case NS_MOUSE_MOVE:
case eMouseMove:
{
// Mouse movement is reported on the MouseEvent.movement{X,Y} fields.
// Movement is calculated in UIEvent::GetMovementPoint() as:
@ -4196,7 +4201,7 @@ EventStateManager::GenerateMouseEnterExit(WidgetMouseEvent* aMouseEvent)
break;
case NS_POINTER_LEAVE:
case NS_POINTER_CANCEL:
case NS_MOUSE_EXIT_WIDGET:
case eMouseExitFromWidget:
{
// This is actually the window mouse exit or pointer leave event. We're not moving
// into any new element.
@ -4468,10 +4473,10 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
switch (aEvent->button) {
case WidgetMouseEvent::eLeftButton:
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == eMouseDown) {
mLastLeftMouseDownContent = mouseContent;
mLastLeftMouseDownContentParent = mouseContentParent;
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == eMouseUp) {
if (mLastLeftMouseDownContent == mouseContent ||
mLastLeftMouseDownContentParent == mouseContent ||
mLastLeftMouseDownContent == mouseContentParent) {
@ -4486,10 +4491,10 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
break;
case WidgetMouseEvent::eMiddleButton:
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == eMouseDown) {
mLastMiddleMouseDownContent = mouseContent;
mLastMiddleMouseDownContentParent = mouseContentParent;
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == eMouseUp) {
if (mLastMiddleMouseDownContent == mouseContent ||
mLastMiddleMouseDownContentParent == mouseContent ||
mLastMiddleMouseDownContent == mouseContentParent) {
@ -4504,10 +4509,10 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
break;
case WidgetMouseEvent::eRightButton:
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == eMouseDown) {
mLastRightMouseDownContent = mouseContent;
mLastRightMouseDownContentParent = mouseContentParent;
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == eMouseUp) {
if (mLastRightMouseDownContent == mouseContent ||
mLastRightMouseDownContentParent == mouseContent ||
mLastRightMouseDownContent == mouseContentParent) {
@ -4590,14 +4595,14 @@ EventStateManager::CheckForAndDispatchClick(nsPresContext* aPresContext,
// HandleEvent clears out mCurrentTarget which we might need again
nsWeakFrame currentTarget = mCurrentTarget;
ret = InitAndDispatchClickEvent(aEvent, aStatus, NS_MOUSE_CLICK,
ret = InitAndDispatchClickEvent(aEvent, aStatus, eMouseClick,
presShell, mouseContent, currentTarget,
notDispatchToContents);
if (NS_SUCCEEDED(ret) && aEvent->clickCount == 2 &&
mouseContent && mouseContent->IsInComposedDoc()) {
//fire double click
ret = InitAndDispatchClickEvent(aEvent, aStatus, NS_MOUSE_DOUBLECLICK,
// fire double click
ret = InitAndDispatchClickEvent(aEvent, aStatus, eMouseDoubleClick,
presShell, mouseContent, currentTarget,
notDispatchToContents);
}
@ -4998,7 +5003,7 @@ EventStateManager::ContentRemoved(nsIDocument* aDocument, nsIContent* aContent)
bool
EventStateManager::EventStatusOK(WidgetGUIEvent* aEvent)
{
return !(aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
return !(aEvent->mMessage == eMouseDown &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
!sNormalLMouseEventInProcess);
}
@ -5786,7 +5791,7 @@ AutoHandlingUserInputStatePusher::AutoHandlingUserInputStatePusher(
WidgetEvent* aEvent,
nsIDocument* aDocument) :
mIsHandlingUserInput(aIsHandlingUserInput),
mIsMouseDown(aEvent && aEvent->mMessage == NS_MOUSE_BUTTON_DOWN),
mIsMouseDown(aEvent && aEvent->mMessage == eMouseDown),
mResetFMMouseButtonHandlingState(false)
{
if (!aIsHandlingUserInput) {
@ -5801,8 +5806,7 @@ AutoHandlingUserInputStatePusher::AutoHandlingUserInputStatePusher(
return;
}
mResetFMMouseButtonHandlingState =
(aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
aEvent->mMessage == NS_MOUSE_BUTTON_UP);
(aEvent->mMessage == eMouseDown || aEvent->mMessage == eMouseUp);
if (mResetFMMouseButtonHandlingState) {
nsFocusManager* fm = nsFocusManager::GetFocusManager();
NS_ENSURE_TRUE_VOID(fm);

4
dom/events/EventStateManager.h

@ -965,7 +965,7 @@ private:
// has no frame. This is required for Web compatibility.
#define NS_EVENT_NEEDS_FRAME(event) \
(!(event)->HasPluginActivationEventMessage() && \
(event)->mMessage != NS_MOUSE_CLICK && \
(event)->mMessage != NS_MOUSE_DOUBLECLICK)
(event)->mMessage != eMouseClick && \
(event)->mMessage != eMouseDoubleClick)
#endif // mozilla_EventStateManager_h_

4
dom/events/IMEContentObserver.cpp

@ -462,8 +462,8 @@ IMEContentObserver::OnMouseButtonEvent(nsPresContext* aPresContext,
}
// Now, we need to notify only mouse down and mouse up event.
switch (aMouseEvent->mMessage) {
case NS_MOUSE_BUTTON_UP:
case NS_MOUSE_BUTTON_DOWN:
case eMouseUp:
case eMouseDown:
break;
default:
return false;

10
dom/events/WheelHandlingHelper.cpp

@ -184,7 +184,7 @@ WheelTransaction::OnEvent(WidgetEvent* aEvent)
EndTransaction();
}
return;
case NS_MOUSE_MOVE:
case eMouseMove:
case NS_DRAGDROP_OVER: {
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
if (mouseEvent->IsReal()) {
@ -210,10 +210,10 @@ WheelTransaction::OnEvent(WidgetEvent* aEvent)
case eKeyPress:
case eKeyUp:
case eKeyDown:
case NS_MOUSE_BUTTON_UP:
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_DOUBLECLICK:
case NS_MOUSE_CLICK:
case eMouseUp:
case eMouseDown:
case eMouseDoubleClick:
case eMouseClick:
case NS_CONTEXTMENU:
case NS_DRAGDROP_DROP:
EndTransaction();

10
dom/html/HTMLButtonElement.cpp

@ -304,7 +304,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
}
break;
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
{
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
if (mouseEvent->button == WidgetMouseEvent::eLeftButton) {
@ -332,8 +332,8 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
// cancel all of these events for buttons
//XXXsmaug What to do with these events? Why these should be cancelled?
case NS_MOUSE_BUTTON_UP:
case NS_MOUSE_DOUBLECLICK:
case eMouseUp:
case eMouseDoubleClick:
{
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
if (aVisitor.mDOMEvent &&
@ -344,7 +344,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
}
break;
case NS_MOUSE_OVER:
case eMouseOver:
{
aVisitor.mPresContext->EventStateManager()->
SetContentState(this, NS_EVENT_STATE_HOVER);
@ -353,7 +353,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
break;
// XXX this doesn't seem to do anything yet
case NS_MOUSE_OUT:
case eMouseOut:
{
aVisitor.mPresContext->EventStateManager()->
SetContentState(nullptr, NS_EVENT_STATE_HOVER);

36
dom/html/HTMLInputElement.cpp

@ -2798,8 +2798,7 @@ HTMLInputElement::MaybeSubmitForm(nsPresContext* aPresContext)
NS_ASSERTION(submitContent, "Form control not implementing nsIContent?!");
// Fire the button's onclick handler and let the button handle
// submitting the form.
WidgetMouseEvent event(true, NS_MOUSE_CLICK, nullptr,
WidgetMouseEvent::eReal);
WidgetMouseEvent event(true, eMouseClick, nullptr, WidgetMouseEvent::eReal);
nsEventStatus status = nsEventStatus_eIgnore;
shell->HandleDOMEventWithTarget(submitContent, &event, &status);
} else if (!mForm->ImplicitSubmissionIsDisabled() &&
@ -3019,11 +3018,11 @@ HTMLInputElement::NeedToInitializeEditorForEvent(
}
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_MOVE:
case NS_MOUSE_ENTER_WIDGET:
case NS_MOUSE_EXIT_WIDGET:
case NS_MOUSE_OVER:
case NS_MOUSE_OUT:
case eMouseMove:
case eMouseEnterIntoWidget:
case eMouseExitFromWidget:
case eMouseOver:
case eMouseOut:
case NS_SCROLLPORT_UNDERFLOW:
case NS_SCROLLPORT_OVERFLOW:
return false;
@ -3146,7 +3145,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
aVisitor.mItemFlags |= NS_NO_CONTENT_DISPATCH;
}
if (IsSingleLineTextControl(false) &&
aVisitor.mEvent->mMessage == NS_MOUSE_CLICK &&
aVisitor.mEvent->mMessage == eMouseClick &&
aVisitor.mEvent->AsMouseEvent()->button ==
WidgetMouseEvent::eMiddleButton) {
aVisitor.mEvent->mFlags.mNoContentDispatch = false;
@ -3189,7 +3188,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
// we want to end the spin. We do this here (rather than in
// PostHandleEvent) because we don't want to let content preventDefault()
// the end of the spin.
if (aVisitor.mEvent->mMessage == NS_MOUSE_MOVE) {
if (aVisitor.mEvent->mMessage == eMouseMove) {
// Be aggressive about stopping the spin:
bool stopSpin = true;
nsNumberControlFrame* numberControlFrame =
@ -3220,7 +3219,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
if (stopSpin) {
StopNumberControlSpinnerSpin();
}
} else if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP) {
} else if (aVisitor.mEvent->mMessage == eMouseUp) {
StopNumberControlSpinnerSpin();
}
}
@ -3914,10 +3913,9 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
} break; // eKeyPress || eKeyUp
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_BUTTON_UP:
case NS_MOUSE_DOUBLECLICK:
{
case eMouseDown:
case eMouseUp:
case eMouseDoubleClick: {
// cancel all of these events for buttons
//XXXsmaug Why?
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
@ -3943,7 +3941,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
nsNumberControlFrame* numberControlFrame =
do_QueryFrame(GetPrimaryFrame());
if (numberControlFrame) {
if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
if (aVisitor.mEvent->mMessage == eMouseDown &&
IsMutable()) {
switch (numberControlFrame->GetSpinButtonForPointerEvent(
aVisitor.mEvent->AsMouseEvent())) {
@ -4062,7 +4060,7 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
switch (aVisitor.mEvent->mMessage)
{
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
case NS_TOUCH_START: {
if (mIsDraggingRange) {
break;
@ -4077,7 +4075,7 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
inputEvent->IsOS()) {
break; // ignore
}
if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
if (aVisitor.mEvent->mMessage == eMouseDown) {
if (aVisitor.mEvent->AsMouseEvent()->buttons ==
WidgetMouseEvent::eLeftButtonFlag) {
StartRangeThumbDrag(inputEvent);
@ -4094,7 +4092,7 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true;
} break;
case NS_MOUSE_MOVE:
case eMouseMove:
case NS_TOUCH_MOVE:
if (!mIsDraggingRange) {
break;
@ -4109,7 +4107,7 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true;
break;
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
case NS_TOUCH_END:
if (!mIsDraggingRange) {
break;

10
dom/html/HTMLLabelElement.cpp

@ -104,7 +104,7 @@ HTMLLabelElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
if (mHandlingEvent ||
(!(mouseEvent && mouseEvent->IsLeftClickEvent()) &&
aVisitor.mEvent->mMessage != NS_MOUSE_BUTTON_DOWN) ||
aVisitor.mEvent->mMessage != eMouseDown) ||
aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault ||
!aVisitor.mPresContext ||
// Don't handle the event if it's already been handled by another label
@ -123,10 +123,10 @@ HTMLLabelElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
if (content) {
mHandlingEvent = true;
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
if (mouseEvent->button == WidgetMouseEvent::eLeftButton) {
// We reset the mouse-down point on every event because there is
// no guarantee we will reach the NS_MOUSE_CLICK code below.
// no guarantee we will reach the eMouseClick code below.
LayoutDeviceIntPoint* curPoint =
new LayoutDeviceIntPoint(mouseEvent->refPoint);
SetProperty(nsGkAtoms::labelMouseDownPtProperty,
@ -135,7 +135,7 @@ HTMLLabelElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
}
break;
case NS_MOUSE_CLICK:
case eMouseClick:
if (mouseEvent->IsLeftClickEvent()) {
LayoutDeviceIntPoint* mouseDownPoint =
static_cast<LayoutDeviceIntPoint*>(
@ -226,7 +226,7 @@ HTMLLabelElement::PerformAccesskey(bool aKeyCausesActivation,
return;
// Click on it if the users prefs indicate to do so.
WidgetMouseEvent event(aIsTrustedEvent, NS_MOUSE_CLICK,
WidgetMouseEvent event(aIsTrustedEvent, eMouseClick,
nullptr, WidgetMouseEvent::eReal);
event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_KEYBOARD;

4
dom/html/HTMLMenuItemElement.cpp

@ -254,7 +254,7 @@ HTMLMenuItemElement::SetChecked(bool aChecked)
nsresult
HTMLMenuItemElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
if (aVisitor.mEvent->mMessage == NS_MOUSE_CLICK) {
if (aVisitor.mEvent->mMessage == eMouseClick) {
bool originalCheckedValue = false;
switch (mType) {
@ -290,7 +290,7 @@ nsresult
HTMLMenuItemElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
{
// Check to see if the event was cancelled.
if (aVisitor.mEvent->mMessage == NS_MOUSE_CLICK &&
if (aVisitor.mEvent->mMessage == eMouseClick &&
aVisitor.mItemFlags & NS_CHECKED_IS_TOGGLED &&
aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault) {
bool originalCheckedValue =

2
dom/html/HTMLTextAreaElement.cpp

@ -497,7 +497,7 @@ HTMLTextAreaElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
if (aVisitor.mEvent->mFlags.mNoContentDispatch) {
aVisitor.mItemFlags |= NS_NO_CONTENT_DISPATCH;
}
if (aVisitor.mEvent->mMessage == NS_MOUSE_CLICK &&
if (aVisitor.mEvent->mMessage == eMouseClick &&
aVisitor.mEvent->AsMouseEvent()->button ==
WidgetMouseEvent::eMiddleButton) {
aVisitor.mEvent->mFlags.mNoContentDispatch = false;

10
dom/html/nsGenericHTMLElement.cpp

@ -2449,9 +2449,9 @@ nsGenericHTMLFormElement::IsElementDisabledForEvents(EventMessage aMessage,
nsIFrame* aFrame)
{
switch (aMessage) {
case NS_MOUSE_MOVE:
case NS_MOUSE_OVER:
case NS_MOUSE_OUT:
case eMouseMove:
case eMouseOver:
case eMouseOut:
case NS_MOUSEENTER:
case NS_MOUSELEAVE:
case NS_POINTER_MOVE:
@ -2690,7 +2690,7 @@ nsGenericHTMLElement::Click()
// called from chrome JS. Mark this event trusted if Click()
// is called from chrome code.
WidgetMouseEvent event(nsContentUtils::IsCallerChrome(),
NS_MOUSE_CLICK, nullptr, WidgetMouseEvent::eReal);
eMouseClick, nullptr, WidgetMouseEvent::eReal);
event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
EventDispatcher::Dispatch(static_cast<nsIContent*>(this), context, &event);
@ -2805,7 +2805,7 @@ nsGenericHTMLElement::DispatchSimulatedClick(nsGenericHTMLElement* aElement,
bool aIsTrusted,
nsPresContext* aPresContext)
{
WidgetMouseEvent event(aIsTrusted, NS_MOUSE_CLICK, nullptr,
WidgetMouseEvent event(aIsTrusted, eMouseClick, nullptr,
WidgetMouseEvent::eReal);
event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_KEYBOARD;
return EventDispatcher::Dispatch(ToSupports(aElement), aPresContext, &event);

6
dom/ipc/TabChild.cpp

@ -2071,11 +2071,11 @@ TabChild::UpdateTapState(const WidgetTouchEvent& aEvent, nsEventStatus aStatus)
case NS_TOUCH_END:
if (!TouchManager::gPreventMouseEvents) {
APZCCallbackHelper::DispatchSynthesizedMouseEvent(
NS_MOUSE_MOVE, time, currentPoint, 0, mPuppetWidget);
eMouseMove, time, currentPoint, 0, mPuppetWidget);
APZCCallbackHelper::DispatchSynthesizedMouseEvent(
NS_MOUSE_BUTTON_DOWN, time, currentPoint, 0, mPuppetWidget);
eMouseDown, time, currentPoint, 0, mPuppetWidget);
APZCCallbackHelper::DispatchSynthesizedMouseEvent(
NS_MOUSE_BUTTON_UP, time, currentPoint, 0, mPuppetWidget);
eMouseUp, time, currentPoint, 0, mPuppetWidget);
}
// fall through
case NS_TOUCH_CANCEL:

6
dom/ipc/TabParent.cpp

@ -1415,19 +1415,19 @@ bool TabParent::SendRealMouseEvent(WidgetMouseEvent& event)
if (widget) {
// When we mouseenter the tab, the tab's cursor should
// become the current cursor. When we mouseexit, we stop.
if (NS_MOUSE_ENTER_WIDGET == event.mMessage) {
if (eMouseEnterIntoWidget == event.mMessage) {
mTabSetsCursor = true;
if (mCustomCursor) {
widget->SetCursor(mCustomCursor, mCustomCursorHotspotX, mCustomCursorHotspotY);
} else if (mCursor != nsCursor(-1)) {
widget->SetCursor(mCursor);
}
} else if (NS_MOUSE_EXIT_WIDGET == event.mMessage) {