зеркало из https://github.com/mozilla/gecko-dev.git
Bug 895274 part.1 Rename WidgetEvent::message to WidgetEvent::mMessage r=smaug
This commit is contained in:
Родитель
69b300592b
Коммит
66f2c27305
|
@ -2850,9 +2850,9 @@ Element::CheckHandleEventForLinksPrecondition(EventChainVisitor& aVisitor,
|
||||||
{
|
{
|
||||||
if (aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault ||
|
if (aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault ||
|
||||||
(!aVisitor.mEvent->mFlags.mIsTrusted &&
|
(!aVisitor.mEvent->mFlags.mIsTrusted &&
|
||||||
(aVisitor.mEvent->message != NS_MOUSE_CLICK) &&
|
(aVisitor.mEvent->mMessage != NS_MOUSE_CLICK) &&
|
||||||
(aVisitor.mEvent->message != NS_KEY_PRESS) &&
|
(aVisitor.mEvent->mMessage != NS_KEY_PRESS) &&
|
||||||
(aVisitor.mEvent->message != NS_UI_ACTIVATE)) ||
|
(aVisitor.mEvent->mMessage != NS_UI_ACTIVATE)) ||
|
||||||
!aVisitor.mPresContext ||
|
!aVisitor.mPresContext ||
|
||||||
aVisitor.mEvent->mFlags.mMultipleActionsPrevented) {
|
aVisitor.mEvent->mFlags.mMultipleActionsPrevented) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -2867,7 +2867,7 @@ Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
// Optimisation: return early if this event doesn't interest us.
|
// Optimisation: return early if this event doesn't interest us.
|
||||||
// IMPORTANT: this switch and the switch below it must be kept in sync!
|
// IMPORTANT: this switch and the switch below it must be kept in sync!
|
||||||
switch (aVisitor.mEvent->message) {
|
switch (aVisitor.mEvent->mMessage) {
|
||||||
case NS_MOUSE_OVER:
|
case NS_MOUSE_OVER:
|
||||||
case NS_FOCUS_CONTENT:
|
case NS_FOCUS_CONTENT:
|
||||||
case NS_MOUSE_OUT:
|
case NS_MOUSE_OUT:
|
||||||
|
@ -2887,7 +2887,7 @@ Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor)
|
||||||
|
|
||||||
// We do the status bar updates in PreHandleEvent so that the status bar gets
|
// We do the status bar updates in PreHandleEvent so that the status bar gets
|
||||||
// updated even if the event is consumed before we have a chance to set it.
|
// updated even if the event is consumed before we have a chance to set it.
|
||||||
switch (aVisitor.mEvent->message) {
|
switch (aVisitor.mEvent->mMessage) {
|
||||||
// Set the status bar similarly for mouseover and focus
|
// Set the status bar similarly for mouseover and focus
|
||||||
case NS_MOUSE_OVER:
|
case NS_MOUSE_OVER:
|
||||||
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
|
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
|
||||||
|
@ -2928,7 +2928,7 @@ Element::PostHandleEventForLinks(EventChainPostVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
// Optimisation: return early if this event doesn't interest us.
|
// Optimisation: return early if this event doesn't interest us.
|
||||||
// IMPORTANT: this switch and the switch below it must be kept in sync!
|
// IMPORTANT: this switch and the switch below it must be kept in sync!
|
||||||
switch (aVisitor.mEvent->message) {
|
switch (aVisitor.mEvent->mMessage) {
|
||||||
case NS_MOUSE_BUTTON_DOWN:
|
case NS_MOUSE_BUTTON_DOWN:
|
||||||
case NS_MOUSE_CLICK:
|
case NS_MOUSE_CLICK:
|
||||||
case NS_UI_ACTIVATE:
|
case NS_UI_ACTIVATE:
|
||||||
|
@ -2946,7 +2946,7 @@ Element::PostHandleEventForLinks(EventChainPostVisitor& aVisitor)
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
switch (aVisitor.mEvent->message) {
|
switch (aVisitor.mEvent->mMessage) {
|
||||||
case NS_MOUSE_BUTTON_DOWN:
|
case NS_MOUSE_BUTTON_DOWN:
|
||||||
{
|
{
|
||||||
if (aVisitor.mEvent->AsMouseEvent()->button ==
|
if (aVisitor.mEvent->AsMouseEvent()->button ==
|
||||||
|
|
|
@ -677,10 +677,10 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
// Don't propagate mouseover and mouseout events when mouse is moving
|
// Don't propagate mouseover and mouseout events when mouse is moving
|
||||||
// inside chrome access only content.
|
// inside chrome access only content.
|
||||||
bool isAnonForEvents = IsRootOfChromeAccessOnlySubtree();
|
bool isAnonForEvents = IsRootOfChromeAccessOnlySubtree();
|
||||||
if ((aVisitor.mEvent->message == NS_MOUSE_OVER ||
|
if ((aVisitor.mEvent->mMessage == NS_MOUSE_OVER ||
|
||||||
aVisitor.mEvent->message == NS_MOUSE_OUT ||
|
aVisitor.mEvent->mMessage == NS_MOUSE_OUT ||
|
||||||
aVisitor.mEvent->message == NS_POINTER_OVER ||
|
aVisitor.mEvent->mMessage == NS_POINTER_OVER ||
|
||||||
aVisitor.mEvent->message == NS_POINTER_OUT) &&
|
aVisitor.mEvent->mMessage == NS_POINTER_OUT) &&
|
||||||
// Check if we should stop event propagation when event has just been
|
// Check if we should stop event propagation when event has just been
|
||||||
// dispatched or when we're about to propagate from
|
// dispatched or when we're about to propagate from
|
||||||
// chrome access only subtree or if we are about to propagate out of
|
// chrome access only subtree or if we are about to propagate out of
|
||||||
|
@ -739,7 +739,7 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
printf("Stopping %s propagation:"
|
printf("Stopping %s propagation:"
|
||||||
"\n\toriginalTarget=%s \n\tcurrentTarget=%s %s"
|
"\n\toriginalTarget=%s \n\tcurrentTarget=%s %s"
|
||||||
"\n\trelatedTarget=%s %s \n%s",
|
"\n\trelatedTarget=%s %s \n%s",
|
||||||
(aVisitor.mEvent->message == NS_MOUSE_OVER)
|
(aVisitor.mEvent->mMessage == NS_MOUSE_OVER)
|
||||||
? "mouseover" : "mouseout",
|
? "mouseover" : "mouseout",
|
||||||
NS_ConvertUTF16toUTF8(ot).get(),
|
NS_ConvertUTF16toUTF8(ot).get(),
|
||||||
NS_ConvertUTF16toUTF8(ct).get(),
|
NS_ConvertUTF16toUTF8(ct).get(),
|
||||||
|
@ -805,7 +805,7 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
// scroll
|
// scroll
|
||||||
// selectstart
|
// selectstart
|
||||||
bool stopEvent = false;
|
bool stopEvent = false;
|
||||||
switch (aVisitor.mEvent->message) {
|
switch (aVisitor.mEvent->mMessage) {
|
||||||
case NS_IMAGE_ABORT:
|
case NS_IMAGE_ABORT:
|
||||||
case NS_LOAD_ERROR:
|
case NS_LOAD_ERROR:
|
||||||
case NS_FORM_SELECTED:
|
case NS_FORM_SELECTED:
|
||||||
|
@ -841,7 +841,7 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
// The load event is special in that we don't ever propagate it
|
// The load event is special in that we don't ever propagate it
|
||||||
// to chrome.
|
// to chrome.
|
||||||
nsCOMPtr<nsPIDOMWindow> win = OwnerDoc()->GetWindow();
|
nsCOMPtr<nsPIDOMWindow> win = OwnerDoc()->GetWindow();
|
||||||
EventTarget* parentTarget = win && aVisitor.mEvent->message != NS_LOAD
|
EventTarget* parentTarget = win && aVisitor.mEvent->mMessage != NS_LOAD
|
||||||
? win->GetParentTarget() : nullptr;
|
? win->GetParentTarget() : nullptr;
|
||||||
|
|
||||||
aVisitor.mParentTarget = parentTarget;
|
aVisitor.mParentTarget = parentTarget;
|
||||||
|
|
|
@ -248,10 +248,10 @@ TextInputProcessor::IsValidEventTypeForComposition(
|
||||||
const WidgetKeyboardEvent& aKeyboardEvent) const
|
const WidgetKeyboardEvent& aKeyboardEvent) const
|
||||||
{
|
{
|
||||||
// The key event type of composition methods must be "" or "keydown".
|
// The key event type of composition methods must be "" or "keydown".
|
||||||
if (aKeyboardEvent.message == NS_KEY_DOWN) {
|
if (aKeyboardEvent.mMessage == NS_KEY_DOWN) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (aKeyboardEvent.message == NS_USER_DEFINED_EVENT &&
|
if (aKeyboardEvent.mMessage == NS_USER_DEFINED_EVENT &&
|
||||||
aKeyboardEvent.userType &&
|
aKeyboardEvent.userType &&
|
||||||
nsDependentAtomString(aKeyboardEvent.userType).EqualsLiteral("on")) {
|
nsDependentAtomString(aKeyboardEvent.userType).EqualsLiteral("on")) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -306,9 +306,9 @@ TextInputProcessor::MaybeDispatchKeyupForComposition(
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the message is NS_KEY_DOWN, the caller doesn't want TIP to dispatch
|
// If the mMessage is NS_KEY_DOWN, the caller doesn't want TIP to dispatch
|
||||||
// keyup event.
|
// keyup event.
|
||||||
if (aKeyboardEvent->message == NS_KEY_DOWN) {
|
if (aKeyboardEvent->mMessage == NS_KEY_DOWN) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5446,8 +5446,8 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent)
|
||||||
// For draggesture and dragstart events, the data transfer object is
|
// For draggesture and dragstart events, the data transfer object is
|
||||||
// created before the event fires, so it should already be set. For other
|
// created before the event fires, so it should already be set. For other
|
||||||
// drag events, get the object from the drag session.
|
// drag events, get the object from the drag session.
|
||||||
NS_ASSERTION(aDragEvent->message != NS_DRAGDROP_GESTURE &&
|
NS_ASSERTION(aDragEvent->mMessage != NS_DRAGDROP_GESTURE &&
|
||||||
aDragEvent->message != NS_DRAGDROP_START,
|
aDragEvent->mMessage != NS_DRAGDROP_START,
|
||||||
"draggesture event created without a dataTransfer");
|
"draggesture event created without a dataTransfer");
|
||||||
|
|
||||||
nsCOMPtr<nsIDragSession> dragSession = GetDragSession();
|
nsCOMPtr<nsIDragSession> dragSession = GetDragSession();
|
||||||
|
@ -5466,20 +5466,22 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent)
|
||||||
// means, for instance calling the drag service directly, or a drag
|
// means, for instance calling the drag service directly, or a drag
|
||||||
// from another application. In either case, a new dataTransfer should
|
// from another application. In either case, a new dataTransfer should
|
||||||
// be created that reflects the data.
|
// be created that reflects the data.
|
||||||
initialDataTransfer = new DataTransfer(aDragEvent->target, aDragEvent->message, true, -1);
|
initialDataTransfer =
|
||||||
|
new DataTransfer(aDragEvent->target, aDragEvent->mMessage, true, -1);
|
||||||
|
|
||||||
// now set it in the drag session so we don't need to create it again
|
// now set it in the drag session so we don't need to create it again
|
||||||
dragSession->SetDataTransfer(initialDataTransfer);
|
dragSession->SetDataTransfer(initialDataTransfer);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isCrossDomainSubFrameDrop = false;
|
bool isCrossDomainSubFrameDrop = false;
|
||||||
if (aDragEvent->message == NS_DRAGDROP_DROP ||
|
if (aDragEvent->mMessage == NS_DRAGDROP_DROP ||
|
||||||
aDragEvent->message == NS_DRAGDROP_DRAGDROP) {
|
aDragEvent->mMessage == NS_DRAGDROP_DRAGDROP) {
|
||||||
isCrossDomainSubFrameDrop = CheckForSubFrameDrop(dragSession, aDragEvent);
|
isCrossDomainSubFrameDrop = CheckForSubFrameDrop(dragSession, aDragEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// each event should use a clone of the original dataTransfer.
|
// each event should use a clone of the original dataTransfer.
|
||||||
initialDataTransfer->Clone(aDragEvent->target, aDragEvent->message, aDragEvent->userCancelled,
|
initialDataTransfer->Clone(aDragEvent->target, aDragEvent->mMessage,
|
||||||
|
aDragEvent->userCancelled,
|
||||||
isCrossDomainSubFrameDrop,
|
isCrossDomainSubFrameDrop,
|
||||||
getter_AddRefs(aDragEvent->dataTransfer));
|
getter_AddRefs(aDragEvent->dataTransfer));
|
||||||
NS_ENSURE_TRUE(aDragEvent->dataTransfer, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(aDragEvent->dataTransfer, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
@ -5487,16 +5489,16 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent)
|
||||||
// for the dragenter and dragover events, initialize the drop effect
|
// for the dragenter and dragover events, initialize the drop effect
|
||||||
// from the drop action, which platform specific widget code sets before
|
// from the drop action, which platform specific widget code sets before
|
||||||
// the event is fired based on the keyboard state.
|
// the event is fired based on the keyboard state.
|
||||||
if (aDragEvent->message == NS_DRAGDROP_ENTER ||
|
if (aDragEvent->mMessage == NS_DRAGDROP_ENTER ||
|
||||||
aDragEvent->message == NS_DRAGDROP_OVER) {
|
aDragEvent->mMessage == NS_DRAGDROP_OVER) {
|
||||||
uint32_t action, effectAllowed;
|
uint32_t action, effectAllowed;
|
||||||
dragSession->GetDragAction(&action);
|
dragSession->GetDragAction(&action);
|
||||||
aDragEvent->dataTransfer->GetEffectAllowedInt(&effectAllowed);
|
aDragEvent->dataTransfer->GetEffectAllowedInt(&effectAllowed);
|
||||||
aDragEvent->dataTransfer->SetDropEffectInt(FilterDropEffect(action, effectAllowed));
|
aDragEvent->dataTransfer->SetDropEffectInt(FilterDropEffect(action, effectAllowed));
|
||||||
}
|
}
|
||||||
else if (aDragEvent->message == NS_DRAGDROP_DROP ||
|
else if (aDragEvent->mMessage == NS_DRAGDROP_DROP ||
|
||||||
aDragEvent->message == NS_DRAGDROP_DRAGDROP ||
|
aDragEvent->mMessage == NS_DRAGDROP_DRAGDROP ||
|
||||||
aDragEvent->message == NS_DRAGDROP_END) {
|
aDragEvent->mMessage == NS_DRAGDROP_END) {
|
||||||
// For the drop and dragend events, set the drop effect based on the
|
// For the drop and dragend events, set the drop effect based on the
|
||||||
// last value that the dropEffect had. This will have been set in
|
// last value that the dropEffect had. This will have been set in
|
||||||
// EventStateManager::PostHandleEvent for the last dragenter or
|
// EventStateManager::PostHandleEvent for the last dragenter or
|
||||||
|
|
|
@ -8113,7 +8113,7 @@ nsDocument::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
aVisitor.mForceContentDispatch = true;
|
aVisitor.mForceContentDispatch = true;
|
||||||
|
|
||||||
// Load events must not propagate to |window| object, see bug 335251.
|
// Load events must not propagate to |window| object, see bug 335251.
|
||||||
if (aVisitor.mEvent->message != NS_LOAD) {
|
if (aVisitor.mEvent->mMessage != NS_LOAD) {
|
||||||
nsGlobalWindow* window = static_cast<nsGlobalWindow*>(GetWindow());
|
nsGlobalWindow* window = static_cast<nsGlobalWindow*>(GetWindow());
|
||||||
aVisitor.mParentTarget =
|
aVisitor.mParentTarget =
|
||||||
window ? window->GetTargetForEventTargetChain() : nullptr;
|
window ? window->GetTargetForEventTargetChain() : nullptr;
|
||||||
|
|
|
@ -49,8 +49,8 @@ public:
|
||||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) override
|
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) override
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(IsInNativeAnonymousSubtree());
|
MOZ_ASSERT(IsInNativeAnonymousSubtree());
|
||||||
if (aVisitor.mEvent->message == NS_LOAD ||
|
if (aVisitor.mEvent->mMessage == NS_LOAD ||
|
||||||
aVisitor.mEvent->message == NS_LOAD_ERROR) {
|
aVisitor.mEvent->mMessage == NS_LOAD_ERROR) {
|
||||||
// Don't propagate the events to the parent.
|
// Don't propagate the events to the parent.
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3044,7 +3044,7 @@ nsGlobalWindow::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(IsInnerWindow(), "PreHandleEvent is used on outer window!?");
|
NS_PRECONDITION(IsInnerWindow(), "PreHandleEvent is used on outer window!?");
|
||||||
static uint32_t count = 0;
|
static uint32_t count = 0;
|
||||||
uint32_t msg = aVisitor.mEvent->message;
|
uint32_t msg = aVisitor.mEvent->mMessage;
|
||||||
|
|
||||||
aVisitor.mCanHandle = true;
|
aVisitor.mCanHandle = true;
|
||||||
aVisitor.mForceContentDispatch = true; //FIXME! Bug 329119
|
aVisitor.mForceContentDispatch = true; //FIXME! Bug 329119
|
||||||
|
@ -3252,7 +3252,7 @@ nsGlobalWindow::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
NS_PRECONDITION(IsInnerWindow(), "PostHandleEvent is used on outer window!?");
|
NS_PRECONDITION(IsInnerWindow(), "PostHandleEvent is used on outer window!?");
|
||||||
|
|
||||||
// Return early if there is nothing to do.
|
// Return early if there is nothing to do.
|
||||||
switch (aVisitor.mEvent->message) {
|
switch (aVisitor.mEvent->mMessage) {
|
||||||
case NS_RESIZE_EVENT:
|
case NS_RESIZE_EVENT:
|
||||||
case NS_PAGE_UNLOAD:
|
case NS_PAGE_UNLOAD:
|
||||||
case NS_LOAD:
|
case NS_LOAD:
|
||||||
|
@ -3267,9 +3267,9 @@ nsGlobalWindow::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
nsCOMPtr<nsIDOMEventTarget> kungFuDeathGrip1(mChromeEventHandler);
|
nsCOMPtr<nsIDOMEventTarget> kungFuDeathGrip1(mChromeEventHandler);
|
||||||
nsCOMPtr<nsIScriptContext> kungFuDeathGrip2(GetContextInternal());
|
nsCOMPtr<nsIScriptContext> kungFuDeathGrip2(GetContextInternal());
|
||||||
|
|
||||||
if (aVisitor.mEvent->message == NS_RESIZE_EVENT) {
|
if (aVisitor.mEvent->mMessage == NS_RESIZE_EVENT) {
|
||||||
mIsHandlingResizeEvent = false;
|
mIsHandlingResizeEvent = false;
|
||||||
} else if (aVisitor.mEvent->message == NS_PAGE_UNLOAD &&
|
} else if (aVisitor.mEvent->mMessage == NS_PAGE_UNLOAD &&
|
||||||
aVisitor.mEvent->mFlags.mIsTrusted) {
|
aVisitor.mEvent->mFlags.mIsTrusted) {
|
||||||
// Execute bindingdetached handlers before we tear ourselves
|
// Execute bindingdetached handlers before we tear ourselves
|
||||||
// down.
|
// down.
|
||||||
|
@ -3277,7 +3277,7 @@ nsGlobalWindow::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
mDoc->BindingManager()->ExecuteDetachedHandlers();
|
mDoc->BindingManager()->ExecuteDetachedHandlers();
|
||||||
}
|
}
|
||||||
mIsDocumentLoaded = false;
|
mIsDocumentLoaded = false;
|
||||||
} else if (aVisitor.mEvent->message == NS_LOAD &&
|
} else if (aVisitor.mEvent->mMessage == NS_LOAD &&
|
||||||
aVisitor.mEvent->mFlags.mIsTrusted) {
|
aVisitor.mEvent->mFlags.mIsTrusted) {
|
||||||
// This is page load event since load events don't propagate to |window|.
|
// This is page load event since load events don't propagate to |window|.
|
||||||
// @see nsDocument::PreHandleEvent.
|
// @see nsDocument::PreHandleEvent.
|
||||||
|
|
|
@ -159,7 +159,7 @@ void
|
||||||
nsQueryContentEventResult::SetEventResult(nsIWidget* aWidget,
|
nsQueryContentEventResult::SetEventResult(nsIWidget* aWidget,
|
||||||
const WidgetQueryContentEvent &aEvent)
|
const WidgetQueryContentEvent &aEvent)
|
||||||
{
|
{
|
||||||
mEventID = aEvent.message;
|
mEventID = aEvent.mMessage;
|
||||||
mSucceeded = aEvent.mSucceeded;
|
mSucceeded = aEvent.mSucceeded;
|
||||||
mReversed = aEvent.mReply.mReversed;
|
mReversed = aEvent.mReply.mReversed;
|
||||||
mRect = aEvent.mReply.mRect;
|
mRect = aEvent.mReply.mRect;
|
||||||
|
|
|
@ -108,8 +108,8 @@ ClipboardEvent::GetClipboardData()
|
||||||
new DataTransfer(ToSupports(this), NS_COPY, false, -1);
|
new DataTransfer(ToSupports(this), NS_COPY, false, -1);
|
||||||
} else {
|
} else {
|
||||||
event->clipboardData =
|
event->clipboardData =
|
||||||
new DataTransfer(ToSupports(this), event->message,
|
new DataTransfer(ToSupports(this), event->mMessage,
|
||||||
event->message == NS_PASTE,
|
event->mMessage == NS_PASTE,
|
||||||
nsIClipboard::kGlobalClipboard);
|
nsIClipboard::kGlobalClipboard);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,7 +255,7 @@ protected:
|
||||||
nsCOMPtr<nsISupports> mParent;
|
nsCOMPtr<nsISupports> mParent;
|
||||||
|
|
||||||
// the event type this data transfer is for. This will correspond to an
|
// the event type this data transfer is for. This will correspond to an
|
||||||
// event->message value.
|
// event->mMessage value.
|
||||||
uint32_t mEventType;
|
uint32_t mEventType;
|
||||||
|
|
||||||
// the drop effect and effect allowed
|
// the drop effect and effect allowed
|
||||||
|
|
|
@ -265,12 +265,12 @@ Event::GetType(nsAString& aType)
|
||||||
aType = mEvent->typeString;
|
aType = mEvent->typeString;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
const char* name = GetEventName(mEvent->message);
|
const char* name = GetEventName(mEvent->mMessage);
|
||||||
|
|
||||||
if (name) {
|
if (name) {
|
||||||
CopyASCIItoUTF16(name, aType);
|
CopyASCIItoUTF16(name, aType);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
} else if (mEvent->message == NS_USER_DEFINED_EVENT && mEvent->userType) {
|
} else if (mEvent->mMessage == NS_USER_DEFINED_EVENT && mEvent->userType) {
|
||||||
aType = Substring(nsDependentAtomString(mEvent->userType), 2); // Remove "on"
|
aType = Substring(nsDependentAtomString(mEvent->userType), 2); // Remove "on"
|
||||||
mEvent->typeString = aType;
|
mEvent->typeString = aType;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -564,10 +564,10 @@ Event::SetEventType(const nsAString& aEventTypeArg)
|
||||||
mEvent->typeString.Truncate();
|
mEvent->typeString.Truncate();
|
||||||
mEvent->userType =
|
mEvent->userType =
|
||||||
nsContentUtils::GetEventIdAndAtom(aEventTypeArg, mEvent->mClass,
|
nsContentUtils::GetEventIdAndAtom(aEventTypeArg, mEvent->mClass,
|
||||||
&(mEvent->message));
|
&(mEvent->mMessage));
|
||||||
} else {
|
} else {
|
||||||
mEvent->userType = nullptr;
|
mEvent->userType = nullptr;
|
||||||
mEvent->message = NS_USER_DEFINED_EVENT;
|
mEvent->mMessage = NS_USER_DEFINED_EVENT;
|
||||||
mEvent->typeString = aEventTypeArg;
|
mEvent->typeString = aEventTypeArg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -715,7 +715,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
|
||||||
// triggered while handling user input. See
|
// triggered while handling user input. See
|
||||||
// nsPresShell::HandleEventInternal() for details.
|
// nsPresShell::HandleEventInternal() for details.
|
||||||
if (EventStateManager::IsHandlingUserInput()) {
|
if (EventStateManager::IsHandlingUserInput()) {
|
||||||
switch(aEvent->message) {
|
switch(aEvent->mMessage) {
|
||||||
case NS_FORM_SELECTED :
|
case NS_FORM_SELECTED :
|
||||||
if (PopupAllowedForEvent("select")) {
|
if (PopupAllowedForEvent("select")) {
|
||||||
abuse = openControlled;
|
abuse = openControlled;
|
||||||
|
@ -734,7 +734,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
|
||||||
// while handling user input. See
|
// while handling user input. See
|
||||||
// nsPresShell::HandleEventInternal() for details.
|
// nsPresShell::HandleEventInternal() for details.
|
||||||
if (EventStateManager::IsHandlingUserInput()) {
|
if (EventStateManager::IsHandlingUserInput()) {
|
||||||
switch(aEvent->message) {
|
switch(aEvent->mMessage) {
|
||||||
case NS_EDITOR_INPUT:
|
case NS_EDITOR_INPUT:
|
||||||
if (PopupAllowedForEvent("input")) {
|
if (PopupAllowedForEvent("input")) {
|
||||||
abuse = openControlled;
|
abuse = openControlled;
|
||||||
|
@ -748,7 +748,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
|
||||||
// while handling user input. See
|
// while handling user input. See
|
||||||
// nsPresShell::HandleEventInternal() for details.
|
// nsPresShell::HandleEventInternal() for details.
|
||||||
if (EventStateManager::IsHandlingUserInput()) {
|
if (EventStateManager::IsHandlingUserInput()) {
|
||||||
switch(aEvent->message) {
|
switch(aEvent->mMessage) {
|
||||||
case NS_FORM_CHANGE :
|
case NS_FORM_CHANGE :
|
||||||
if (PopupAllowedForEvent("change")) {
|
if (PopupAllowedForEvent("change")) {
|
||||||
abuse = openControlled;
|
abuse = openControlled;
|
||||||
|
@ -763,7 +763,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
|
||||||
case eKeyboardEventClass:
|
case eKeyboardEventClass:
|
||||||
if (aEvent->mFlags.mIsTrusted) {
|
if (aEvent->mFlags.mIsTrusted) {
|
||||||
uint32_t key = aEvent->AsKeyboardEvent()->keyCode;
|
uint32_t key = aEvent->AsKeyboardEvent()->keyCode;
|
||||||
switch(aEvent->message) {
|
switch(aEvent->mMessage) {
|
||||||
case NS_KEY_PRESS :
|
case NS_KEY_PRESS :
|
||||||
// return key on focused button. see note at NS_MOUSE_CLICK.
|
// return key on focused button. see note at NS_MOUSE_CLICK.
|
||||||
if (key == nsIDOMKeyEvent::DOM_VK_RETURN) {
|
if (key == nsIDOMKeyEvent::DOM_VK_RETURN) {
|
||||||
|
@ -790,7 +790,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
|
||||||
break;
|
break;
|
||||||
case eTouchEventClass:
|
case eTouchEventClass:
|
||||||
if (aEvent->mFlags.mIsTrusted) {
|
if (aEvent->mFlags.mIsTrusted) {
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_TOUCH_START :
|
case NS_TOUCH_START :
|
||||||
if (PopupAllowedForEvent("touchstart")) {
|
if (PopupAllowedForEvent("touchstart")) {
|
||||||
abuse = openControlled;
|
abuse = openControlled;
|
||||||
|
@ -807,7 +807,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
|
||||||
case eMouseEventClass:
|
case eMouseEventClass:
|
||||||
if (aEvent->mFlags.mIsTrusted &&
|
if (aEvent->mFlags.mIsTrusted &&
|
||||||
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
|
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
|
||||||
switch(aEvent->message) {
|
switch(aEvent->mMessage) {
|
||||||
case NS_MOUSE_BUTTON_UP :
|
case NS_MOUSE_BUTTON_UP :
|
||||||
if (PopupAllowedForEvent("mouseup")) {
|
if (PopupAllowedForEvent("mouseup")) {
|
||||||
abuse = openControlled;
|
abuse = openControlled;
|
||||||
|
@ -840,7 +840,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
|
||||||
// triggered while handling user input. See
|
// triggered while handling user input. See
|
||||||
// nsPresShell::HandleEventInternal() for details.
|
// nsPresShell::HandleEventInternal() for details.
|
||||||
if (EventStateManager::IsHandlingUserInput()) {
|
if (EventStateManager::IsHandlingUserInput()) {
|
||||||
switch(aEvent->message) {
|
switch(aEvent->mMessage) {
|
||||||
case NS_FORM_SUBMIT :
|
case NS_FORM_SUBMIT :
|
||||||
if (PopupAllowedForEvent("submit")) {
|
if (PopupAllowedForEvent("submit")) {
|
||||||
abuse = openControlled;
|
abuse = openControlled;
|
||||||
|
|
|
@ -270,7 +270,7 @@ protected:
|
||||||
bool mPrivateDataDuplicated;
|
bool mPrivateDataDuplicated;
|
||||||
bool mIsMainThreadEvent;
|
bool mIsMainThreadEvent;
|
||||||
// True when popup control check should rely on event.type, not
|
// True when popup control check should rely on event.type, not
|
||||||
// WidgetEvent.message.
|
// WidgetEvent.mMessage.
|
||||||
bool mWantsPopupControlCheck;
|
bool mWantsPopupControlCheck;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -420,12 +420,12 @@ EventDispatcher::Dispatch(nsISupports* aTarget,
|
||||||
NS_ASSERTION(aEvent, "Trying to dispatch without WidgetEvent!");
|
NS_ASSERTION(aEvent, "Trying to dispatch without WidgetEvent!");
|
||||||
NS_ENSURE_TRUE(!aEvent->mFlags.mIsBeingDispatched,
|
NS_ENSURE_TRUE(!aEvent->mFlags.mIsBeingDispatched,
|
||||||
NS_ERROR_DOM_INVALID_STATE_ERR);
|
NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||||
NS_ASSERTION(!aTargets || !aEvent->message, "Wrong parameters!");
|
NS_ASSERTION(!aTargets || !aEvent->mMessage, "Wrong parameters!");
|
||||||
|
|
||||||
// If we're dispatching an already created DOMEvent object, make
|
// If we're dispatching an already created DOMEvent object, make
|
||||||
// sure it is initialized!
|
// sure it is initialized!
|
||||||
// If aTargets is non-null, the event isn't going to be dispatched.
|
// If aTargets is non-null, the event isn't going to be dispatched.
|
||||||
NS_ENSURE_TRUE(aEvent->message || !aDOMEvent || aTargets,
|
NS_ENSURE_TRUE(aEvent->mMessage || !aDOMEvent || aTargets,
|
||||||
NS_ERROR_DOM_INVALID_STATE_ERR);
|
NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||||
|
|
||||||
#ifdef MOZ_TASK_TRACER
|
#ifdef MOZ_TASK_TRACER
|
||||||
|
@ -493,7 +493,8 @@ EventDispatcher::Dispatch(nsISupports* aTarget,
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (aEvent->message != NS_EVENT_NULL && !nsContentUtils::IsSafeToRunScript()) {
|
if (aEvent->mMessage != NS_EVENT_NULL &&
|
||||||
|
!nsContentUtils::IsSafeToRunScript()) {
|
||||||
nsresult rv = NS_ERROR_FAILURE;
|
nsresult rv = NS_ERROR_FAILURE;
|
||||||
if (target->GetContextForEventHandlers(&rv) ||
|
if (target->GetContextForEventHandlers(&rv) ||
|
||||||
NS_FAILED(rv)) {
|
NS_FAILED(rv)) {
|
||||||
|
|
|
@ -246,7 +246,7 @@ public:
|
||||||
* Neither aTarget nor aEvent is allowed to be nullptr.
|
* Neither aTarget nor aEvent is allowed to be nullptr.
|
||||||
*
|
*
|
||||||
* If aTargets is non-null, event target chain will be created, but
|
* If aTargets is non-null, event target chain will be created, but
|
||||||
* event won't be handled. In this case aEvent->message should be
|
* event won't be handled. In this case aEvent->mMessage should be
|
||||||
* NS_EVENT_NULL.
|
* NS_EVENT_NULL.
|
||||||
* @note Use this method when dispatching a WidgetEvent.
|
* @note Use this method when dispatching a WidgetEvent.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -558,20 +558,20 @@ EventListenerManager::ListenerCanHandle(Listener* aListener,
|
||||||
WidgetEvent* aEvent)
|
WidgetEvent* aEvent)
|
||||||
{
|
{
|
||||||
// This is slightly different from EVENT_TYPE_EQUALS in that it returns
|
// This is slightly different from EVENT_TYPE_EQUALS in that it returns
|
||||||
// true even when aEvent->message == NS_USER_DEFINED_EVENT and
|
// true even when aEvent->mMessage == NS_USER_DEFINED_EVENT and
|
||||||
// aListener=>mEventType != NS_USER_DEFINED_EVENT as long as the atoms are
|
// aListener=>mEventType != NS_USER_DEFINED_EVENT as long as the atoms are
|
||||||
// the same
|
// the same
|
||||||
if (aListener->mAllEvents) {
|
if (aListener->mAllEvents) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (aEvent->message == NS_USER_DEFINED_EVENT) {
|
if (aEvent->mMessage == NS_USER_DEFINED_EVENT) {
|
||||||
if (mIsMainThreadELM) {
|
if (mIsMainThreadELM) {
|
||||||
return aListener->mTypeAtom == aEvent->userType;
|
return aListener->mTypeAtom == aEvent->userType;
|
||||||
}
|
}
|
||||||
return aListener->mTypeString.Equals(aEvent->typeString);
|
return aListener->mTypeString.Equals(aEvent->typeString);
|
||||||
}
|
}
|
||||||
MOZ_ASSERT(mIsMainThreadELM);
|
MOZ_ASSERT(mIsMainThreadELM);
|
||||||
return aListener->mEventType == aEvent->message;
|
return aListener->mEventType == aEvent->mMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1163,7 +1163,7 @@ EventListenerManager::HandleEventInternal(nsPresContext* aPresContext,
|
||||||
aEvent->currentTarget = nullptr;
|
aEvent->currentTarget = nullptr;
|
||||||
|
|
||||||
if (mIsMainThreadELM && !hasListener) {
|
if (mIsMainThreadELM && !hasListener) {
|
||||||
mNoListenerForEvent = aEvent->message;
|
mNoListenerForEvent = aEvent->mMessage;
|
||||||
mNoListenerForEventAtom = aEvent->userType;
|
mNoListenerForEventAtom = aEvent->userType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -321,7 +321,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if we already know that there is no event listener for the event.
|
// Check if we already know that there is no event listener for the event.
|
||||||
if (mNoListenerForEvent == aEvent->message &&
|
if (mNoListenerForEvent == aEvent->mMessage &&
|
||||||
(mNoListenerForEvent != NS_USER_DEFINED_EVENT ||
|
(mNoListenerForEvent != NS_USER_DEFINED_EVENT ||
|
||||||
mNoListenerForEventAtom == aEvent->userType)) {
|
mNoListenerForEventAtom == aEvent->userType)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -499,8 +499,8 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
||||||
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
|
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
|
||||||
if (aEvent->mFlags.mIsTrusted &&
|
if (aEvent->mFlags.mIsTrusted &&
|
||||||
((mouseEvent && mouseEvent->IsReal() &&
|
((mouseEvent && mouseEvent->IsReal() &&
|
||||||
mouseEvent->message != NS_MOUSE_ENTER_WIDGET &&
|
mouseEvent->mMessage != NS_MOUSE_ENTER_WIDGET &&
|
||||||
mouseEvent->message != NS_MOUSE_EXIT_WIDGET) ||
|
mouseEvent->mMessage != NS_MOUSE_EXIT_WIDGET) ||
|
||||||
aEvent->mClass == eWheelEventClass ||
|
aEvent->mClass == eWheelEventClass ||
|
||||||
aEvent->mClass == eKeyboardEventClass)) {
|
aEvent->mClass == eKeyboardEventClass)) {
|
||||||
if (gMouseOrKeyboardEventCounter == 0) {
|
if (gMouseOrKeyboardEventCounter == 0) {
|
||||||
|
@ -542,7 +542,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
||||||
|
|
||||||
*aStatus = nsEventStatus_eIgnore;
|
*aStatus = nsEventStatus_eIgnore;
|
||||||
|
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_CONTEXTMENU:
|
case NS_CONTEXTMENU:
|
||||||
if (sIsPointerLocked) {
|
if (sIsPointerLocked) {
|
||||||
return NS_ERROR_DOM_INVALID_STATE_ERR;
|
return NS_ERROR_DOM_INVALID_STATE_ERR;
|
||||||
|
@ -615,7 +615,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
||||||
// Treat it as a synthetic move so we don't generate spurious
|
// Treat it as a synthetic move so we don't generate spurious
|
||||||
// "exit" or "move" events. Any necessary "out" or "over" events
|
// "exit" or "move" events. Any necessary "out" or "over" events
|
||||||
// will be generated by GenerateMouseEnterExit
|
// will be generated by GenerateMouseEnterExit
|
||||||
mouseEvent->message = NS_MOUSE_MOVE;
|
mouseEvent->mMessage = NS_MOUSE_MOVE;
|
||||||
mouseEvent->reason = WidgetMouseEvent::eSynthesized;
|
mouseEvent->reason = WidgetMouseEvent::eSynthesized;
|
||||||
// then fall through...
|
// then fall through...
|
||||||
} else {
|
} else {
|
||||||
|
@ -625,7 +625,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
GenerateMouseEnterExit(mouseEvent);
|
GenerateMouseEnterExit(mouseEvent);
|
||||||
//This is a window level mouse exit event and should stop here
|
//This is a window level mouse exit event and should stop here
|
||||||
aEvent->message = 0;
|
aEvent->mMessage = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NS_MOUSE_MOVE:
|
case NS_MOUSE_MOVE:
|
||||||
|
@ -717,7 +717,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
||||||
mCurrentTargetContent = content;
|
mCurrentTargetContent = content;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aEvent->message != NS_WHEEL_WHEEL) {
|
if (aEvent->mMessage != NS_WHEEL_WHEEL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1167,7 +1167,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
|
||||||
case eWheelEventClass:
|
case eWheelEventClass:
|
||||||
return true;
|
return true;
|
||||||
case eMouseEventClass:
|
case eMouseEventClass:
|
||||||
switch (aEvent.message) {
|
switch (aEvent.mMessage) {
|
||||||
case NS_MOUSE_BUTTON_DOWN:
|
case NS_MOUSE_BUTTON_DOWN:
|
||||||
case NS_MOUSE_BUTTON_UP:
|
case NS_MOUSE_BUTTON_UP:
|
||||||
case NS_MOUSE_MOVE:
|
case NS_MOUSE_MOVE:
|
||||||
|
@ -1179,7 +1179,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
case eTouchEventClass:
|
case eTouchEventClass:
|
||||||
switch (aEvent.message) {
|
switch (aEvent.mMessage) {
|
||||||
case NS_TOUCH_START:
|
case NS_TOUCH_START:
|
||||||
case NS_TOUCH_MOVE:
|
case NS_TOUCH_MOVE:
|
||||||
case NS_TOUCH_END:
|
case NS_TOUCH_END:
|
||||||
|
@ -1189,7 +1189,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
case eDragEventClass:
|
case eDragEventClass:
|
||||||
switch (aEvent.message) {
|
switch (aEvent.mMessage) {
|
||||||
case NS_DRAGDROP_OVER:
|
case NS_DRAGDROP_OVER:
|
||||||
case NS_DRAGDROP_EXIT:
|
case NS_DRAGDROP_EXIT:
|
||||||
case NS_DRAGDROP_DROP:
|
case NS_DRAGDROP_DROP:
|
||||||
|
@ -1215,7 +1215,7 @@ EventStateManager::HandleCrossProcessEvent(WidgetEvent* aEvent,
|
||||||
// NB: the elements of |targets| must be unique, for correctness.
|
// NB: the elements of |targets| must be unique, for correctness.
|
||||||
nsAutoTArray<nsCOMPtr<nsIContent>, 1> targets;
|
nsAutoTArray<nsCOMPtr<nsIContent>, 1> targets;
|
||||||
if (aEvent->mClass != eTouchEventClass ||
|
if (aEvent->mClass != eTouchEventClass ||
|
||||||
aEvent->message == NS_TOUCH_START) {
|
aEvent->mMessage == NS_TOUCH_START) {
|
||||||
// If this event only has one target, and it's remote, add it to
|
// If this event only has one target, and it's remote, add it to
|
||||||
// the array.
|
// the array.
|
||||||
nsIFrame* frame = GetEventTarget();
|
nsIFrame* frame = GetEventTarget();
|
||||||
|
@ -2588,7 +2588,7 @@ EventStateManager::DecideGestureEvent(WidgetGestureNotifyEvent* aEvent,
|
||||||
nsIFrame* targetFrame)
|
nsIFrame* targetFrame)
|
||||||
{
|
{
|
||||||
|
|
||||||
NS_ASSERTION(aEvent->message == NS_GESTURENOTIFY_EVENT_START,
|
NS_ASSERTION(aEvent->mMessage == NS_GESTURENOTIFY_EVENT_START,
|
||||||
"DecideGestureEvent called with a non-gesture event");
|
"DecideGestureEvent called with a non-gesture event");
|
||||||
|
|
||||||
/* Check the ancestor tree to decide if any frame is willing* to receive
|
/* Check the ancestor tree to decide if any frame is willing* to receive
|
||||||
|
@ -2791,8 +2791,8 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
||||||
|
|
||||||
// Most of the events we handle below require a frame.
|
// Most of the events we handle below require a frame.
|
||||||
// Add special cases here.
|
// Add special cases here.
|
||||||
if (!mCurrentTarget && aEvent->message != NS_MOUSE_BUTTON_UP &&
|
if (!mCurrentTarget && aEvent->mMessage != NS_MOUSE_BUTTON_UP &&
|
||||||
aEvent->message != NS_MOUSE_BUTTON_DOWN) {
|
aEvent->mMessage != NS_MOUSE_BUTTON_DOWN) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2800,7 +2800,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
||||||
nsRefPtr<nsPresContext> presContext = aPresContext;
|
nsRefPtr<nsPresContext> presContext = aPresContext;
|
||||||
nsresult ret = NS_OK;
|
nsresult ret = NS_OK;
|
||||||
|
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_MOUSE_BUTTON_DOWN:
|
case NS_MOUSE_BUTTON_DOWN:
|
||||||
{
|
{
|
||||||
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
|
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
|
||||||
|
@ -3073,7 +3073,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
||||||
|
|
||||||
ScrollbarsForWheel::PrepareToScrollText(this, aTargetFrame, wheelEvent);
|
ScrollbarsForWheel::PrepareToScrollText(this, aTargetFrame, wheelEvent);
|
||||||
|
|
||||||
if (aEvent->message != NS_WHEEL_WHEEL ||
|
if (aEvent->mMessage != NS_WHEEL_WHEEL ||
|
||||||
(!wheelEvent->deltaX && !wheelEvent->deltaY)) {
|
(!wheelEvent->deltaX && !wheelEvent->deltaY)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3237,13 +3237,13 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
||||||
|
|
||||||
// For now, do this only for dragover.
|
// For now, do this only for dragover.
|
||||||
//XXXsmaug dragenter needs some more work.
|
//XXXsmaug dragenter needs some more work.
|
||||||
if (aEvent->message == NS_DRAGDROP_OVER && !isChromeDoc) {
|
if (aEvent->mMessage == NS_DRAGDROP_OVER && !isChromeDoc) {
|
||||||
// Someone has called preventDefault(), check whether is was on
|
// Someone has called preventDefault(), check whether is was on
|
||||||
// content or chrome.
|
// content or chrome.
|
||||||
dragSession->SetOnlyChromeDrop(
|
dragSession->SetOnlyChromeDrop(
|
||||||
!dragEvent->mDefaultPreventedOnContent);
|
!dragEvent->mDefaultPreventedOnContent);
|
||||||
}
|
}
|
||||||
} else if (aEvent->message == NS_DRAGDROP_OVER && !isChromeDoc) {
|
} else if (aEvent->mMessage == NS_DRAGDROP_OVER && !isChromeDoc) {
|
||||||
// No one called preventDefault(), so handle drop only in chrome.
|
// No one called preventDefault(), so handle drop only in chrome.
|
||||||
dragSession->SetOnlyChromeDrop(true);
|
dragSession->SetOnlyChromeDrop(true);
|
||||||
}
|
}
|
||||||
|
@ -4058,7 +4058,7 @@ void
|
||||||
EventStateManager::GeneratePointerEnterExit(uint32_t aMessage, WidgetMouseEvent* aEvent)
|
EventStateManager::GeneratePointerEnterExit(uint32_t aMessage, WidgetMouseEvent* aEvent)
|
||||||
{
|
{
|
||||||
WidgetPointerEvent pointerEvent(*aEvent);
|
WidgetPointerEvent pointerEvent(*aEvent);
|
||||||
pointerEvent.message = aMessage;
|
pointerEvent.mMessage = aMessage;
|
||||||
GenerateMouseEnterExit(&pointerEvent);
|
GenerateMouseEnterExit(&pointerEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4072,7 +4072,7 @@ EventStateManager::GenerateMouseEnterExit(WidgetMouseEvent* aMouseEvent)
|
||||||
// Hold onto old target content through the event and reset after.
|
// Hold onto old target content through the event and reset after.
|
||||||
nsCOMPtr<nsIContent> targetBeforeEvent = mCurrentTargetContent;
|
nsCOMPtr<nsIContent> targetBeforeEvent = mCurrentTargetContent;
|
||||||
|
|
||||||
switch(aMouseEvent->message) {
|
switch(aMouseEvent->mMessage) {
|
||||||
case NS_MOUSE_MOVE:
|
case NS_MOUSE_MOVE:
|
||||||
{
|
{
|
||||||
// Mouse movement is reported on the MouseEvent.movement{X,Y} fields.
|
// Mouse movement is reported on the MouseEvent.movement{X,Y} fields.
|
||||||
|
@ -4268,7 +4268,7 @@ EventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext,
|
||||||
//Hold onto old target content through the event and reset after.
|
//Hold onto old target content through the event and reset after.
|
||||||
nsCOMPtr<nsIContent> targetBeforeEvent = mCurrentTargetContent;
|
nsCOMPtr<nsIContent> targetBeforeEvent = mCurrentTargetContent;
|
||||||
|
|
||||||
switch(aDragEvent->message) {
|
switch(aDragEvent->mMessage) {
|
||||||
case NS_DRAGDROP_OVER:
|
case NS_DRAGDROP_OVER:
|
||||||
{
|
{
|
||||||
// when dragging from one frame to another, events are fired in the
|
// when dragging from one frame to another, events are fired in the
|
||||||
|
@ -4420,10 +4420,10 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
|
||||||
|
|
||||||
switch (aEvent->button) {
|
switch (aEvent->button) {
|
||||||
case WidgetMouseEvent::eLeftButton:
|
case WidgetMouseEvent::eLeftButton:
|
||||||
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
|
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
|
||||||
mLastLeftMouseDownContent = mouseContent;
|
mLastLeftMouseDownContent = mouseContent;
|
||||||
mLastLeftMouseDownContentParent = mouseContentParent;
|
mLastLeftMouseDownContentParent = mouseContentParent;
|
||||||
} else if (aEvent->message == NS_MOUSE_BUTTON_UP) {
|
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
|
||||||
if (mLastLeftMouseDownContent == mouseContent ||
|
if (mLastLeftMouseDownContent == mouseContent ||
|
||||||
mLastLeftMouseDownContentParent == mouseContent ||
|
mLastLeftMouseDownContentParent == mouseContent ||
|
||||||
mLastLeftMouseDownContent == mouseContentParent) {
|
mLastLeftMouseDownContent == mouseContentParent) {
|
||||||
|
@ -4438,10 +4438,10 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WidgetMouseEvent::eMiddleButton:
|
case WidgetMouseEvent::eMiddleButton:
|
||||||
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
|
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
|
||||||
mLastMiddleMouseDownContent = mouseContent;
|
mLastMiddleMouseDownContent = mouseContent;
|
||||||
mLastMiddleMouseDownContentParent = mouseContentParent;
|
mLastMiddleMouseDownContentParent = mouseContentParent;
|
||||||
} else if (aEvent->message == NS_MOUSE_BUTTON_UP) {
|
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
|
||||||
if (mLastMiddleMouseDownContent == mouseContent ||
|
if (mLastMiddleMouseDownContent == mouseContent ||
|
||||||
mLastMiddleMouseDownContentParent == mouseContent ||
|
mLastMiddleMouseDownContentParent == mouseContent ||
|
||||||
mLastMiddleMouseDownContent == mouseContentParent) {
|
mLastMiddleMouseDownContent == mouseContentParent) {
|
||||||
|
@ -4456,10 +4456,10 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WidgetMouseEvent::eRightButton:
|
case WidgetMouseEvent::eRightButton:
|
||||||
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
|
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
|
||||||
mLastRightMouseDownContent = mouseContent;
|
mLastRightMouseDownContent = mouseContent;
|
||||||
mLastRightMouseDownContentParent = mouseContentParent;
|
mLastRightMouseDownContentParent = mouseContentParent;
|
||||||
} else if (aEvent->message == NS_MOUSE_BUTTON_UP) {
|
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
|
||||||
if (mLastRightMouseDownContent == mouseContent ||
|
if (mLastRightMouseDownContent == mouseContent ||
|
||||||
mLastRightMouseDownContentParent == mouseContent ||
|
mLastRightMouseDownContentParent == mouseContent ||
|
||||||
mLastRightMouseDownContent == mouseContentParent) {
|
mLastRightMouseDownContent == mouseContentParent) {
|
||||||
|
@ -4573,8 +4573,8 @@ already_AddRefed<nsIContent>
|
||||||
EventStateManager::GetEventTargetContent(WidgetEvent* aEvent)
|
EventStateManager::GetEventTargetContent(WidgetEvent* aEvent)
|
||||||
{
|
{
|
||||||
if (aEvent &&
|
if (aEvent &&
|
||||||
(aEvent->message == NS_FOCUS_CONTENT ||
|
(aEvent->mMessage == NS_FOCUS_CONTENT ||
|
||||||
aEvent->message == NS_BLUR_CONTENT)) {
|
aEvent->mMessage == NS_BLUR_CONTENT)) {
|
||||||
nsCOMPtr<nsIContent> content = GetFocusedContent();
|
nsCOMPtr<nsIContent> content = GetFocusedContent();
|
||||||
return content.forget();
|
return content.forget();
|
||||||
}
|
}
|
||||||
|
@ -4942,7 +4942,7 @@ EventStateManager::ContentRemoved(nsIDocument* aDocument, nsIContent* aContent)
|
||||||
bool
|
bool
|
||||||
EventStateManager::EventStatusOK(WidgetGUIEvent* aEvent)
|
EventStateManager::EventStatusOK(WidgetGUIEvent* aEvent)
|
||||||
{
|
{
|
||||||
return !(aEvent->message == NS_MOUSE_BUTTON_DOWN &&
|
return !(aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
|
||||||
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
|
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
|
||||||
!sNormalLMouseEventInProcess);
|
!sNormalLMouseEventInProcess);
|
||||||
}
|
}
|
||||||
|
@ -5038,7 +5038,7 @@ EventStateManager::DoContentCommandEvent(WidgetContentCommandEvent* aEvent)
|
||||||
nsCOMPtr<nsPIWindowRoot> root = window->GetTopWindowRoot();
|
nsCOMPtr<nsPIWindowRoot> root = window->GetTopWindowRoot();
|
||||||
NS_ENSURE_TRUE(root, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(root, NS_ERROR_FAILURE);
|
||||||
const char* cmd;
|
const char* cmd;
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_CONTENT_COMMAND_CUT:
|
case NS_CONTENT_COMMAND_CUT:
|
||||||
cmd = "cmd_cut";
|
cmd = "cmd_cut";
|
||||||
break;
|
break;
|
||||||
|
@ -5076,7 +5076,7 @@ EventStateManager::DoContentCommandEvent(WidgetContentCommandEvent* aEvent)
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
aEvent->mIsEnabled = canDoIt;
|
aEvent->mIsEnabled = canDoIt;
|
||||||
if (canDoIt && !aEvent->mOnlyEnabledCheck) {
|
if (canDoIt && !aEvent->mOnlyEnabledCheck) {
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_CONTENT_COMMAND_PASTE_TRANSFERABLE: {
|
case NS_CONTENT_COMMAND_PASTE_TRANSFERABLE: {
|
||||||
nsCOMPtr<nsICommandController> commandController = do_QueryInterface(controller);
|
nsCOMPtr<nsICommandController> commandController = do_QueryInterface(controller);
|
||||||
NS_ENSURE_STATE(commandController);
|
NS_ENSURE_STATE(commandController);
|
||||||
|
@ -5730,7 +5730,7 @@ AutoHandlingUserInputStatePusher::AutoHandlingUserInputStatePusher(
|
||||||
WidgetEvent* aEvent,
|
WidgetEvent* aEvent,
|
||||||
nsIDocument* aDocument) :
|
nsIDocument* aDocument) :
|
||||||
mIsHandlingUserInput(aIsHandlingUserInput),
|
mIsHandlingUserInput(aIsHandlingUserInput),
|
||||||
mIsMouseDown(aEvent && aEvent->message == NS_MOUSE_BUTTON_DOWN),
|
mIsMouseDown(aEvent && aEvent->mMessage == NS_MOUSE_BUTTON_DOWN),
|
||||||
mResetFMMouseButtonHandlingState(false)
|
mResetFMMouseButtonHandlingState(false)
|
||||||
{
|
{
|
||||||
if (!aIsHandlingUserInput) {
|
if (!aIsHandlingUserInput) {
|
||||||
|
@ -5744,8 +5744,9 @@ AutoHandlingUserInputStatePusher::AutoHandlingUserInputStatePusher(
|
||||||
if (!aDocument || !aEvent || !aEvent->mFlags.mIsTrusted) {
|
if (!aDocument || !aEvent || !aEvent->mFlags.mIsTrusted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mResetFMMouseButtonHandlingState = (aEvent->message == NS_MOUSE_BUTTON_DOWN ||
|
mResetFMMouseButtonHandlingState =
|
||||||
aEvent->message == NS_MOUSE_BUTTON_UP);
|
(aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
|
||||||
|
aEvent->mMessage == NS_MOUSE_BUTTON_UP);
|
||||||
if (mResetFMMouseButtonHandlingState) {
|
if (mResetFMMouseButtonHandlingState) {
|
||||||
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
NS_ENSURE_TRUE_VOID(fm);
|
NS_ENSURE_TRUE_VOID(fm);
|
||||||
|
|
|
@ -957,7 +957,7 @@ private:
|
||||||
// has no frame. This is required for Web compatibility.
|
// has no frame. This is required for Web compatibility.
|
||||||
#define NS_EVENT_NEEDS_FRAME(event) \
|
#define NS_EVENT_NEEDS_FRAME(event) \
|
||||||
(!(event)->HasPluginActivationEventMessage() && \
|
(!(event)->HasPluginActivationEventMessage() && \
|
||||||
(event)->message != NS_MOUSE_CLICK && \
|
(event)->mMessage != NS_MOUSE_CLICK && \
|
||||||
(event)->message != NS_MOUSE_DOUBLECLICK)
|
(event)->mMessage != NS_MOUSE_DOUBLECLICK)
|
||||||
|
|
||||||
#endif // mozilla_EventStateManager_h_
|
#endif // mozilla_EventStateManager_h_
|
||||||
|
|
|
@ -456,7 +456,7 @@ IMEContentObserver::OnMouseButtonEvent(nsPresContext* aPresContext,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Now, we need to notify only mouse down and mouse up event.
|
// Now, we need to notify only mouse down and mouse up event.
|
||||||
switch (aMouseEvent->message) {
|
switch (aMouseEvent->mMessage) {
|
||||||
case NS_MOUSE_BUTTON_UP:
|
case NS_MOUSE_BUTTON_UP:
|
||||||
case NS_MOUSE_BUTTON_DOWN:
|
case NS_MOUSE_BUTTON_DOWN:
|
||||||
break;
|
break;
|
||||||
|
@ -501,7 +501,7 @@ IMEContentObserver::OnMouseButtonEvent(nsPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
IMENotification notification(NOTIFY_IME_OF_MOUSE_BUTTON_EVENT);
|
IMENotification notification(NOTIFY_IME_OF_MOUSE_BUTTON_EVENT);
|
||||||
notification.mMouseButtonEventData.mEventMessage = aMouseEvent->message;
|
notification.mMouseButtonEventData.mEventMessage = aMouseEvent->mMessage;
|
||||||
notification.mMouseButtonEventData.mOffset = charAtPt.mReply.mOffset;
|
notification.mMouseButtonEventData.mOffset = charAtPt.mReply.mOffset;
|
||||||
notification.mMouseButtonEventData.mCursorPos.Set(
|
notification.mMouseButtonEventData.mCursorPos.Set(
|
||||||
LayoutDeviceIntPoint::ToUntyped(charAtPt.refPoint));
|
LayoutDeviceIntPoint::ToUntyped(charAtPt.refPoint));
|
||||||
|
|
|
@ -1137,7 +1137,7 @@ IMEStateManager::DispatchCompositionEvent(
|
||||||
"mFlags={ mIsTrusted=%s, mPropagationStopped=%s } }, "
|
"mFlags={ mIsTrusted=%s, mPropagationStopped=%s } }, "
|
||||||
"aIsSynthesized=%s), tabParent=%p",
|
"aIsSynthesized=%s), tabParent=%p",
|
||||||
aEventTargetNode, aPresContext,
|
aEventTargetNode, aPresContext,
|
||||||
GetEventMessageName(aCompositionEvent->message),
|
GetEventMessageName(aCompositionEvent->mMessage),
|
||||||
GetBoolName(aCompositionEvent->mFlags.mIsTrusted),
|
GetBoolName(aCompositionEvent->mFlags.mIsTrusted),
|
||||||
GetBoolName(aCompositionEvent->mFlags.mPropagationStopped),
|
GetBoolName(aCompositionEvent->mFlags.mPropagationStopped),
|
||||||
GetBoolName(aIsSynthesized), tabParent.get()));
|
GetBoolName(aIsSynthesized), tabParent.get()));
|
||||||
|
@ -1147,7 +1147,7 @@ IMEStateManager::DispatchCompositionEvent(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(aCompositionEvent->message != NS_COMPOSITION_UPDATE,
|
MOZ_ASSERT(aCompositionEvent->mMessage != NS_COMPOSITION_UPDATE,
|
||||||
"compositionupdate event shouldn't be dispatched manually");
|
"compositionupdate event shouldn't be dispatched manually");
|
||||||
|
|
||||||
EnsureTextCompositionArray();
|
EnsureTextCompositionArray();
|
||||||
|
@ -1163,7 +1163,7 @@ IMEStateManager::DispatchCompositionEvent(
|
||||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||||
("ISM: IMEStateManager::DispatchCompositionEvent(), "
|
("ISM: IMEStateManager::DispatchCompositionEvent(), "
|
||||||
"adding new TextComposition to the array"));
|
"adding new TextComposition to the array"));
|
||||||
MOZ_ASSERT(aCompositionEvent->message == NS_COMPOSITION_START);
|
MOZ_ASSERT(aCompositionEvent->mMessage == NS_COMPOSITION_START);
|
||||||
composition =
|
composition =
|
||||||
new TextComposition(aPresContext, aEventTargetNode, tabParent,
|
new TextComposition(aPresContext, aEventTargetNode, tabParent,
|
||||||
aCompositionEvent);
|
aCompositionEvent);
|
||||||
|
@ -1171,7 +1171,7 @@ IMEStateManager::DispatchCompositionEvent(
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
else {
|
else {
|
||||||
MOZ_ASSERT(aCompositionEvent->message != NS_COMPOSITION_START);
|
MOZ_ASSERT(aCompositionEvent->mMessage != NS_COMPOSITION_START);
|
||||||
}
|
}
|
||||||
#endif // #ifdef DEBUG
|
#endif // #ifdef DEBUG
|
||||||
|
|
||||||
|
@ -1232,10 +1232,10 @@ IMEStateManager::HandleSelectionEvent(nsPresContext* aPresContext,
|
||||||
|
|
||||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||||
("ISM: IMEStateManager::HandleSelectionEvent(aPresContext=0x%p, "
|
("ISM: IMEStateManager::HandleSelectionEvent(aPresContext=0x%p, "
|
||||||
"aEventTargetContent=0x%p, aSelectionEvent={ message=%s, "
|
"aEventTargetContent=0x%p, aSelectionEvent={ mMessage=%s, "
|
||||||
"mFlags={ mIsTrusted=%s } }), tabParent=%p",
|
"mFlags={ mIsTrusted=%s } }), tabParent=%p",
|
||||||
aPresContext, aEventTargetContent,
|
aPresContext, aEventTargetContent,
|
||||||
GetEventMessageName(aSelectionEvent->message),
|
GetEventMessageName(aSelectionEvent->mMessage),
|
||||||
GetBoolName(aSelectionEvent->mFlags.mIsTrusted),
|
GetBoolName(aSelectionEvent->mFlags.mIsTrusted),
|
||||||
tabParent.get()));
|
tabParent.get()));
|
||||||
|
|
||||||
|
@ -1267,8 +1267,8 @@ IMEStateManager::OnCompositionEventDiscarded(
|
||||||
|
|
||||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||||
("ISM: IMEStateManager::OnCompositionEventDiscarded(aCompositionEvent={ "
|
("ISM: IMEStateManager::OnCompositionEventDiscarded(aCompositionEvent={ "
|
||||||
"message=%s, mFlags={ mIsTrusted=%s } })",
|
"mMessage=%s, mFlags={ mIsTrusted=%s } })",
|
||||||
GetEventMessageName(aCompositionEvent->message),
|
GetEventMessageName(aCompositionEvent->mMessage),
|
||||||
GetBoolName(aCompositionEvent->mFlags.mIsTrusted)));
|
GetBoolName(aCompositionEvent->mFlags.mIsTrusted)));
|
||||||
|
|
||||||
if (!aCompositionEvent->mFlags.mIsTrusted) {
|
if (!aCompositionEvent->mFlags.mIsTrusted) {
|
||||||
|
@ -1277,7 +1277,7 @@ IMEStateManager::OnCompositionEventDiscarded(
|
||||||
|
|
||||||
// Ignore compositionstart for now because sTextCompositions may not have
|
// Ignore compositionstart for now because sTextCompositions may not have
|
||||||
// been created yet.
|
// been created yet.
|
||||||
if (aCompositionEvent->message == NS_COMPOSITION_START) {
|
if (aCompositionEvent->mMessage == NS_COMPOSITION_START) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ public:
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mClass == eMutationEventClass,
|
MOZ_ASSERT(mClass == eMutationEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
InternalMutationEvent* result = new InternalMutationEvent(false, message);
|
InternalMutationEvent* result = new InternalMutationEvent(false, mMessage);
|
||||||
result->AssignMutationEventData(*this, true);
|
result->AssignMutationEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -151,7 +151,7 @@ KeyboardEvent::CharCode()
|
||||||
return mEvent->AsKeyboardEvent()->charCode;
|
return mEvent->AsKeyboardEvent()->charCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (mEvent->message) {
|
switch (mEvent->mMessage) {
|
||||||
case NS_KEY_BEFORE_DOWN:
|
case NS_KEY_BEFORE_DOWN:
|
||||||
case NS_KEY_DOWN:
|
case NS_KEY_DOWN:
|
||||||
case NS_KEY_AFTER_DOWN:
|
case NS_KEY_AFTER_DOWN:
|
||||||
|
@ -195,7 +195,7 @@ KeyboardEvent::Which()
|
||||||
return mInitializedWhichValue;
|
return mInitializedWhichValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (mEvent->message) {
|
switch (mEvent->mMessage) {
|
||||||
case NS_KEY_BEFORE_DOWN:
|
case NS_KEY_BEFORE_DOWN:
|
||||||
case NS_KEY_DOWN:
|
case NS_KEY_DOWN:
|
||||||
case NS_KEY_AFTER_DOWN:
|
case NS_KEY_AFTER_DOWN:
|
||||||
|
|
|
@ -23,7 +23,7 @@ NotifyPaintEvent::NotifyPaintEvent(EventTarget* aOwner,
|
||||||
: Event(aOwner, aPresContext, aEvent)
|
: Event(aOwner, aPresContext, aEvent)
|
||||||
{
|
{
|
||||||
if (mEvent) {
|
if (mEvent) {
|
||||||
mEvent->message = aEventType;
|
mEvent->mMessage = aEventType;
|
||||||
}
|
}
|
||||||
if (aInvalidateRequests) {
|
if (aInvalidateRequests) {
|
||||||
mInvalidateRequests.AppendElements(Move(aInvalidateRequests->mRequests));
|
mInvalidateRequests.AppendElements(Move(aInvalidateRequests->mRequests));
|
||||||
|
|
|
@ -233,7 +233,7 @@ TextComposition::DispatchCompositionEvent(
|
||||||
RemoveControlCharactersFrom(aCompositionEvent->mData,
|
RemoveControlCharactersFrom(aCompositionEvent->mData,
|
||||||
aCompositionEvent->mRanges);
|
aCompositionEvent->mRanges);
|
||||||
}
|
}
|
||||||
if (aCompositionEvent->message == NS_COMPOSITION_COMMIT_AS_IS) {
|
if (aCompositionEvent->mMessage == NS_COMPOSITION_COMMIT_AS_IS) {
|
||||||
NS_ASSERTION(!aCompositionEvent->mRanges,
|
NS_ASSERTION(!aCompositionEvent->mRanges,
|
||||||
"mRanges of NS_COMPOSITION_COMMIT_AS_IS should be null");
|
"mRanges of NS_COMPOSITION_COMMIT_AS_IS should be null");
|
||||||
aCompositionEvent->mRanges = nullptr;
|
aCompositionEvent->mRanges = nullptr;
|
||||||
|
@ -247,7 +247,7 @@ TextComposition::DispatchCompositionEvent(
|
||||||
} else {
|
} else {
|
||||||
aCompositionEvent->mData = mLastData;
|
aCompositionEvent->mData = mLastData;
|
||||||
}
|
}
|
||||||
} else if (aCompositionEvent->message == NS_COMPOSITION_COMMIT) {
|
} else if (aCompositionEvent->mMessage == NS_COMPOSITION_COMMIT) {
|
||||||
NS_ASSERTION(!aCompositionEvent->mRanges,
|
NS_ASSERTION(!aCompositionEvent->mRanges,
|
||||||
"mRanges of NS_COMPOSITION_COMMIT should be null");
|
"mRanges of NS_COMPOSITION_COMMIT should be null");
|
||||||
aCompositionEvent->mRanges = nullptr;
|
aCompositionEvent->mRanges = nullptr;
|
||||||
|
@ -282,7 +282,7 @@ TextComposition::DispatchCompositionEvent(
|
||||||
// 2. non-empty string is committed at requesting cancel.
|
// 2. non-empty string is committed at requesting cancel.
|
||||||
if (!aIsSynthesized && (mIsRequestingCommit || mIsRequestingCancel)) {
|
if (!aIsSynthesized && (mIsRequestingCommit || mIsRequestingCancel)) {
|
||||||
nsString* committingData = nullptr;
|
nsString* committingData = nullptr;
|
||||||
switch (aCompositionEvent->message) {
|
switch (aCompositionEvent->mMessage) {
|
||||||
case NS_COMPOSITION_END:
|
case NS_COMPOSITION_END:
|
||||||
case NS_COMPOSITION_CHANGE:
|
case NS_COMPOSITION_CHANGE:
|
||||||
case NS_COMPOSITION_COMMIT_AS_IS:
|
case NS_COMPOSITION_COMMIT_AS_IS:
|
||||||
|
@ -312,7 +312,7 @@ TextComposition::DispatchCompositionEvent(
|
||||||
// composition string empty or didn't have clause information), we don't
|
// composition string empty or didn't have clause information), we don't
|
||||||
// need to dispatch redundant DOM text event.
|
// need to dispatch redundant DOM text event.
|
||||||
if (dispatchDOMTextEvent &&
|
if (dispatchDOMTextEvent &&
|
||||||
aCompositionEvent->message != NS_COMPOSITION_CHANGE &&
|
aCompositionEvent->mMessage != NS_COMPOSITION_CHANGE &&
|
||||||
!mIsComposing && mLastData == aCompositionEvent->mData) {
|
!mIsComposing && mLastData == aCompositionEvent->mData) {
|
||||||
dispatchEvent = dispatchDOMTextEvent = false;
|
dispatchEvent = dispatchDOMTextEvent = false;
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ TextComposition::DispatchCompositionEvent(
|
||||||
// which modifies neither composition string, clauses nor caret
|
// which modifies neither composition string, clauses nor caret
|
||||||
// position. In such case, we shouldn't dispatch DOM events.
|
// position. In such case, we shouldn't dispatch DOM events.
|
||||||
if (dispatchDOMTextEvent &&
|
if (dispatchDOMTextEvent &&
|
||||||
aCompositionEvent->message == NS_COMPOSITION_CHANGE &&
|
aCompositionEvent->mMessage == NS_COMPOSITION_CHANGE &&
|
||||||
mLastData == aCompositionEvent->mData &&
|
mLastData == aCompositionEvent->mData &&
|
||||||
mRanges && aCompositionEvent->mRanges &&
|
mRanges && aCompositionEvent->mRanges &&
|
||||||
mRanges->Equals(*aCompositionEvent->mRanges)) {
|
mRanges->Equals(*aCompositionEvent->mRanges)) {
|
||||||
|
@ -340,7 +340,7 @@ TextComposition::DispatchCompositionEvent(
|
||||||
// the limitation of mapping between event messages and DOM event types,
|
// the limitation of mapping between event messages and DOM event types,
|
||||||
// we cannot map multiple event messages to a DOM event type.
|
// we cannot map multiple event messages to a DOM event type.
|
||||||
if (dispatchDOMTextEvent &&
|
if (dispatchDOMTextEvent &&
|
||||||
aCompositionEvent->message != NS_COMPOSITION_CHANGE) {
|
aCompositionEvent->mMessage != NS_COMPOSITION_CHANGE) {
|
||||||
aCompositionEvent->mFlags =
|
aCompositionEvent->mFlags =
|
||||||
CloneAndDispatchAs(aCompositionEvent, NS_COMPOSITION_CHANGE,
|
CloneAndDispatchAs(aCompositionEvent, NS_COMPOSITION_CHANGE,
|
||||||
aStatus, aCallBack);
|
aStatus, aCallBack);
|
||||||
|
@ -365,7 +365,7 @@ TextComposition::DispatchCompositionEvent(
|
||||||
|
|
||||||
if (aCompositionEvent->CausesDOMCompositionEndEvent()) {
|
if (aCompositionEvent->CausesDOMCompositionEndEvent()) {
|
||||||
// Dispatch a compositionend event if it's necessary.
|
// Dispatch a compositionend event if it's necessary.
|
||||||
if (aCompositionEvent->message != NS_COMPOSITION_END) {
|
if (aCompositionEvent->mMessage != NS_COMPOSITION_END) {
|
||||||
CloneAndDispatchAs(aCompositionEvent, NS_COMPOSITION_END);
|
CloneAndDispatchAs(aCompositionEvent, NS_COMPOSITION_END);
|
||||||
}
|
}
|
||||||
MOZ_ASSERT(!mIsComposing, "Why is the editor still composing?");
|
MOZ_ASSERT(!mIsComposing, "Why is the editor still composing?");
|
||||||
|
@ -411,7 +411,7 @@ TextComposition::NotityUpdateComposition(
|
||||||
// When compositon start, notify the rect of first offset character.
|
// When compositon start, notify the rect of first offset character.
|
||||||
// When not compositon start, notify the rect of selected composition
|
// When not compositon start, notify the rect of selected composition
|
||||||
// string if compositionchange event.
|
// string if compositionchange event.
|
||||||
if (aCompositionEvent->message == NS_COMPOSITION_START) {
|
if (aCompositionEvent->mMessage == NS_COMPOSITION_START) {
|
||||||
nsCOMPtr<nsIWidget> widget = mPresContext->GetRootWidget();
|
nsCOMPtr<nsIWidget> widget = mPresContext->GetRootWidget();
|
||||||
// Update composition start offset
|
// Update composition start offset
|
||||||
WidgetQueryContentEvent selectedTextEvent(true,
|
WidgetQueryContentEvent selectedTextEvent(true,
|
||||||
|
|
|
@ -121,7 +121,8 @@ TouchEvent::Touches()
|
||||||
{
|
{
|
||||||
if (!mTouches) {
|
if (!mTouches) {
|
||||||
WidgetTouchEvent* touchEvent = mEvent->AsTouchEvent();
|
WidgetTouchEvent* touchEvent = mEvent->AsTouchEvent();
|
||||||
if (mEvent->message == NS_TOUCH_END || mEvent->message == NS_TOUCH_CANCEL) {
|
if (mEvent->mMessage == NS_TOUCH_END ||
|
||||||
|
mEvent->mMessage == NS_TOUCH_CANCEL) {
|
||||||
// for touchend events, remove any changed touches from the touches array
|
// for touchend events, remove any changed touches from the touches array
|
||||||
WidgetTouchEvent::AutoTouchArray unchangedTouches;
|
WidgetTouchEvent::AutoTouchArray unchangedTouches;
|
||||||
const WidgetTouchEvent::TouchArray& touches = touchEvent->touches;
|
const WidgetTouchEvent::TouchArray& touches = touchEvent->touches;
|
||||||
|
@ -148,8 +149,8 @@ TouchEvent::TargetTouches()
|
||||||
for (uint32_t i = 0; i < touches.Length(); ++i) {
|
for (uint32_t i = 0; i < touches.Length(); ++i) {
|
||||||
// for touchend/cancel events, don't append to the target list if this is a
|
// for touchend/cancel events, don't append to the target list if this is a
|
||||||
// touch that is ending
|
// touch that is ending
|
||||||
if ((mEvent->message != NS_TOUCH_END &&
|
if ((mEvent->mMessage != NS_TOUCH_END &&
|
||||||
mEvent->message != NS_TOUCH_CANCEL) || !touches[i]->mChanged) {
|
mEvent->mMessage != NS_TOUCH_CANCEL) || !touches[i]->mChanged) {
|
||||||
if (touches[i]->mTarget == mEvent->originalTarget) {
|
if (touches[i]->mTarget == mEvent->originalTarget) {
|
||||||
targetTouches.AppendElement(touches[i]);
|
targetTouches.AppendElement(touches[i]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,7 @@ WheelTransaction::BeginTransaction(nsIFrame* aTargetFrame,
|
||||||
WidgetWheelEvent* aEvent)
|
WidgetWheelEvent* aEvent)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(!sTargetFrame, "previous transaction is not finished!");
|
NS_ASSERTION(!sTargetFrame, "previous transaction is not finished!");
|
||||||
MOZ_ASSERT(aEvent->message == NS_WHEEL_WHEEL,
|
MOZ_ASSERT(aEvent->mMessage == NS_WHEEL_WHEEL,
|
||||||
"Transaction must be started with a wheel event");
|
"Transaction must be started with a wheel event");
|
||||||
ScrollbarsForWheel::OwnWheelTransaction(false);
|
ScrollbarsForWheel::OwnWheelTransaction(false);
|
||||||
sTargetFrame = aTargetFrame;
|
sTargetFrame = aTargetFrame;
|
||||||
|
@ -175,7 +175,7 @@ WheelTransaction::OnEvent(WidgetEvent* aEvent)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_WHEEL_WHEEL:
|
case NS_WHEEL_WHEEL:
|
||||||
if (sMouseMoved != 0 &&
|
if (sMouseMoved != 0 &&
|
||||||
OutOfTime(sMouseMoved, GetIgnoreMoveDelayTime())) {
|
OutOfTime(sMouseMoved, GetIgnoreMoveDelayTime())) {
|
||||||
|
@ -413,7 +413,7 @@ ScrollbarsForWheel::PrepareToScrollText(EventStateManager* aESM,
|
||||||
nsIFrame* aTargetFrame,
|
nsIFrame* aTargetFrame,
|
||||||
WidgetWheelEvent* aEvent)
|
WidgetWheelEvent* aEvent)
|
||||||
{
|
{
|
||||||
if (aEvent->message == NS_WHEEL_START) {
|
if (aEvent->mMessage == NS_WHEEL_START) {
|
||||||
WheelTransaction::OwnScrollbars(false);
|
WheelTransaction::OwnScrollbars(false);
|
||||||
if (!IsActive()) {
|
if (!IsActive()) {
|
||||||
TemporarilyActivateAllPossibleScrollTargets(aESM, aTargetFrame, aEvent);
|
TemporarilyActivateAllPossibleScrollTargets(aESM, aTargetFrame, aEvent);
|
||||||
|
|
|
@ -211,7 +211,7 @@ nsresult
|
||||||
HTMLButtonElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
HTMLButtonElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
aVisitor.mCanHandle = false;
|
aVisitor.mCanHandle = false;
|
||||||
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
|
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ HTMLButtonElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
|
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
|
||||||
bool outerActivateEvent =
|
bool outerActivateEvent =
|
||||||
((mouseEvent && mouseEvent->IsLeftClickEvent()) ||
|
((mouseEvent && mouseEvent->IsLeftClickEvent()) ||
|
||||||
(aVisitor.mEvent->message == NS_UI_ACTIVATE &&
|
(aVisitor.mEvent->mMessage == NS_UI_ACTIVATE &&
|
||||||
!mInInternalActivate));
|
!mInInternalActivate));
|
||||||
|
|
||||||
if (outerActivateEvent) {
|
if (outerActivateEvent) {
|
||||||
|
@ -282,7 +282,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nsEventStatus_eIgnore == aVisitor.mEventStatus) {
|
if (nsEventStatus_eIgnore == aVisitor.mEventStatus) {
|
||||||
switch (aVisitor.mEvent->message) {
|
switch (aVisitor.mEvent->mMessage) {
|
||||||
case NS_KEY_PRESS:
|
case NS_KEY_PRESS:
|
||||||
case NS_KEY_UP:
|
case NS_KEY_UP:
|
||||||
{
|
{
|
||||||
|
@ -290,9 +290,9 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
// (bug 25300)
|
// (bug 25300)
|
||||||
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
|
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
|
||||||
if ((keyEvent->keyCode == NS_VK_RETURN &&
|
if ((keyEvent->keyCode == NS_VK_RETURN &&
|
||||||
NS_KEY_PRESS == aVisitor.mEvent->message) ||
|
NS_KEY_PRESS == aVisitor.mEvent->mMessage) ||
|
||||||
(keyEvent->keyCode == NS_VK_SPACE &&
|
(keyEvent->keyCode == NS_VK_SPACE &&
|
||||||
NS_KEY_UP == aVisitor.mEvent->message)) {
|
NS_KEY_UP == aVisitor.mEvent->mMessage)) {
|
||||||
nsEventStatus status = nsEventStatus_eIgnore;
|
nsEventStatus status = nsEventStatus_eIgnore;
|
||||||
|
|
||||||
WidgetMouseEvent event(aVisitor.mEvent->mFlags.mIsTrusted,
|
WidgetMouseEvent event(aVisitor.mEvent->mFlags.mIsTrusted,
|
||||||
|
@ -383,7 +383,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
//
|
//
|
||||||
// Using presShell to dispatch the event. It makes sure that
|
// Using presShell to dispatch the event. It makes sure that
|
||||||
// event is not handled if the window is being destroyed.
|
// event is not handled if the window is being destroyed.
|
||||||
if (presShell && (event.message != NS_FORM_SUBMIT ||
|
if (presShell && (event.mMessage != NS_FORM_SUBMIT ||
|
||||||
mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate) ||
|
mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate) ||
|
||||||
// We know the element is a submit control, if this check is moved,
|
// We know the element is a submit control, if this check is moved,
|
||||||
// make sure formnovalidate is used only if it's a submit control.
|
// make sure formnovalidate is used only if it's a submit control.
|
||||||
|
|
|
@ -74,7 +74,7 @@ HTMLFieldSetElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
// Do not process any DOM events if the element is disabled.
|
// Do not process any DOM events if the element is disabled.
|
||||||
aVisitor.mCanHandle = false;
|
aVisitor.mCanHandle = false;
|
||||||
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
|
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -492,7 +492,7 @@ HTMLFormElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
aVisitor.mWantsWillHandleEvent = true;
|
aVisitor.mWantsWillHandleEvent = true;
|
||||||
if (aVisitor.mEvent->originalTarget == static_cast<nsIContent*>(this)) {
|
if (aVisitor.mEvent->originalTarget == static_cast<nsIContent*>(this)) {
|
||||||
uint32_t msg = aVisitor.mEvent->message;
|
uint32_t msg = aVisitor.mEvent->mMessage;
|
||||||
if (msg == NS_FORM_SUBMIT) {
|
if (msg == NS_FORM_SUBMIT) {
|
||||||
if (mGeneratingSubmit) {
|
if (mGeneratingSubmit) {
|
||||||
aVisitor.mCanHandle = false;
|
aVisitor.mCanHandle = false;
|
||||||
|
@ -522,8 +522,8 @@ HTMLFormElement::WillHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
// If this is the bubble stage and there is a nested form below us which
|
// If this is the bubble stage and there is a nested form below us which
|
||||||
// received a submit event we do *not* want to handle the submit event
|
// received a submit event we do *not* want to handle the submit event
|
||||||
// for this form too.
|
// for this form too.
|
||||||
if ((aVisitor.mEvent->message == NS_FORM_SUBMIT ||
|
if ((aVisitor.mEvent->mMessage == NS_FORM_SUBMIT ||
|
||||||
aVisitor.mEvent->message == NS_FORM_RESET) &&
|
aVisitor.mEvent->mMessage == NS_FORM_RESET) &&
|
||||||
aVisitor.mEvent->mFlags.mInBubblingPhase &&
|
aVisitor.mEvent->mFlags.mInBubblingPhase &&
|
||||||
aVisitor.mEvent->originalTarget != static_cast<nsIContent*>(this)) {
|
aVisitor.mEvent->originalTarget != static_cast<nsIContent*>(this)) {
|
||||||
aVisitor.mEvent->mFlags.mPropagationStopped = true;
|
aVisitor.mEvent->mFlags.mPropagationStopped = true;
|
||||||
|
@ -535,7 +535,7 @@ nsresult
|
||||||
HTMLFormElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
HTMLFormElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
if (aVisitor.mEvent->originalTarget == static_cast<nsIContent*>(this)) {
|
if (aVisitor.mEvent->originalTarget == static_cast<nsIContent*>(this)) {
|
||||||
uint32_t msg = aVisitor.mEvent->message;
|
uint32_t msg = aVisitor.mEvent->mMessage;
|
||||||
if (msg == NS_FORM_SUBMIT) {
|
if (msg == NS_FORM_SUBMIT) {
|
||||||
// let the form know not to defer subsequent submissions
|
// let the form know not to defer subsequent submissions
|
||||||
mDeferSubmission = false;
|
mDeferSubmission = false;
|
||||||
|
|
|
@ -3025,7 +3025,7 @@ HTMLInputElement::NeedToInitializeEditorForEvent(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (aVisitor.mEvent->message) {
|
switch (aVisitor.mEvent->mMessage) {
|
||||||
case NS_MOUSE_MOVE:
|
case NS_MOUSE_MOVE:
|
||||||
case NS_MOUSE_ENTER_WIDGET:
|
case NS_MOUSE_ENTER_WIDGET:
|
||||||
case NS_MOUSE_EXIT_WIDGET:
|
case NS_MOUSE_EXIT_WIDGET:
|
||||||
|
@ -3050,7 +3050,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
// Do not process any DOM events if the element is disabled
|
// Do not process any DOM events if the element is disabled
|
||||||
aVisitor.mCanHandle = false;
|
aVisitor.mCanHandle = false;
|
||||||
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
|
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3088,7 +3088,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
|
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
|
||||||
bool outerActivateEvent =
|
bool outerActivateEvent =
|
||||||
((mouseEvent && mouseEvent->IsLeftClickEvent()) ||
|
((mouseEvent && mouseEvent->IsLeftClickEvent()) ||
|
||||||
(aVisitor.mEvent->message == NS_UI_ACTIVATE && !mInInternalActivate));
|
(aVisitor.mEvent->mMessage == NS_UI_ACTIVATE && !mInInternalActivate));
|
||||||
|
|
||||||
if (outerActivateEvent) {
|
if (outerActivateEvent) {
|
||||||
aVisitor.mItemFlags |= NS_OUTER_ACTIVATE_EVENT;
|
aVisitor.mItemFlags |= NS_OUTER_ACTIVATE_EVENT;
|
||||||
|
@ -3153,7 +3153,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
aVisitor.mItemFlags |= NS_NO_CONTENT_DISPATCH;
|
aVisitor.mItemFlags |= NS_NO_CONTENT_DISPATCH;
|
||||||
}
|
}
|
||||||
if (IsSingleLineTextControl(false) &&
|
if (IsSingleLineTextControl(false) &&
|
||||||
aVisitor.mEvent->message == NS_MOUSE_CLICK &&
|
aVisitor.mEvent->mMessage == NS_MOUSE_CLICK &&
|
||||||
aVisitor.mEvent->AsMouseEvent()->button ==
|
aVisitor.mEvent->AsMouseEvent()->button ==
|
||||||
WidgetMouseEvent::eMiddleButton) {
|
WidgetMouseEvent::eMiddleButton) {
|
||||||
aVisitor.mEvent->mFlags.mNoContentDispatch = false;
|
aVisitor.mEvent->mFlags.mNoContentDispatch = false;
|
||||||
|
@ -3163,7 +3163,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
aVisitor.mItemFlags |= mType;
|
aVisitor.mItemFlags |= mType;
|
||||||
|
|
||||||
// Fire onchange (if necessary), before we do the blur, bug 357684.
|
// Fire onchange (if necessary), before we do the blur, bug 357684.
|
||||||
if (aVisitor.mEvent->message == NS_BLUR_CONTENT) {
|
if (aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
|
||||||
// Experimental mobile types rely on the system UI to prevent users to not
|
// Experimental mobile types rely on the system UI to prevent users to not
|
||||||
// set invalid values but we have to be extra-careful. Especially if the
|
// set invalid values but we have to be extra-careful. Especially if the
|
||||||
// option has been enabled on desktop.
|
// option has been enabled on desktop.
|
||||||
|
@ -3178,8 +3178,8 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mType == NS_FORM_INPUT_RANGE &&
|
if (mType == NS_FORM_INPUT_RANGE &&
|
||||||
(aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
|
(aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT ||
|
||||||
aVisitor.mEvent->message == NS_BLUR_CONTENT)) {
|
aVisitor.mEvent->mMessage == NS_BLUR_CONTENT)) {
|
||||||
// Just as nsGenericHTMLFormElementWithState::PreHandleEvent calls
|
// Just as nsGenericHTMLFormElementWithState::PreHandleEvent calls
|
||||||
// nsIFormControlFrame::SetFocus, we handle focus here.
|
// nsIFormControlFrame::SetFocus, we handle focus here.
|
||||||
nsIFrame* frame = GetPrimaryFrame();
|
nsIFrame* frame = GetPrimaryFrame();
|
||||||
|
@ -3197,7 +3197,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
// we want to end the spin. We do this here (rather than in
|
// we want to end the spin. We do this here (rather than in
|
||||||
// PostHandleEvent) because we don't want to let content preventDefault()
|
// PostHandleEvent) because we don't want to let content preventDefault()
|
||||||
// the end of the spin.
|
// the end of the spin.
|
||||||
if (aVisitor.mEvent->message == NS_MOUSE_MOVE) {
|
if (aVisitor.mEvent->mMessage == NS_MOUSE_MOVE) {
|
||||||
// Be aggressive about stopping the spin:
|
// Be aggressive about stopping the spin:
|
||||||
bool stopSpin = true;
|
bool stopSpin = true;
|
||||||
nsNumberControlFrame* numberControlFrame =
|
nsNumberControlFrame* numberControlFrame =
|
||||||
|
@ -3228,13 +3228,13 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
if (stopSpin) {
|
if (stopSpin) {
|
||||||
StopNumberControlSpinnerSpin();
|
StopNumberControlSpinnerSpin();
|
||||||
}
|
}
|
||||||
} else if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_UP) {
|
} else if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP) {
|
||||||
StopNumberControlSpinnerSpin();
|
StopNumberControlSpinnerSpin();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
|
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT ||
|
||||||
aVisitor.mEvent->message == NS_BLUR_CONTENT) {
|
aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
|
||||||
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT) {
|
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT) {
|
||||||
// Tell our frame it's getting focus so that it can make sure focus
|
// Tell our frame it's getting focus so that it can make sure focus
|
||||||
// is moved to our anonymous text control.
|
// is moved to our anonymous text control.
|
||||||
nsNumberControlFrame* numberControlFrame =
|
nsNumberControlFrame* numberControlFrame =
|
||||||
|
@ -3254,7 +3254,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
// that).
|
// that).
|
||||||
frame->InvalidateFrame();
|
frame->InvalidateFrame();
|
||||||
}
|
}
|
||||||
} else if (aVisitor.mEvent->message == NS_KEY_UP) {
|
} else if (aVisitor.mEvent->mMessage == NS_KEY_UP) {
|
||||||
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
|
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
|
||||||
if ((keyEvent->keyCode == NS_VK_UP || keyEvent->keyCode == NS_VK_DOWN) &&
|
if ((keyEvent->keyCode == NS_VK_UP || keyEvent->keyCode == NS_VK_DOWN) &&
|
||||||
!(keyEvent->IsShift() || keyEvent->IsControl() ||
|
!(keyEvent->IsShift() || keyEvent->IsControl() ||
|
||||||
|
@ -3286,7 +3286,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
textControl = numberControlFrame->GetAnonTextControl();
|
textControl = numberControlFrame->GetAnonTextControl();
|
||||||
}
|
}
|
||||||
if (textControl && aVisitor.mEvent->originalTarget == textControl) {
|
if (textControl && aVisitor.mEvent->originalTarget == textControl) {
|
||||||
if (aVisitor.mEvent->message == NS_EDITOR_INPUT) {
|
if (aVisitor.mEvent->mMessage == NS_EDITOR_INPUT) {
|
||||||
// Propogate the anon text control's new value to our HTMLInputElement:
|
// Propogate the anon text control's new value to our HTMLInputElement:
|
||||||
nsAutoString value;
|
nsAutoString value;
|
||||||
numberControlFrame->GetValueOfAnonTextControl(value);
|
numberControlFrame->GetValueOfAnonTextControl(value);
|
||||||
|
@ -3300,7 +3300,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
numberControlFrame->HandlingInputEvent(false);
|
numberControlFrame->HandlingInputEvent(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (aVisitor.mEvent->message == NS_FORM_CHANGE) {
|
else if (aVisitor.mEvent->mMessage == NS_FORM_CHANGE) {
|
||||||
// We cancel the DOM 'change' event that is fired for any change to our
|
// We cancel the DOM 'change' event that is fired for any change to our
|
||||||
// anonymous text control since we fire our own 'change' events and
|
// anonymous text control since we fire our own 'change' events and
|
||||||
// content shouldn't be seeing two 'change' events. Besides that we
|
// content shouldn't be seeing two 'change' events. Besides that we
|
||||||
|
@ -3588,15 +3588,15 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
return MaybeInitPickers(aVisitor);
|
return MaybeInitPickers(aVisitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
|
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT ||
|
||||||
aVisitor.mEvent->message == NS_BLUR_CONTENT) {
|
aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
|
||||||
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT &&
|
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT &&
|
||||||
MayFireChangeOnBlur() &&
|
MayFireChangeOnBlur() &&
|
||||||
!mIsDraggingRange) { // StartRangeThumbDrag already set mFocusedValue
|
!mIsDraggingRange) { // StartRangeThumbDrag already set mFocusedValue
|
||||||
GetValue(mFocusedValue);
|
GetValue(mFocusedValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aVisitor.mEvent->message == NS_BLUR_CONTENT) {
|
if (aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
|
||||||
if (mIsDraggingRange) {
|
if (mIsDraggingRange) {
|
||||||
FinishRangeThumbDrag();
|
FinishRangeThumbDrag();
|
||||||
} else if (mNumberControlSpinnerIsSpinning) {
|
} else if (mNumberControlSpinnerIsSpinning) {
|
||||||
|
@ -3604,7 +3604,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateValidityUIBits(aVisitor.mEvent->message == NS_FOCUS_CONTENT);
|
UpdateValidityUIBits(aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT);
|
||||||
|
|
||||||
UpdateState(true);
|
UpdateState(true);
|
||||||
}
|
}
|
||||||
|
@ -3721,7 +3721,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
|
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
|
||||||
if (mType == NS_FORM_INPUT_NUMBER &&
|
if (mType == NS_FORM_INPUT_NUMBER &&
|
||||||
keyEvent && keyEvent->message == NS_KEY_PRESS &&
|
keyEvent && keyEvent->mMessage == NS_KEY_PRESS &&
|
||||||
aVisitor.mEvent->mFlags.mIsTrusted &&
|
aVisitor.mEvent->mFlags.mIsTrusted &&
|
||||||
(keyEvent->keyCode == NS_VK_UP || keyEvent->keyCode == NS_VK_DOWN) &&
|
(keyEvent->keyCode == NS_VK_UP || keyEvent->keyCode == NS_VK_DOWN) &&
|
||||||
!(keyEvent->IsShift() || keyEvent->IsControl() ||
|
!(keyEvent->IsShift() || keyEvent->IsControl() ||
|
||||||
|
@ -3744,7 +3744,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
|
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
|
||||||
}
|
}
|
||||||
} else if (nsEventStatus_eIgnore == aVisitor.mEventStatus) {
|
} else if (nsEventStatus_eIgnore == aVisitor.mEventStatus) {
|
||||||
switch (aVisitor.mEvent->message) {
|
switch (aVisitor.mEvent->mMessage) {
|
||||||
|
|
||||||
case NS_FOCUS_CONTENT:
|
case NS_FOCUS_CONTENT:
|
||||||
{
|
{
|
||||||
|
@ -3779,9 +3779,9 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
// For backwards compat, trigger checks/radios/buttons with
|
// For backwards compat, trigger checks/radios/buttons with
|
||||||
// space or enter (bug 25300)
|
// space or enter (bug 25300)
|
||||||
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
|
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
|
||||||
if ((aVisitor.mEvent->message == NS_KEY_PRESS &&
|
if ((aVisitor.mEvent->mMessage == NS_KEY_PRESS &&
|
||||||
keyEvent->keyCode == NS_VK_RETURN) ||
|
keyEvent->keyCode == NS_VK_RETURN) ||
|
||||||
(aVisitor.mEvent->message == NS_KEY_UP &&
|
(aVisitor.mEvent->mMessage == NS_KEY_UP &&
|
||||||
keyEvent->keyCode == NS_VK_SPACE)) {
|
keyEvent->keyCode == NS_VK_SPACE)) {
|
||||||
switch(mType) {
|
switch(mType) {
|
||||||
case NS_FORM_INPUT_CHECKBOX:
|
case NS_FORM_INPUT_CHECKBOX:
|
||||||
|
@ -3814,7 +3814,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
} // case
|
} // case
|
||||||
} // switch
|
} // switch
|
||||||
}
|
}
|
||||||
if (aVisitor.mEvent->message == NS_KEY_PRESS &&
|
if (aVisitor.mEvent->mMessage == NS_KEY_PRESS &&
|
||||||
mType == NS_FORM_INPUT_RADIO && !keyEvent->IsAlt() &&
|
mType == NS_FORM_INPUT_RADIO && !keyEvent->IsAlt() &&
|
||||||
!keyEvent->IsControl() && !keyEvent->IsMeta()) {
|
!keyEvent->IsControl() && !keyEvent->IsMeta()) {
|
||||||
bool isMovingBack = false;
|
bool isMovingBack = false;
|
||||||
|
@ -3866,7 +3866,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
* not submit, period.
|
* not submit, period.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (aVisitor.mEvent->message == NS_KEY_PRESS &&
|
if (aVisitor.mEvent->mMessage == NS_KEY_PRESS &&
|
||||||
keyEvent->keyCode == NS_VK_RETURN &&
|
keyEvent->keyCode == NS_VK_RETURN &&
|
||||||
(IsSingleLineTextControl(false, mType) ||
|
(IsSingleLineTextControl(false, mType) ||
|
||||||
mType == NS_FORM_INPUT_NUMBER ||
|
mType == NS_FORM_INPUT_NUMBER ||
|
||||||
|
@ -3876,7 +3876,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aVisitor.mEvent->message == NS_KEY_PRESS &&
|
if (aVisitor.mEvent->mMessage == NS_KEY_PRESS &&
|
||||||
mType == NS_FORM_INPUT_RANGE && !keyEvent->IsAlt() &&
|
mType == NS_FORM_INPUT_RANGE && !keyEvent->IsAlt() &&
|
||||||
!keyEvent->IsControl() && !keyEvent->IsMeta() &&
|
!keyEvent->IsControl() && !keyEvent->IsMeta() &&
|
||||||
(keyEvent->keyCode == NS_VK_LEFT ||
|
(keyEvent->keyCode == NS_VK_LEFT ||
|
||||||
|
@ -3966,7 +3966,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
nsNumberControlFrame* numberControlFrame =
|
nsNumberControlFrame* numberControlFrame =
|
||||||
do_QueryFrame(GetPrimaryFrame());
|
do_QueryFrame(GetPrimaryFrame());
|
||||||
if (numberControlFrame) {
|
if (numberControlFrame) {
|
||||||
if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_DOWN &&
|
if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
|
||||||
IsMutable()) {
|
IsMutable()) {
|
||||||
switch (numberControlFrame->GetSpinButtonForPointerEvent(
|
switch (numberControlFrame->GetSpinButtonForPointerEvent(
|
||||||
aVisitor.mEvent->AsMouseEvent())) {
|
aVisitor.mEvent->AsMouseEvent())) {
|
||||||
|
@ -4028,7 +4028,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
// pres shell. See bug 125624.
|
// pres shell. See bug 125624.
|
||||||
// TODO: removing this code and have the submit event sent by the
|
// TODO: removing this code and have the submit event sent by the
|
||||||
// form, see bug 592124.
|
// form, see bug 592124.
|
||||||
if (presShell && (event.message != NS_FORM_SUBMIT ||
|
if (presShell && (event.mMessage != NS_FORM_SUBMIT ||
|
||||||
mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate) ||
|
mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate) ||
|
||||||
// We know the element is a submit control, if this check is moved,
|
// We know the element is a submit control, if this check is moved,
|
||||||
// make sure formnovalidate is used only if it's a submit control.
|
// make sure formnovalidate is used only if it's a submit control.
|
||||||
|
@ -4083,7 +4083,7 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (aVisitor.mEvent->message)
|
switch (aVisitor.mEvent->mMessage)
|
||||||
{
|
{
|
||||||
case NS_MOUSE_BUTTON_DOWN:
|
case NS_MOUSE_BUTTON_DOWN:
|
||||||
case NS_TOUCH_START: {
|
case NS_TOUCH_START: {
|
||||||
|
@ -4100,7 +4100,7 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
|
||||||
inputEvent->IsOS()) {
|
inputEvent->IsOS()) {
|
||||||
break; // ignore
|
break; // ignore
|
||||||
}
|
}
|
||||||
if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_DOWN) {
|
if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
|
||||||
if (aVisitor.mEvent->AsMouseEvent()->buttons ==
|
if (aVisitor.mEvent->AsMouseEvent()->buttons ==
|
||||||
WidgetMouseEvent::eLeftButtonFlag) {
|
WidgetMouseEvent::eLeftButtonFlag) {
|
||||||
StartRangeThumbDrag(inputEvent);
|
StartRangeThumbDrag(inputEvent);
|
||||||
|
|
|
@ -104,7 +104,7 @@ HTMLLabelElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
|
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
|
||||||
if (mHandlingEvent ||
|
if (mHandlingEvent ||
|
||||||
(!(mouseEvent && mouseEvent->IsLeftClickEvent()) &&
|
(!(mouseEvent && mouseEvent->IsLeftClickEvent()) &&
|
||||||
aVisitor.mEvent->message != NS_MOUSE_BUTTON_DOWN) ||
|
aVisitor.mEvent->mMessage != NS_MOUSE_BUTTON_DOWN) ||
|
||||||
aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault ||
|
aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault ||
|
||||||
!aVisitor.mPresContext ||
|
!aVisitor.mPresContext ||
|
||||||
// Don't handle the event if it's already been handled by another label
|
// Don't handle the event if it's already been handled by another label
|
||||||
|
@ -122,7 +122,7 @@ HTMLLabelElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
|
|
||||||
if (content) {
|
if (content) {
|
||||||
mHandlingEvent = true;
|
mHandlingEvent = true;
|
||||||
switch (aVisitor.mEvent->message) {
|
switch (aVisitor.mEvent->mMessage) {
|
||||||
case NS_MOUSE_BUTTON_DOWN:
|
case NS_MOUSE_BUTTON_DOWN:
|
||||||
if (mouseEvent->button == WidgetMouseEvent::eLeftButton) {
|
if (mouseEvent->button == WidgetMouseEvent::eLeftButton) {
|
||||||
// We reset the mouse-down point on every event because there is
|
// We reset the mouse-down point on every event because there is
|
||||||
|
|
|
@ -254,7 +254,7 @@ HTMLMenuItemElement::SetChecked(bool aChecked)
|
||||||
nsresult
|
nsresult
|
||||||
HTMLMenuItemElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
HTMLMenuItemElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
if (aVisitor.mEvent->message == NS_MOUSE_CLICK) {
|
if (aVisitor.mEvent->mMessage == NS_MOUSE_CLICK) {
|
||||||
|
|
||||||
bool originalCheckedValue = false;
|
bool originalCheckedValue = false;
|
||||||
switch (mType) {
|
switch (mType) {
|
||||||
|
@ -290,7 +290,7 @@ nsresult
|
||||||
HTMLMenuItemElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
HTMLMenuItemElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
// Check to see if the event was cancelled.
|
// Check to see if the event was cancelled.
|
||||||
if (aVisitor.mEvent->message == NS_MOUSE_CLICK &&
|
if (aVisitor.mEvent->mMessage == NS_MOUSE_CLICK &&
|
||||||
aVisitor.mItemFlags & NS_CHECKED_IS_TOGGLED &&
|
aVisitor.mItemFlags & NS_CHECKED_IS_TOGGLED &&
|
||||||
aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault) {
|
aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault) {
|
||||||
bool originalCheckedValue =
|
bool originalCheckedValue =
|
||||||
|
|
|
@ -215,7 +215,7 @@ HTMLObjectElement::HandleFocusBlurPlugin(Element* aElement,
|
||||||
if (!aEvent->mFlags.mIsTrusted) {
|
if (!aEvent->mFlags.mIsTrusted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_FOCUS_CONTENT: {
|
case NS_FOCUS_CONTENT: {
|
||||||
OnFocusBlurPlugin(aElement, true);
|
OnFocusBlurPlugin(aElement, true);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1501,7 +1501,7 @@ nsresult
|
||||||
HTMLSelectElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
HTMLSelectElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
aVisitor.mCanHandle = false;
|
aVisitor.mCanHandle = false;
|
||||||
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
|
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1511,7 +1511,7 @@ HTMLSelectElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
nsresult
|
nsresult
|
||||||
HTMLSelectElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
HTMLSelectElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT) {
|
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT) {
|
||||||
// If the invalid UI is shown, we should show it while focused and
|
// If the invalid UI is shown, we should show it while focused and
|
||||||
// update the invalid/valid UI.
|
// update the invalid/valid UI.
|
||||||
mCanShowInvalidUI = !IsValid() && ShouldShowValidityUI();
|
mCanShowInvalidUI = !IsValid() && ShouldShowValidityUI();
|
||||||
|
@ -1522,7 +1522,7 @@ HTMLSelectElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
|
|
||||||
// We don't have to update NS_EVENT_STATE_MOZ_UI_INVALID nor
|
// We don't have to update NS_EVENT_STATE_MOZ_UI_INVALID nor
|
||||||
// NS_EVENT_STATE_MOZ_UI_VALID given that the states should not change.
|
// NS_EVENT_STATE_MOZ_UI_VALID given that the states should not change.
|
||||||
} else if (aVisitor.mEvent->message == NS_BLUR_CONTENT) {
|
} else if (aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
|
||||||
mCanShowInvalidUI = true;
|
mCanShowInvalidUI = true;
|
||||||
mCanShowValidUI = true;
|
mCanShowValidUI = true;
|
||||||
|
|
||||||
|
|
|
@ -480,13 +480,13 @@ nsresult
|
||||||
HTMLTextAreaElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
HTMLTextAreaElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
aVisitor.mCanHandle = false;
|
aVisitor.mCanHandle = false;
|
||||||
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
|
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't dispatch a second select event if we are already handling
|
// Don't dispatch a second select event if we are already handling
|
||||||
// one.
|
// one.
|
||||||
if (aVisitor.mEvent->message == NS_FORM_SELECTED) {
|
if (aVisitor.mEvent->mMessage == NS_FORM_SELECTED) {
|
||||||
if (mHandlingSelect) {
|
if (mHandlingSelect) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -499,14 +499,14 @@ HTMLTextAreaElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
if (aVisitor.mEvent->mFlags.mNoContentDispatch) {
|
if (aVisitor.mEvent->mFlags.mNoContentDispatch) {
|
||||||
aVisitor.mItemFlags |= NS_NO_CONTENT_DISPATCH;
|
aVisitor.mItemFlags |= NS_NO_CONTENT_DISPATCH;
|
||||||
}
|
}
|
||||||
if (aVisitor.mEvent->message == NS_MOUSE_CLICK &&
|
if (aVisitor.mEvent->mMessage == NS_MOUSE_CLICK &&
|
||||||
aVisitor.mEvent->AsMouseEvent()->button ==
|
aVisitor.mEvent->AsMouseEvent()->button ==
|
||||||
WidgetMouseEvent::eMiddleButton) {
|
WidgetMouseEvent::eMiddleButton) {
|
||||||
aVisitor.mEvent->mFlags.mNoContentDispatch = false;
|
aVisitor.mEvent->mFlags.mNoContentDispatch = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fire onchange (if necessary), before we do the blur, bug 370521.
|
// Fire onchange (if necessary), before we do the blur, bug 370521.
|
||||||
if (aVisitor.mEvent->message == NS_BLUR_CONTENT) {
|
if (aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
|
||||||
FireChangeEventIfNeeded();
|
FireChangeEventIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -534,13 +534,13 @@ HTMLTextAreaElement::FireChangeEventIfNeeded()
|
||||||
nsresult
|
nsresult
|
||||||
HTMLTextAreaElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
HTMLTextAreaElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
if (aVisitor.mEvent->message == NS_FORM_SELECTED) {
|
if (aVisitor.mEvent->mMessage == NS_FORM_SELECTED) {
|
||||||
mHandlingSelect = false;
|
mHandlingSelect = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
|
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT ||
|
||||||
aVisitor.mEvent->message == NS_BLUR_CONTENT) {
|
aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
|
||||||
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT) {
|
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT) {
|
||||||
// If the invalid UI is shown, we should show it while focusing (and
|
// If the invalid UI is shown, we should show it while focusing (and
|
||||||
// update). Otherwise, we should not.
|
// update). Otherwise, we should not.
|
||||||
GetValueInternal(mFocusedValue, true);
|
GetValueInternal(mFocusedValue, true);
|
||||||
|
|
|
@ -2250,7 +2250,7 @@ nsresult
|
||||||
nsGenericHTMLFormElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
nsGenericHTMLFormElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
if (aVisitor.mEvent->mFlags.mIsTrusted) {
|
if (aVisitor.mEvent->mFlags.mIsTrusted) {
|
||||||
switch (aVisitor.mEvent->message) {
|
switch (aVisitor.mEvent->mMessage) {
|
||||||
case NS_FOCUS_CONTENT:
|
case NS_FOCUS_CONTENT:
|
||||||
{
|
{
|
||||||
// Check to see if focus has bubbled up from a form control's
|
// Check to see if focus has bubbled up from a form control's
|
||||||
|
|
|
@ -904,7 +904,7 @@ nsTextInputListener::HandleEvent(nsIDOMEvent* aEvent)
|
||||||
return NS_ERROR_UNEXPECTED;
|
return NS_ERROR_UNEXPECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keyEvent->message != NS_KEY_PRESS) {
|
if (keyEvent->mMessage != NS_KEY_PRESS) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1929,7 +1929,7 @@ TabChild::UpdateTapState(const WidgetTouchEvent& aEvent, nsEventStatus aStatus)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool currentlyTrackingTouch = (mActivePointerId >= 0);
|
bool currentlyTrackingTouch = (mActivePointerId >= 0);
|
||||||
if (aEvent.message == NS_TOUCH_START) {
|
if (aEvent.mMessage == NS_TOUCH_START) {
|
||||||
if (currentlyTrackingTouch || aEvent.touches.Length() > 1) {
|
if (currentlyTrackingTouch || aEvent.touches.Length() > 1) {
|
||||||
// We're tracking a possible tap for another point, or we saw a
|
// We're tracking a possible tap for another point, or we saw a
|
||||||
// touchstart for a later pointer after we canceled tracking of
|
// touchstart for a later pointer after we canceled tracking of
|
||||||
|
@ -1969,7 +1969,7 @@ TabChild::UpdateTapState(const WidgetTouchEvent& aEvent, nsEventStatus aStatus)
|
||||||
|
|
||||||
LayoutDevicePoint currentPoint = LayoutDevicePoint(trackedTouch->mRefPoint.x, trackedTouch->mRefPoint.y);
|
LayoutDevicePoint currentPoint = LayoutDevicePoint(trackedTouch->mRefPoint.x, trackedTouch->mRefPoint.y);
|
||||||
int64_t time = aEvent.time;
|
int64_t time = aEvent.time;
|
||||||
switch (aEvent.message) {
|
switch (aEvent.mMessage) {
|
||||||
case NS_TOUCH_MOVE:
|
case NS_TOUCH_MOVE:
|
||||||
if (std::abs(currentPoint.x - mGestureDownPoint.x) > sDragThreshold.width ||
|
if (std::abs(currentPoint.x - mGestureDownPoint.x) > sDragThreshold.width ||
|
||||||
std::abs(currentPoint.y - mGestureDownPoint.y) > sDragThreshold.height) {
|
std::abs(currentPoint.y - mGestureDownPoint.y) > sDragThreshold.height) {
|
||||||
|
@ -2046,7 +2046,7 @@ TabChild::RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
|
||||||
const uint64_t& aInputBlockId,
|
const uint64_t& aInputBlockId,
|
||||||
const nsEventStatus& aApzResponse)
|
const nsEventStatus& aApzResponse)
|
||||||
{
|
{
|
||||||
TABC_LOG("Receiving touch event of type %d\n", aEvent.message);
|
TABC_LOG("Receiving touch event of type %d\n", aEvent.mMessage);
|
||||||
|
|
||||||
WidgetTouchEvent localEvent(aEvent);
|
WidgetTouchEvent localEvent(aEvent);
|
||||||
localEvent.widget = mPuppetWidget;
|
localEvent.widget = mPuppetWidget;
|
||||||
|
@ -2054,7 +2054,7 @@ TabChild::RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
|
||||||
APZCCallbackHelper::ApplyCallbackTransform(localEvent, aGuid,
|
APZCCallbackHelper::ApplyCallbackTransform(localEvent, aGuid,
|
||||||
mPuppetWidget->GetDefaultScale());
|
mPuppetWidget->GetDefaultScale());
|
||||||
|
|
||||||
if (localEvent.message == NS_TOUCH_START && AsyncPanZoomEnabled()) {
|
if (localEvent.mMessage == NS_TOUCH_START && AsyncPanZoomEnabled()) {
|
||||||
if (gfxPrefs::TouchActionEnabled()) {
|
if (gfxPrefs::TouchActionEnabled()) {
|
||||||
APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(mPuppetWidget,
|
APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(mPuppetWidget,
|
||||||
localEvent, aInputBlockId, mSetAllowedTouchBehaviorCallback);
|
localEvent, aInputBlockId, mSetAllowedTouchBehaviorCallback);
|
||||||
|
@ -2103,13 +2103,13 @@ TabChild::RecvRealDragEvent(const WidgetDragEvent& aEvent,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aEvent.message == NS_DRAGDROP_DROP) {
|
if (aEvent.mMessage == NS_DRAGDROP_DROP) {
|
||||||
bool canDrop = true;
|
bool canDrop = true;
|
||||||
if (!dragSession || NS_FAILED(dragSession->GetCanDrop(&canDrop)) ||
|
if (!dragSession || NS_FAILED(dragSession->GetCanDrop(&canDrop)) ||
|
||||||
!canDrop) {
|
!canDrop) {
|
||||||
localEvent.message = NS_DRAGDROP_EXIT;
|
localEvent.mMessage = NS_DRAGDROP_EXIT;
|
||||||
}
|
}
|
||||||
} else if (aEvent.message == NS_DRAGDROP_OVER) {
|
} else if (aEvent.mMessage == NS_DRAGDROP_OVER) {
|
||||||
nsCOMPtr<nsIDragService> dragService =
|
nsCOMPtr<nsIDragService> dragService =
|
||||||
do_GetService("@mozilla.org/widget/dragservice;1");
|
do_GetService("@mozilla.org/widget/dragservice;1");
|
||||||
if (dragService) {
|
if (dragService) {
|
||||||
|
@ -2156,7 +2156,7 @@ TabChild::RecvRealKeyEvent(const WidgetKeyboardEvent& event,
|
||||||
{
|
{
|
||||||
AutoCacheNativeKeyCommands autoCache(mPuppetWidget);
|
AutoCacheNativeKeyCommands autoCache(mPuppetWidget);
|
||||||
|
|
||||||
if (event.message == NS_KEY_PRESS) {
|
if (event.mMessage == NS_KEY_PRESS) {
|
||||||
// If content code called preventDefault() on a keydown event, then we don't
|
// If content code called preventDefault() on a keydown event, then we don't
|
||||||
// want to process any following keypress events.
|
// want to process any following keypress events.
|
||||||
if (mIgnoreKeyPressEvent) {
|
if (mIgnoreKeyPressEvent) {
|
||||||
|
@ -2176,7 +2176,7 @@ TabChild::RecvRealKeyEvent(const WidgetKeyboardEvent& event,
|
||||||
localEvent.widget = mPuppetWidget;
|
localEvent.widget = mPuppetWidget;
|
||||||
nsEventStatus status = APZCCallbackHelper::DispatchWidgetEvent(localEvent);
|
nsEventStatus status = APZCCallbackHelper::DispatchWidgetEvent(localEvent);
|
||||||
|
|
||||||
if (event.message == NS_KEY_DOWN) {
|
if (event.mMessage == NS_KEY_DOWN) {
|
||||||
mIgnoreKeyPressEvent = status == nsEventStatus_eConsumeNoDefault;
|
mIgnoreKeyPressEvent = status == nsEventStatus_eConsumeNoDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2210,7 +2210,7 @@ TabChild::RecvCompositionEvent(const WidgetCompositionEvent& event)
|
||||||
WidgetCompositionEvent localEvent(event);
|
WidgetCompositionEvent localEvent(event);
|
||||||
localEvent.widget = mPuppetWidget;
|
localEvent.widget = mPuppetWidget;
|
||||||
APZCCallbackHelper::DispatchWidgetEvent(localEvent);
|
APZCCallbackHelper::DispatchWidgetEvent(localEvent);
|
||||||
unused << SendOnEventNeedingAckHandled(event.message);
|
unused << SendOnEventNeedingAckHandled(event.mMessage);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2220,7 +2220,7 @@ TabChild::RecvSelectionEvent(const WidgetSelectionEvent& event)
|
||||||
WidgetSelectionEvent localEvent(event);
|
WidgetSelectionEvent localEvent(event);
|
||||||
localEvent.widget = mPuppetWidget;
|
localEvent.widget = mPuppetWidget;
|
||||||
APZCCallbackHelper::DispatchWidgetEvent(localEvent);
|
APZCCallbackHelper::DispatchWidgetEvent(localEvent);
|
||||||
unused << SendOnEventNeedingAckHandled(event.message);
|
unused << SendOnEventNeedingAckHandled(event.mMessage);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1368,19 +1368,19 @@ bool TabParent::SendRealMouseEvent(WidgetMouseEvent& event)
|
||||||
if (widget) {
|
if (widget) {
|
||||||
// When we mouseenter the tab, the tab's cursor should
|
// When we mouseenter the tab, the tab's cursor should
|
||||||
// become the current cursor. When we mouseexit, we stop.
|
// become the current cursor. When we mouseexit, we stop.
|
||||||
if (NS_MOUSE_ENTER_WIDGET == event.message) {
|
if (NS_MOUSE_ENTER_WIDGET == event.mMessage) {
|
||||||
mTabSetsCursor = true;
|
mTabSetsCursor = true;
|
||||||
if (mCustomCursor) {
|
if (mCustomCursor) {
|
||||||
widget->SetCursor(mCustomCursor, mCustomCursorHotspotX, mCustomCursorHotspotY);
|
widget->SetCursor(mCustomCursor, mCustomCursorHotspotX, mCustomCursorHotspotY);
|
||||||
} else if (mCursor != nsCursor(-1)) {
|
} else if (mCursor != nsCursor(-1)) {
|
||||||
widget->SetCursor(mCursor);
|
widget->SetCursor(mCursor);
|
||||||
}
|
}
|
||||||
} else if (NS_MOUSE_EXIT_WIDGET == event.message) {
|
} else if (NS_MOUSE_EXIT_WIDGET == event.mMessage) {
|
||||||
mTabSetsCursor = false;
|
mTabSetsCursor = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NS_MOUSE_MOVE == event.message) {
|
if (NS_MOUSE_MOVE == event.mMessage) {
|
||||||
return SendRealMouseMoveEvent(event);
|
return SendRealMouseMoveEvent(event);
|
||||||
}
|
}
|
||||||
return SendRealMouseButtonEvent(event);
|
return SendRealMouseButtonEvent(event);
|
||||||
|
@ -1722,7 +1722,7 @@ bool TabParent::SendRealKeyEvent(WidgetKeyboardEvent& event)
|
||||||
|
|
||||||
MaybeNativeKeyBinding bindings;
|
MaybeNativeKeyBinding bindings;
|
||||||
bindings = void_t();
|
bindings = void_t();
|
||||||
if (event.message == NS_KEY_PRESS) {
|
if (event.mMessage == NS_KEY_PRESS) {
|
||||||
nsCOMPtr<nsIWidget> widget = GetWidget();
|
nsCOMPtr<nsIWidget> widget = GetWidget();
|
||||||
|
|
||||||
AutoInfallibleTArray<mozilla::CommandInt, 4> singleLine;
|
AutoInfallibleTArray<mozilla::CommandInt, 4> singleLine;
|
||||||
|
@ -1754,7 +1754,7 @@ bool TabParent::SendRealTouchEvent(WidgetTouchEvent& event)
|
||||||
// confuses remote content and the panning and zooming logic into thinking
|
// confuses remote content and the panning and zooming logic into thinking
|
||||||
// that the added touches are part of the touchend/cancel, when actually
|
// that the added touches are part of the touchend/cancel, when actually
|
||||||
// they're not.
|
// they're not.
|
||||||
if (event.message == NS_TOUCH_END || event.message == NS_TOUCH_CANCEL) {
|
if (event.mMessage == NS_TOUCH_END || event.mMessage == NS_TOUCH_CANCEL) {
|
||||||
for (int i = event.touches.Length() - 1; i >= 0; i--) {
|
for (int i = event.touches.Length() - 1; i >= 0; i--) {
|
||||||
if (!event.touches[i]->mChanged) {
|
if (!event.touches[i]->mChanged) {
|
||||||
event.touches.RemoveElementAt(i);
|
event.touches.RemoveElementAt(i);
|
||||||
|
@ -1776,7 +1776,7 @@ bool TabParent::SendRealTouchEvent(WidgetTouchEvent& event)
|
||||||
event.touches[i]->mRefPoint += offset;
|
event.touches[i]->mRefPoint += offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (event.message == NS_TOUCH_MOVE) ?
|
return (event.mMessage == NS_TOUCH_MOVE) ?
|
||||||
PBrowserParent::SendRealTouchMoveEvent(event, guid, blockId, apzResponse) :
|
PBrowserParent::SendRealTouchMoveEvent(event, guid, blockId, apzResponse) :
|
||||||
PBrowserParent::SendRealTouchEvent(event, guid, blockId, apzResponse);
|
PBrowserParent::SendRealTouchEvent(event, guid, blockId, apzResponse);
|
||||||
}
|
}
|
||||||
|
@ -2263,7 +2263,7 @@ TabParent::RecvDispatchAfterKeyboardEvent(const WidgetKeyboardEvent& aEvent)
|
||||||
|
|
||||||
if (mFrameElement &&
|
if (mFrameElement &&
|
||||||
PresShell::BeforeAfterKeyboardEventEnabled() &&
|
PresShell::BeforeAfterKeyboardEventEnabled() &&
|
||||||
localEvent.message != NS_KEY_PRESS) {
|
localEvent.mMessage != NS_KEY_PRESS) {
|
||||||
presShell->DispatchAfterKeyboardEvent(mFrameElement, localEvent,
|
presShell->DispatchAfterKeyboardEvent(mFrameElement, localEvent,
|
||||||
aEvent.mFlags.mDefaultPrevented);
|
aEvent.mFlags.mDefaultPrevented);
|
||||||
}
|
}
|
||||||
|
@ -2282,7 +2282,7 @@ TabParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent)
|
||||||
NS_WARN_IF(!aEvent.mSucceeded)) {
|
NS_WARN_IF(!aEvent.mSucceeded)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
switch (aEvent.message) {
|
switch (aEvent.mMessage) {
|
||||||
case NS_QUERY_TEXT_RECT:
|
case NS_QUERY_TEXT_RECT:
|
||||||
case NS_QUERY_CARET_RECT:
|
case NS_QUERY_CARET_RECT:
|
||||||
case NS_QUERY_EDITOR_RECT:
|
case NS_QUERY_EDITOR_RECT:
|
||||||
|
|
|
@ -1574,7 +1574,7 @@ nsresult nsPluginInstanceOwner::DispatchFocusToPlugin(nsIDOMEvent* aFocusEvent)
|
||||||
|
|
||||||
WidgetEvent* theEvent = aFocusEvent->GetInternalNSEvent();
|
WidgetEvent* theEvent = aFocusEvent->GetInternalNSEvent();
|
||||||
if (theEvent) {
|
if (theEvent) {
|
||||||
WidgetGUIEvent focusEvent(theEvent->mFlags.mIsTrusted, theEvent->message,
|
WidgetGUIEvent focusEvent(theEvent->mFlags.mIsTrusted, theEvent->mMessage,
|
||||||
nullptr);
|
nullptr);
|
||||||
nsEventStatus rv = ProcessEvent(focusEvent);
|
nsEventStatus rv = ProcessEvent(focusEvent);
|
||||||
if (nsEventStatus_eConsumeNoDefault == rv) {
|
if (nsEventStatus_eConsumeNoDefault == rv) {
|
||||||
|
@ -1683,7 +1683,7 @@ nsresult nsPluginInstanceOwner::DispatchMouseToPlugin(nsIDOMEvent* aMouseEvent,
|
||||||
aMouseEvent->StopPropagation();
|
aMouseEvent->StopPropagation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mouseEvent->message == NS_MOUSE_BUTTON_UP) {
|
if (mouseEvent->mMessage == NS_MOUSE_BUTTON_UP) {
|
||||||
mLastMouseDownButtonType = -1;
|
mLastMouseDownButtonType = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1748,8 +1748,9 @@ nsPluginInstanceOwner::HandleEvent(nsIDOMEvent* aEvent)
|
||||||
nsCOMPtr<nsIDOMDragEvent> dragEvent(do_QueryInterface(aEvent));
|
nsCOMPtr<nsIDOMDragEvent> dragEvent(do_QueryInterface(aEvent));
|
||||||
if (dragEvent && mInstance) {
|
if (dragEvent && mInstance) {
|
||||||
WidgetEvent* ievent = aEvent->GetInternalNSEvent();
|
WidgetEvent* ievent = aEvent->GetInternalNSEvent();
|
||||||
if ((ievent && ievent->mFlags.mIsTrusted) &&
|
if (ievent && ievent->mFlags.mIsTrusted &&
|
||||||
ievent->message != NS_DRAGDROP_ENTER && ievent->message != NS_DRAGDROP_OVER) {
|
ievent->mMessage != NS_DRAGDROP_ENTER &&
|
||||||
|
ievent->mMessage != NS_DRAGDROP_OVER) {
|
||||||
aEvent->PreventDefault();
|
aEvent->PreventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1806,7 +1807,7 @@ CocoaEventTypeForEvent(const WidgetGUIEvent& anEvent, nsIFrame* aObjectFrame)
|
||||||
return event->type;
|
return event->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (anEvent.message) {
|
switch (anEvent.mMessage) {
|
||||||
case NS_MOUSE_OVER:
|
case NS_MOUSE_OVER:
|
||||||
return NPCocoaEventMouseEntered;
|
return NPCocoaEventMouseEntered;
|
||||||
case NS_MOUSE_OUT:
|
case NS_MOUSE_OUT:
|
||||||
|
@ -1847,12 +1848,12 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
|
||||||
InitializeNPCocoaEvent(&cocoaEvent);
|
InitializeNPCocoaEvent(&cocoaEvent);
|
||||||
cocoaEvent.type = CocoaEventTypeForEvent(*anEvent, aObjectFrame);
|
cocoaEvent.type = CocoaEventTypeForEvent(*anEvent, aObjectFrame);
|
||||||
|
|
||||||
if (anEvent->message == NS_MOUSE_MOVE ||
|
if (anEvent->mMessage == NS_MOUSE_MOVE ||
|
||||||
anEvent->message == NS_MOUSE_BUTTON_DOWN ||
|
anEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
|
||||||
anEvent->message == NS_MOUSE_BUTTON_UP ||
|
anEvent->mMessage == NS_MOUSE_BUTTON_UP ||
|
||||||
anEvent->message == NS_MOUSE_SCROLL ||
|
anEvent->mMessage == NS_MOUSE_SCROLL ||
|
||||||
anEvent->message == NS_MOUSE_OVER ||
|
anEvent->mMessage == NS_MOUSE_OVER ||
|
||||||
anEvent->message == NS_MOUSE_OUT)
|
anEvent->mMessage == NS_MOUSE_OUT)
|
||||||
{
|
{
|
||||||
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(anEvent, aObjectFrame) -
|
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(anEvent, aObjectFrame) -
|
||||||
aObjectFrame->GetContentRectRelativeToSelf().TopLeft();
|
aObjectFrame->GetContentRectRelativeToSelf().TopLeft();
|
||||||
|
@ -1868,7 +1869,7 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
|
||||||
cocoaEvent.data.mouse.pluginY = double(ptPx.y);
|
cocoaEvent.data.mouse.pluginY = double(ptPx.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (anEvent->message) {
|
switch (anEvent->mMessage) {
|
||||||
case NS_MOUSE_BUTTON_DOWN:
|
case NS_MOUSE_BUTTON_DOWN:
|
||||||
case NS_MOUSE_BUTTON_UP:
|
case NS_MOUSE_BUTTON_UP:
|
||||||
{
|
{
|
||||||
|
@ -1911,7 +1912,8 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
|
||||||
|
|
||||||
// That keyEvent->mPluginTextEventString is non-empty is a signal that we should
|
// That keyEvent->mPluginTextEventString is non-empty is a signal that we should
|
||||||
// create a text event for the plugin, instead of a key event.
|
// create a text event for the plugin, instead of a key event.
|
||||||
if ((anEvent->message == NS_KEY_DOWN) && !keyEvent->mPluginTextEventString.IsEmpty()) {
|
if (anEvent->mMessage == NS_KEY_DOWN &&
|
||||||
|
!keyEvent->mPluginTextEventString.IsEmpty()) {
|
||||||
cocoaEvent.type = NPCocoaEventTextInput;
|
cocoaEvent.type = NPCocoaEventTextInput;
|
||||||
const char16_t* pluginTextEventString = keyEvent->mPluginTextEventString.get();
|
const char16_t* pluginTextEventString = keyEvent->mPluginTextEventString.get();
|
||||||
cocoaEvent.data.text.text = (NPNSString*)
|
cocoaEvent.data.text.text = (NPNSString*)
|
||||||
|
@ -1937,7 +1939,7 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
|
||||||
}
|
}
|
||||||
case NS_FOCUS_CONTENT:
|
case NS_FOCUS_CONTENT:
|
||||||
case NS_BLUR_CONTENT:
|
case NS_BLUR_CONTENT:
|
||||||
cocoaEvent.data.focus.hasFocus = (anEvent->message == NS_FOCUS_CONTENT);
|
cocoaEvent.data.focus.hasFocus = (anEvent->mMessage == NS_FOCUS_CONTENT);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -1975,7 +1977,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
|
||||||
// focus unless it lost focus within the window. For example, ignore a blur
|
// focus unless it lost focus within the window. For example, ignore a blur
|
||||||
// event if it's coming due to the plugin's window deactivating.
|
// event if it's coming due to the plugin's window deactivating.
|
||||||
nsCOMPtr<nsIContent> content = do_QueryReferent(mContent);
|
nsCOMPtr<nsIContent> content = do_QueryReferent(mContent);
|
||||||
if (anEvent.message == NS_BLUR_CONTENT &&
|
if (anEvent.mMessage == NS_BLUR_CONTENT &&
|
||||||
ContentIsFocusedWithinWindow(content)) {
|
ContentIsFocusedWithinWindow(content)) {
|
||||||
mShouldBlurOnActivate = true;
|
mShouldBlurOnActivate = true;
|
||||||
return nsEventStatus_eIgnore;
|
return nsEventStatus_eIgnore;
|
||||||
|
@ -1985,7 +1987,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
|
||||||
// it focus. This might happen if it has focus, its window is blurred, then the
|
// it focus. This might happen if it has focus, its window is blurred, then the
|
||||||
// window is made active again. The plugin never lost in-window focus, so it
|
// window is made active again. The plugin never lost in-window focus, so it
|
||||||
// shouldn't get a focus event again.
|
// shouldn't get a focus event again.
|
||||||
if (anEvent.message == NS_FOCUS_CONTENT &&
|
if (anEvent.mMessage == NS_FOCUS_CONTENT &&
|
||||||
mLastContentFocused == true) {
|
mLastContentFocused == true) {
|
||||||
mShouldBlurOnActivate = false;
|
mShouldBlurOnActivate = false;
|
||||||
return nsEventStatus_eIgnore;
|
return nsEventStatus_eIgnore;
|
||||||
|
@ -1994,9 +1996,9 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
|
||||||
// Now, if we're going to send a focus event, update mLastContentFocused and
|
// Now, if we're going to send a focus event, update mLastContentFocused and
|
||||||
// tell any plugins in our window that we have taken focus, so they should
|
// tell any plugins in our window that we have taken focus, so they should
|
||||||
// perform any delayed blurs.
|
// perform any delayed blurs.
|
||||||
if (anEvent.message == NS_FOCUS_CONTENT ||
|
if (anEvent.mMessage == NS_FOCUS_CONTENT ||
|
||||||
anEvent.message == NS_BLUR_CONTENT) {
|
anEvent.mMessage == NS_BLUR_CONTENT) {
|
||||||
mLastContentFocused = (anEvent.message == NS_FOCUS_CONTENT);
|
mLastContentFocused = (anEvent.mMessage == NS_FOCUS_CONTENT);
|
||||||
mShouldBlurOnActivate = false;
|
mShouldBlurOnActivate = false;
|
||||||
PerformDelayedBlurs();
|
PerformDelayedBlurs();
|
||||||
}
|
}
|
||||||
|
@ -2040,7 +2042,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool handled = (response == kNPEventHandled || response == kNPEventStartIME);
|
bool handled = (response == kNPEventHandled || response == kNPEventStartIME);
|
||||||
bool leftMouseButtonDown = (anEvent.message == NS_MOUSE_BUTTON_DOWN) &&
|
bool leftMouseButtonDown = (anEvent.mMessage == NS_MOUSE_BUTTON_DOWN) &&
|
||||||
(anEvent.AsMouseEvent()->button == WidgetMouseEvent::eLeftButton);
|
(anEvent.AsMouseEvent()->button == WidgetMouseEvent::eLeftButton);
|
||||||
if (handled && !(leftMouseButtonDown && !mContentFocused)) {
|
if (handled && !(leftMouseButtonDown && !mContentFocused)) {
|
||||||
rv = nsEventStatus_eConsumeNoDefault;
|
rv = nsEventStatus_eConsumeNoDefault;
|
||||||
|
@ -2059,7 +2061,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
|
||||||
// types
|
// types
|
||||||
pluginEvent.event = 0;
|
pluginEvent.event = 0;
|
||||||
const WidgetMouseEvent* mouseEvent = anEvent.AsMouseEvent();
|
const WidgetMouseEvent* mouseEvent = anEvent.AsMouseEvent();
|
||||||
switch (anEvent.message) {
|
switch (anEvent.mMessage) {
|
||||||
case NS_MOUSE_MOVE:
|
case NS_MOUSE_MOVE:
|
||||||
pluginEvent.event = WM_MOUSEMOVE;
|
pluginEvent.event = WM_MOUSEMOVE;
|
||||||
break;
|
break;
|
||||||
|
@ -2104,12 +2106,12 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
|
||||||
// not the widget they were received on.
|
// not the widget they were received on.
|
||||||
// See use of NPEvent in widget/windows/nsWindow.cpp
|
// See use of NPEvent in widget/windows/nsWindow.cpp
|
||||||
// for why this assert should be safe
|
// for why this assert should be safe
|
||||||
NS_ASSERTION(anEvent.message == NS_MOUSE_BUTTON_DOWN ||
|
NS_ASSERTION(anEvent.mMessage == NS_MOUSE_BUTTON_DOWN ||
|
||||||
anEvent.message == NS_MOUSE_BUTTON_UP ||
|
anEvent.mMessage == NS_MOUSE_BUTTON_UP ||
|
||||||
anEvent.message == NS_MOUSE_DOUBLECLICK ||
|
anEvent.mMessage == NS_MOUSE_DOUBLECLICK ||
|
||||||
anEvent.message == NS_MOUSE_OVER ||
|
anEvent.mMessage == NS_MOUSE_OVER ||
|
||||||
anEvent.message == NS_MOUSE_OUT ||
|
anEvent.mMessage == NS_MOUSE_OUT ||
|
||||||
anEvent.message == NS_MOUSE_MOVE,
|
anEvent.mMessage == NS_MOUSE_MOVE,
|
||||||
"Incorrect event type for coordinate translation");
|
"Incorrect event type for coordinate translation");
|
||||||
nsPoint pt =
|
nsPoint pt =
|
||||||
nsLayoutUtils::GetEventCoordinatesRelativeTo(&anEvent, mPluginFrame) -
|
nsLayoutUtils::GetEventCoordinatesRelativeTo(&anEvent, mPluginFrame) -
|
||||||
|
@ -2122,7 +2124,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!pPluginEvent) {
|
else if (!pPluginEvent) {
|
||||||
switch (anEvent.message) {
|
switch (anEvent.mMessage) {
|
||||||
case NS_FOCUS_CONTENT:
|
case NS_FOCUS_CONTENT:
|
||||||
pluginEvent.event = WM_SETFOCUS;
|
pluginEvent.event = WM_SETFOCUS;
|
||||||
pluginEvent.wParam = 0;
|
pluginEvent.wParam = 0;
|
||||||
|
@ -2163,7 +2165,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
|
||||||
switch(anEvent.mClass) {
|
switch(anEvent.mClass) {
|
||||||
case eMouseEventClass:
|
case eMouseEventClass:
|
||||||
{
|
{
|
||||||
switch (anEvent.message)
|
switch (anEvent.mMessage)
|
||||||
{
|
{
|
||||||
case NS_MOUSE_CLICK:
|
case NS_MOUSE_CLICK:
|
||||||
case NS_MOUSE_DOUBLECLICK:
|
case NS_MOUSE_DOUBLECLICK:
|
||||||
|
@ -2191,13 +2193,13 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
|
||||||
Window root = None; // Could XQueryTree, but this is not important.
|
Window root = None; // Could XQueryTree, but this is not important.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (anEvent.message)
|
switch (anEvent.mMessage)
|
||||||
{
|
{
|
||||||
case NS_MOUSE_OVER:
|
case NS_MOUSE_OVER:
|
||||||
case NS_MOUSE_OUT:
|
case NS_MOUSE_OUT:
|
||||||
{
|
{
|
||||||
XCrossingEvent& event = pluginEvent.xcrossing;
|
XCrossingEvent& event = pluginEvent.xcrossing;
|
||||||
event.type = anEvent.message == NS_MOUSE_OVER ?
|
event.type = anEvent.mMessage == NS_MOUSE_OVER ?
|
||||||
EnterNotify : LeaveNotify;
|
EnterNotify : LeaveNotify;
|
||||||
event.root = root;
|
event.root = root;
|
||||||
event.time = anEvent.time;
|
event.time = anEvent.time;
|
||||||
|
@ -2235,7 +2237,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
|
||||||
case NS_MOUSE_BUTTON_UP:
|
case NS_MOUSE_BUTTON_UP:
|
||||||
{
|
{
|
||||||
XButtonEvent& event = pluginEvent.xbutton;
|
XButtonEvent& event = pluginEvent.xbutton;
|
||||||
event.type = anEvent.message == NS_MOUSE_BUTTON_DOWN ?
|
event.type = anEvent.mMessage == NS_MOUSE_BUTTON_DOWN ?
|
||||||
ButtonPress : ButtonRelease;
|
ButtonPress : ButtonRelease;
|
||||||
event.root = root;
|
event.root = root;
|
||||||
event.time = anEvent.time;
|
event.time = anEvent.time;
|
||||||
|
@ -2278,7 +2280,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
|
||||||
static_cast<const GdkEventKey*>(anEvent.mPluginEvent);
|
static_cast<const GdkEventKey*>(anEvent.mPluginEvent);
|
||||||
event.keycode = gdkEvent->hardware_keycode;
|
event.keycode = gdkEvent->hardware_keycode;
|
||||||
event.state = gdkEvent->state;
|
event.state = gdkEvent->state;
|
||||||
switch (anEvent.message)
|
switch (anEvent.mMessage)
|
||||||
{
|
{
|
||||||
case NS_KEY_DOWN:
|
case NS_KEY_DOWN:
|
||||||
// Handle NS_KEY_DOWN for modifier key presses
|
// Handle NS_KEY_DOWN for modifier key presses
|
||||||
|
@ -2315,14 +2317,14 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
switch (anEvent.message)
|
switch (anEvent.mMessage)
|
||||||
{
|
{
|
||||||
case NS_FOCUS_CONTENT:
|
case NS_FOCUS_CONTENT:
|
||||||
case NS_BLUR_CONTENT:
|
case NS_BLUR_CONTENT:
|
||||||
{
|
{
|
||||||
XFocusChangeEvent &event = pluginEvent.xfocus;
|
XFocusChangeEvent &event = pluginEvent.xfocus;
|
||||||
event.type =
|
event.type =
|
||||||
anEvent.message == NS_FOCUS_CONTENT ? FocusIn : FocusOut;
|
anEvent.mMessage == NS_FOCUS_CONTENT ? FocusIn : FocusOut;
|
||||||
// information lost:
|
// information lost:
|
||||||
event.mode = -1;
|
event.mode = -1;
|
||||||
event.detail = NotifyDetailNone;
|
event.detail = NotifyDetailNone;
|
||||||
|
@ -2363,7 +2365,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
|
||||||
switch(anEvent.mClass) {
|
switch(anEvent.mClass) {
|
||||||
case eMouseEventClass:
|
case eMouseEventClass:
|
||||||
{
|
{
|
||||||
switch (anEvent.message)
|
switch (anEvent.mMessage)
|
||||||
{
|
{
|
||||||
case NS_MOUSE_CLICK:
|
case NS_MOUSE_CLICK:
|
||||||
case NS_MOUSE_DOUBLECLICK:
|
case NS_MOUSE_DOUBLECLICK:
|
||||||
|
@ -2379,7 +2381,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
|
||||||
nsIntPoint pluginPoint(presContext->AppUnitsToDevPixels(appPoint.x),
|
nsIntPoint pluginPoint(presContext->AppUnitsToDevPixels(appPoint.x),
|
||||||
presContext->AppUnitsToDevPixels(appPoint.y));
|
presContext->AppUnitsToDevPixels(appPoint.y));
|
||||||
|
|
||||||
switch (anEvent.message)
|
switch (anEvent.mMessage)
|
||||||
{
|
{
|
||||||
case NS_MOUSE_MOVE:
|
case NS_MOUSE_MOVE:
|
||||||
{
|
{
|
||||||
|
|
|
@ -590,7 +590,7 @@ SVGSVGElement::IsAttributeMapped(const nsIAtom* name) const
|
||||||
nsresult
|
nsresult
|
||||||
SVGSVGElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
SVGSVGElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
{
|
{
|
||||||
if (aVisitor.mEvent->message == NS_SVG_LOAD) {
|
if (aVisitor.mEvent->mMessage == NS_SVG_LOAD) {
|
||||||
if (mTimedDocumentRoot) {
|
if (mTimedDocumentRoot) {
|
||||||
mTimedDocumentRoot->Begin();
|
mTimedDocumentRoot->Begin();
|
||||||
// Set 'resample needed' flag, so that if any script calls a DOM method
|
// Set 'resample needed' flag, so that if any script calls a DOM method
|
||||||
|
|
|
@ -1265,18 +1265,18 @@ nsXULElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||||
aVisitor.mForceContentDispatch = true; //FIXME! Bug 329119
|
aVisitor.mForceContentDispatch = true; //FIXME! Bug 329119
|
||||||
if (IsRootOfNativeAnonymousSubtree() &&
|
if (IsRootOfNativeAnonymousSubtree() &&
|
||||||
(IsAnyOfXULElements(nsGkAtoms::scrollbar, nsGkAtoms::scrollcorner)) &&
|
(IsAnyOfXULElements(nsGkAtoms::scrollbar, nsGkAtoms::scrollcorner)) &&
|
||||||
(aVisitor.mEvent->message == NS_MOUSE_CLICK ||
|
(aVisitor.mEvent->mMessage == NS_MOUSE_CLICK ||
|
||||||
aVisitor.mEvent->message == NS_MOUSE_DOUBLECLICK ||
|
aVisitor.mEvent->mMessage == NS_MOUSE_DOUBLECLICK ||
|
||||||
aVisitor.mEvent->message == NS_XUL_COMMAND ||
|
aVisitor.mEvent->mMessage == NS_XUL_COMMAND ||
|
||||||
aVisitor.mEvent->message == NS_CONTEXTMENU ||
|
aVisitor.mEvent->mMessage == NS_CONTEXTMENU ||
|
||||||
aVisitor.mEvent->message == NS_DRAGDROP_START ||
|
aVisitor.mEvent->mMessage == NS_DRAGDROP_START ||
|
||||||
aVisitor.mEvent->message == NS_DRAGDROP_GESTURE)) {
|
aVisitor.mEvent->mMessage == NS_DRAGDROP_GESTURE)) {
|
||||||
// Don't propagate these events from native anonymous scrollbar.
|
// Don't propagate these events from native anonymous scrollbar.
|
||||||
aVisitor.mCanHandle = true;
|
aVisitor.mCanHandle = true;
|
||||||
aVisitor.mParentTarget = nullptr;
|
aVisitor.mParentTarget = nullptr;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
if (aVisitor.mEvent->message == NS_XUL_COMMAND &&
|
if (aVisitor.mEvent->mMessage == NS_XUL_COMMAND &&
|
||||||
aVisitor.mEvent->mClass == eInputEventClass &&
|
aVisitor.mEvent->mClass == eInputEventClass &&
|
||||||
aVisitor.mEvent->originalTarget == static_cast<nsIContent*>(this) &&
|
aVisitor.mEvent->originalTarget == static_cast<nsIContent*>(this) &&
|
||||||
!IsXULElement(nsGkAtoms::command)) {
|
!IsXULElement(nsGkAtoms::command)) {
|
||||||
|
|
|
@ -4695,7 +4695,7 @@ nsEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
|
||||||
WidgetKeyboardEvent* nativeKeyEvent =
|
WidgetKeyboardEvent* nativeKeyEvent =
|
||||||
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
|
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
|
||||||
NS_ENSURE_TRUE(nativeKeyEvent, NS_ERROR_UNEXPECTED);
|
NS_ENSURE_TRUE(nativeKeyEvent, NS_ERROR_UNEXPECTED);
|
||||||
NS_ASSERTION(nativeKeyEvent->message == NS_KEY_PRESS,
|
NS_ASSERTION(nativeKeyEvent->mMessage == NS_KEY_PRESS,
|
||||||
"HandleKeyPressEvent gets non-keypress event");
|
"HandleKeyPressEvent gets non-keypress event");
|
||||||
|
|
||||||
// if we are readonly or disabled, then do nothing.
|
// if we are readonly or disabled, then do nothing.
|
||||||
|
@ -5151,7 +5151,7 @@ nsEditor::IsAcceptableInputEvent(nsIDOMEvent* aEvent)
|
||||||
// strange event order.
|
// strange event order.
|
||||||
bool needsWidget = false;
|
bool needsWidget = false;
|
||||||
WidgetGUIEvent* widgetGUIEvent = nullptr;
|
WidgetGUIEvent* widgetGUIEvent = nullptr;
|
||||||
switch (widgetEvent->message) {
|
switch (widgetEvent->mMessage) {
|
||||||
case NS_USER_DEFINED_EVENT:
|
case NS_USER_DEFINED_EVENT:
|
||||||
// If events are not created with proper event interface, their message
|
// If events are not created with proper event interface, their message
|
||||||
// are initialized with NS_USER_DEFINED_EVENT. Let's ignore such event.
|
// are initialized with NS_USER_DEFINED_EVENT. Let's ignore such event.
|
||||||
|
|
|
@ -369,7 +369,7 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent)
|
||||||
// calling it, this queries the specific interface. If it would fail,
|
// calling it, this queries the specific interface. If it would fail,
|
||||||
// each event handler would just ignore the event. So, in this method,
|
// each event handler would just ignore the event. So, in this method,
|
||||||
// you don't need to check if the QI succeeded before each call.
|
// you don't need to check if the QI succeeded before each call.
|
||||||
switch (internalEvent->message) {
|
switch (internalEvent->mMessage) {
|
||||||
// dragenter
|
// dragenter
|
||||||
case NS_DRAGDROP_ENTER: {
|
case NS_DRAGDROP_ENTER: {
|
||||||
nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
|
nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
|
||||||
|
|
|
@ -594,7 +594,7 @@ nsHTMLEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
|
||||||
WidgetKeyboardEvent* nativeKeyEvent =
|
WidgetKeyboardEvent* nativeKeyEvent =
|
||||||
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
|
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
|
||||||
NS_ENSURE_TRUE(nativeKeyEvent, NS_ERROR_UNEXPECTED);
|
NS_ENSURE_TRUE(nativeKeyEvent, NS_ERROR_UNEXPECTED);
|
||||||
NS_ASSERTION(nativeKeyEvent->message == NS_KEY_PRESS,
|
NS_ASSERTION(nativeKeyEvent->mMessage == NS_KEY_PRESS,
|
||||||
"HandleKeyPressEvent gets non-keypress event");
|
"HandleKeyPressEvent gets non-keypress event");
|
||||||
|
|
||||||
switch (nativeKeyEvent->keyCode) {
|
switch (nativeKeyEvent->keyCode) {
|
||||||
|
|
|
@ -362,7 +362,7 @@ nsPlaintextEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
|
||||||
WidgetKeyboardEvent* nativeKeyEvent =
|
WidgetKeyboardEvent* nativeKeyEvent =
|
||||||
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
|
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
|
||||||
NS_ENSURE_TRUE(nativeKeyEvent, NS_ERROR_UNEXPECTED);
|
NS_ENSURE_TRUE(nativeKeyEvent, NS_ERROR_UNEXPECTED);
|
||||||
NS_ASSERTION(nativeKeyEvent->message == NS_KEY_PRESS,
|
NS_ASSERTION(nativeKeyEvent->mMessage == NS_KEY_PRESS,
|
||||||
"HandleKeyPressEvent gets non-keypress event");
|
"HandleKeyPressEvent gets non-keypress event");
|
||||||
|
|
||||||
switch (nativeKeyEvent->keyCode) {
|
switch (nativeKeyEvent->keyCode) {
|
||||||
|
@ -845,7 +845,7 @@ nsPlaintextEditor::UpdateIMEComposition(nsIDOMEvent* aDOMTextEvent)
|
||||||
WidgetCompositionEvent* compositionChangeEvent =
|
WidgetCompositionEvent* compositionChangeEvent =
|
||||||
aDOMTextEvent->GetInternalNSEvent()->AsCompositionEvent();
|
aDOMTextEvent->GetInternalNSEvent()->AsCompositionEvent();
|
||||||
NS_ENSURE_TRUE(compositionChangeEvent, NS_ERROR_INVALID_ARG);
|
NS_ENSURE_TRUE(compositionChangeEvent, NS_ERROR_INVALID_ARG);
|
||||||
MOZ_ASSERT(compositionChangeEvent->message == NS_COMPOSITION_CHANGE,
|
MOZ_ASSERT(compositionChangeEvent->mMessage == NS_COMPOSITION_CHANGE,
|
||||||
"The internal event should be NS_COMPOSITION_CHANGE");
|
"The internal event should be NS_COMPOSITION_CHANGE");
|
||||||
|
|
||||||
EnsureComposition(compositionChangeEvent);
|
EnsureComposition(compositionChangeEvent);
|
||||||
|
|
|
@ -854,7 +854,7 @@ APZCTreeManager::UpdateWheelTransaction(WidgetInputEvent& aEvent)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (aEvent.message) {
|
switch (aEvent.mMessage) {
|
||||||
case NS_MOUSE_MOVE:
|
case NS_MOUSE_MOVE:
|
||||||
case NS_DRAGDROP_OVER: {
|
case NS_DRAGDROP_OVER: {
|
||||||
WidgetMouseEvent* mouseEvent = aEvent.AsMouseEvent();
|
WidgetMouseEvent* mouseEvent = aEvent.AsMouseEvent();
|
||||||
|
|
|
@ -251,14 +251,14 @@ APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent,
|
||||||
uint64_t aInputBlockId,
|
uint64_t aInputBlockId,
|
||||||
nsEventStatus aApzResponse)
|
nsEventStatus aApzResponse)
|
||||||
{
|
{
|
||||||
if (aEvent.message == NS_TOUCH_START && aEvent.touches.Length() > 0) {
|
if (aEvent.mMessage == NS_TOUCH_START && aEvent.touches.Length() > 0) {
|
||||||
mActiveElementManager->SetTargetElement(aEvent.touches[0]->GetTarget());
|
mActiveElementManager->SetTargetElement(aEvent.touches[0]->GetTarget());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isTouchPrevented = TouchManager::gPreventMouseEvents ||
|
bool isTouchPrevented = TouchManager::gPreventMouseEvents ||
|
||||||
aEvent.mFlags.mMultipleActionsPrevented;
|
aEvent.mFlags.mMultipleActionsPrevented;
|
||||||
bool sentContentResponse = false;
|
bool sentContentResponse = false;
|
||||||
switch (aEvent.message) {
|
switch (aEvent.mMessage) {
|
||||||
case NS_TOUCH_START: {
|
case NS_TOUCH_START: {
|
||||||
mTouchEndCancelled = false;
|
mTouchEndCancelled = false;
|
||||||
if (mPendingTouchPreventedResponse) {
|
if (mPendingTouchPreventedResponse) {
|
||||||
|
@ -305,8 +305,8 @@ APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent,
|
||||||
aApzResponse == nsEventStatus_eConsumeDoDefault &&
|
aApzResponse == nsEventStatus_eConsumeDoDefault &&
|
||||||
gfxPrefs::PointerEventsEnabled()) {
|
gfxPrefs::PointerEventsEnabled()) {
|
||||||
WidgetTouchEvent cancelEvent(aEvent);
|
WidgetTouchEvent cancelEvent(aEvent);
|
||||||
cancelEvent.message = NS_TOUCH_CANCEL;
|
cancelEvent.mMessage = NS_TOUCH_CANCEL;
|
||||||
cancelEvent.mFlags.mCancelable = false; // message != NS_TOUCH_CANCEL;
|
cancelEvent.mFlags.mCancelable = false; // mMessage != NS_TOUCH_CANCEL;
|
||||||
for (uint32_t i = 0; i < cancelEvent.touches.Length(); ++i) {
|
for (uint32_t i = 0; i < cancelEvent.touches.Length(); ++i) {
|
||||||
if (mozilla::dom::Touch* touch = cancelEvent.touches[i]) {
|
if (mozilla::dom::Touch* touch = cancelEvent.touches[i]) {
|
||||||
touch->convertToPointer = true;
|
touch->convertToPointer = true;
|
||||||
|
|
|
@ -500,7 +500,7 @@ AccessibleCaretEventHub::HandleMouseEvent(WidgetMouseEvent* aEvent)
|
||||||
kDefaultTouchId : mActiveTouchId);
|
kDefaultTouchId : mActiveTouchId);
|
||||||
nsPoint point = GetMouseEventPosition(aEvent);
|
nsPoint point = GetMouseEventPosition(aEvent);
|
||||||
|
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_MOUSE_BUTTON_DOWN:
|
case NS_MOUSE_BUTTON_DOWN:
|
||||||
AC_LOGV("Before NS_MOUSE_BUTTON_DOWN, state: %s", mState->Name());
|
AC_LOGV("Before NS_MOUSE_BUTTON_DOWN, state: %s", mState->Name());
|
||||||
rv = mState->OnPress(this, point, id);
|
rv = mState->OnPress(this, point, id);
|
||||||
|
@ -538,7 +538,7 @@ AccessibleCaretEventHub::HandleMouseEvent(WidgetMouseEvent* aEvent)
|
||||||
nsEventStatus
|
nsEventStatus
|
||||||
AccessibleCaretEventHub::HandleWheelEvent(WidgetWheelEvent* aEvent)
|
AccessibleCaretEventHub::HandleWheelEvent(WidgetWheelEvent* aEvent)
|
||||||
{
|
{
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_WHEEL_WHEEL:
|
case NS_WHEEL_WHEEL:
|
||||||
AC_LOGV("NS_WHEEL_WHEEL, isMomentum %d, state: %s", aEvent->isMomentum,
|
AC_LOGV("NS_WHEEL_WHEEL, isMomentum %d, state: %s", aEvent->isMomentum,
|
||||||
mState->Name());
|
mState->Name());
|
||||||
|
@ -573,7 +573,7 @@ AccessibleCaretEventHub::HandleTouchEvent(WidgetTouchEvent* aEvent)
|
||||||
aEvent->touches[0]->Identifier() : mActiveTouchId);
|
aEvent->touches[0]->Identifier() : mActiveTouchId);
|
||||||
nsPoint point = GetTouchEventPosition(aEvent, id);
|
nsPoint point = GetTouchEventPosition(aEvent, id);
|
||||||
|
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_TOUCH_START:
|
case NS_TOUCH_START:
|
||||||
AC_LOGV("Before NS_TOUCH_START, state: %s", mState->Name());
|
AC_LOGV("Before NS_TOUCH_START, state: %s", mState->Name());
|
||||||
rv = mState->OnPress(this, point, id);
|
rv = mState->OnPress(this, point, id);
|
||||||
|
@ -609,7 +609,7 @@ AccessibleCaretEventHub::HandleTouchEvent(WidgetTouchEvent* aEvent)
|
||||||
nsEventStatus
|
nsEventStatus
|
||||||
AccessibleCaretEventHub::HandleKeyboardEvent(WidgetKeyboardEvent* aEvent)
|
AccessibleCaretEventHub::HandleKeyboardEvent(WidgetKeyboardEvent* aEvent)
|
||||||
{
|
{
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_KEY_UP:
|
case NS_KEY_UP:
|
||||||
case NS_KEY_DOWN:
|
case NS_KEY_DOWN:
|
||||||
case NS_KEY_PRESS:
|
case NS_KEY_PRESS:
|
||||||
|
|
|
@ -204,11 +204,11 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent)
|
||||||
nsPoint ptInRoot =
|
nsPoint ptInRoot =
|
||||||
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, movePoint, rootFrame);
|
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, movePoint, rootFrame);
|
||||||
|
|
||||||
if (aEvent->message == NS_TOUCH_START ||
|
if (aEvent->mMessage == NS_TOUCH_START ||
|
||||||
(aEvent->message == NS_MOUSE_BUTTON_DOWN &&
|
(aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
|
||||||
mouseEvent->button == WidgetMouseEvent::eLeftButton)) {
|
mouseEvent->button == WidgetMouseEvent::eLeftButton)) {
|
||||||
// If having a active touch, ignore other touch down event
|
// If having a active touch, ignore other touch down event
|
||||||
if (aEvent->message == NS_TOUCH_START && mActiveTouchId >= 0) {
|
if (aEvent->mMessage == NS_TOUCH_START && mActiveTouchId >= 0) {
|
||||||
return nsEventStatus_eConsumeNoDefault;
|
return nsEventStatus_eConsumeNoDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,9 +231,9 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent)
|
||||||
mActiveTouchId = -1;
|
mActiveTouchId = -1;
|
||||||
LaunchLongTapDetector();
|
LaunchLongTapDetector();
|
||||||
}
|
}
|
||||||
} else if (aEvent->message == NS_TOUCH_END ||
|
} else if (aEvent->mMessage == NS_TOUCH_END ||
|
||||||
aEvent->message == NS_TOUCH_CANCEL ||
|
aEvent->mMessage == NS_TOUCH_CANCEL ||
|
||||||
aEvent->message == NS_MOUSE_BUTTON_UP) {
|
aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
|
||||||
CancelLongTapDetector();
|
CancelLongTapDetector();
|
||||||
if (mDragMode != NONE) {
|
if (mDragMode != NONE) {
|
||||||
// Only care about same id
|
// Only care about same id
|
||||||
|
@ -244,8 +244,8 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent)
|
||||||
}
|
}
|
||||||
return nsEventStatus_eConsumeNoDefault;
|
return nsEventStatus_eConsumeNoDefault;
|
||||||
}
|
}
|
||||||
} else if (aEvent->message == NS_TOUCH_MOVE ||
|
} else if (aEvent->mMessage == NS_TOUCH_MOVE ||
|
||||||
aEvent->message == NS_MOUSE_MOVE) {
|
aEvent->mMessage == NS_MOUSE_MOVE) {
|
||||||
if (mDragMode == START_FRAME || mDragMode == END_FRAME) {
|
if (mDragMode == START_FRAME || mDragMode == END_FRAME) {
|
||||||
if (mActiveTouchId == nowTouchId) {
|
if (mActiveTouchId == nowTouchId) {
|
||||||
ptInRoot.y += mCaretCenterToDownPointOffsetY;
|
ptInRoot.y += mCaretCenterToDownPointOffsetY;
|
||||||
|
@ -271,7 +271,7 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent)
|
||||||
CancelLongTapDetector();
|
CancelLongTapDetector();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (aEvent->message == NS_MOUSE_MOZLONGTAP) {
|
} else if (aEvent->mMessage == NS_MOUSE_MOZLONGTAP) {
|
||||||
if (!mVisible || !sSelectionCaretDetectsLongTap) {
|
if (!mVisible || !sSelectionCaretDetectsLongTap) {
|
||||||
SELECTIONCARETS_LOG("SelectWord from NS_MOUSE_MOZLONGTAP");
|
SELECTIONCARETS_LOG("SelectWord from NS_MOUSE_MOZLONGTAP");
|
||||||
|
|
||||||
|
|
|
@ -759,7 +759,7 @@ TouchCaret::HandleEvent(WidgetEvent* aEvent)
|
||||||
|
|
||||||
nsEventStatus status = nsEventStatus_eIgnore;
|
nsEventStatus status = nsEventStatus_eIgnore;
|
||||||
|
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_TOUCH_START:
|
case NS_TOUCH_START:
|
||||||
status = HandleTouchDownEvent(aEvent->AsTouchEvent());
|
status = HandleTouchDownEvent(aEvent->AsTouchEvent());
|
||||||
break;
|
break;
|
||||||
|
@ -790,7 +790,7 @@ TouchCaret::HandleEvent(WidgetEvent* aEvent)
|
||||||
case NS_WHEEL_START:
|
case NS_WHEEL_START:
|
||||||
case NS_WHEEL_STOP:
|
case NS_WHEEL_STOP:
|
||||||
// Disable touch caret while key/wheel event is received.
|
// Disable touch caret while key/wheel event is received.
|
||||||
TOUCHCARET_LOG("Receive key/wheel event %d", aEvent->message);
|
TOUCHCARET_LOG("Receive key/wheel event %d", aEvent->mMessage);
|
||||||
SetVisibility(false);
|
SetVisibility(false);
|
||||||
break;
|
break;
|
||||||
case NS_MOUSE_MOZLONGTAP:
|
case NS_MOUSE_MOZLONGTAP:
|
||||||
|
|
|
@ -101,7 +101,7 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent,
|
||||||
bool& aIsHandlingUserInput,
|
bool& aIsHandlingUserInput,
|
||||||
nsCOMPtr<nsIContent>& aCurrentEventContent)
|
nsCOMPtr<nsIContent>& aCurrentEventContent)
|
||||||
{
|
{
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_TOUCH_START: {
|
case NS_TOUCH_START: {
|
||||||
aIsHandlingUserInput = true;
|
aIsHandlingUserInput = true;
|
||||||
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
|
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
|
||||||
|
@ -123,7 +123,7 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent,
|
||||||
// If it is not already in the queue, it is a new touch
|
// If it is not already in the queue, it is a new touch
|
||||||
touch->mChanged = true;
|
touch->mChanged = true;
|
||||||
}
|
}
|
||||||
touch->mMessage = aEvent->message;
|
touch->mMessage = aEvent->mMessage;
|
||||||
gCaptureTouchList->Put(id, touch);
|
gCaptureTouchList->Put(id, touch);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -140,7 +140,7 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int32_t id = touch->Identifier();
|
int32_t id = touch->Identifier();
|
||||||
touch->mMessage = aEvent->message;
|
touch->mMessage = aEvent->mMessage;
|
||||||
|
|
||||||
nsRefPtr<dom::Touch> oldTouch = gCaptureTouchList->GetWeak(id);
|
nsRefPtr<dom::Touch> oldTouch = gCaptureTouchList->GetWeak(id);
|
||||||
if (!oldTouch) {
|
if (!oldTouch) {
|
||||||
|
@ -203,7 +203,7 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent,
|
||||||
if (!touch) {
|
if (!touch) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
touch->mMessage = aEvent->message;
|
touch->mMessage = aEvent->mMessage;
|
||||||
touch->mChanged = true;
|
touch->mChanged = true;
|
||||||
|
|
||||||
int32_t id = touch->Identifier();
|
int32_t id = touch->Identifier();
|
||||||
|
|
|
@ -467,15 +467,15 @@ public:
|
||||||
virtual void HandleEvent(EventChainPostVisitor& aVisitor) override
|
virtual void HandleEvent(EventChainPostVisitor& aVisitor) override
|
||||||
{
|
{
|
||||||
if (aVisitor.mPresContext && aVisitor.mEvent->mClass != eBasicEventClass) {
|
if (aVisitor.mPresContext && aVisitor.mEvent->mClass != eBasicEventClass) {
|
||||||
if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_DOWN ||
|
if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
|
||||||
aVisitor.mEvent->message == NS_MOUSE_BUTTON_UP) {
|
aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP) {
|
||||||
// Mouse-up and mouse-down events call nsFrame::HandlePress/Release
|
// Mouse-up and mouse-down events call nsFrame::HandlePress/Release
|
||||||
// which call GetContentOffsetsFromPoint which requires up-to-date layout.
|
// which call GetContentOffsetsFromPoint which requires up-to-date layout.
|
||||||
// Bring layout up-to-date now so that GetCurrentEventFrame() below
|
// Bring layout up-to-date now so that GetCurrentEventFrame() below
|
||||||
// will return a real frame and we don't have to worry about
|
// will return a real frame and we don't have to worry about
|
||||||
// destroying it by flushing later.
|
// destroying it by flushing later.
|
||||||
mPresShell->FlushPendingNotifications(Flush_Layout);
|
mPresShell->FlushPendingNotifications(Flush_Layout);
|
||||||
} else if (aVisitor.mEvent->message == NS_WHEEL_WHEEL &&
|
} else if (aVisitor.mEvent->mMessage == NS_WHEEL_WHEEL &&
|
||||||
aVisitor.mEventStatus != nsEventStatus_eConsumeNoDefault) {
|
aVisitor.mEventStatus != nsEventStatus_eConsumeNoDefault) {
|
||||||
nsIFrame* frame = mPresShell->GetCurrentEventFrame();
|
nsIFrame* frame = mPresShell->GetCurrentEventFrame();
|
||||||
if (frame) {
|
if (frame) {
|
||||||
|
@ -492,8 +492,8 @@ public:
|
||||||
}
|
}
|
||||||
nsIFrame* frame = mPresShell->GetCurrentEventFrame();
|
nsIFrame* frame = mPresShell->GetCurrentEventFrame();
|
||||||
if (!frame &&
|
if (!frame &&
|
||||||
(aVisitor.mEvent->message == NS_MOUSE_BUTTON_UP ||
|
(aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP ||
|
||||||
aVisitor.mEvent->message == NS_TOUCH_END)) {
|
aVisitor.mEvent->mMessage == NS_TOUCH_END)) {
|
||||||
// Redirect BUTTON_UP and TOUCH_END events to the root frame to ensure
|
// Redirect BUTTON_UP and TOUCH_END events to the root frame to ensure
|
||||||
// that capturing is released.
|
// that capturing is released.
|
||||||
frame = mPresShell->GetRootFrame();
|
frame = mPresShell->GetRootFrame();
|
||||||
|
@ -6342,7 +6342,7 @@ nsIPresShell::GetPointerInfo(uint32_t aPointerId, bool& aActiveState)
|
||||||
void
|
void
|
||||||
PresShell::UpdateActivePointerState(WidgetGUIEvent* aEvent)
|
PresShell::UpdateActivePointerState(WidgetGUIEvent* aEvent)
|
||||||
{
|
{
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_MOUSE_ENTER_WIDGET:
|
case NS_MOUSE_ENTER_WIDGET:
|
||||||
// In this case we have to know information about available mouse pointers
|
// In this case we have to know information about available mouse pointers
|
||||||
if (WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent()) {
|
if (WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent()) {
|
||||||
|
@ -6562,11 +6562,11 @@ PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((aEvent->message == NS_MOUSE_MOVE &&
|
if ((aEvent->mMessage == NS_MOUSE_MOVE &&
|
||||||
aEvent->AsMouseEvent()->reason == WidgetMouseEvent::eReal) ||
|
aEvent->AsMouseEvent()->reason == WidgetMouseEvent::eReal) ||
|
||||||
aEvent->message == NS_MOUSE_ENTER_WIDGET ||
|
aEvent->mMessage == NS_MOUSE_ENTER_WIDGET ||
|
||||||
aEvent->message == NS_MOUSE_BUTTON_DOWN ||
|
aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
|
||||||
aEvent->message == NS_MOUSE_BUTTON_UP) {
|
aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
|
||||||
nsIFrame* rootFrame = GetRootFrame();
|
nsIFrame* rootFrame = GetRootFrame();
|
||||||
if (!rootFrame) {
|
if (!rootFrame) {
|
||||||
nsView* rootView = mViewManager->GetRootView();
|
nsView* rootView = mViewManager->GetRootView();
|
||||||
|
@ -6577,15 +6577,17 @@ PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent)
|
||||||
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, rootFrame);
|
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, rootFrame);
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_MOUSE_LOCATION
|
#ifdef DEBUG_MOUSE_LOCATION
|
||||||
if (aEvent->message == NS_MOUSE_ENTER_WIDGET)
|
if (aEvent->mMessage == NS_MOUSE_ENTER_WIDGET) {
|
||||||
printf("[ps=%p]got mouse enter for %p\n",
|
printf("[ps=%p]got mouse enter for %p\n",
|
||||||
this, aEvent->widget);
|
this, aEvent->widget);
|
||||||
|
}
|
||||||
printf("[ps=%p]setting mouse location to (%d,%d)\n",
|
printf("[ps=%p]setting mouse location to (%d,%d)\n",
|
||||||
this, mMouseLocation.x, mMouseLocation.y);
|
this, mMouseLocation.x, mMouseLocation.y);
|
||||||
#endif
|
#endif
|
||||||
if (aEvent->message == NS_MOUSE_ENTER_WIDGET)
|
if (aEvent->mMessage == NS_MOUSE_ENTER_WIDGET) {
|
||||||
SynthesizeMouseMove(false);
|
SynthesizeMouseMove(false);
|
||||||
} else if (aEvent->message == NS_MOUSE_EXIT_WIDGET) {
|
}
|
||||||
|
} else if (aEvent->mMessage == NS_MOUSE_EXIT_WIDGET) {
|
||||||
// Although we only care about the mouse moving into an area for which this
|
// Although we only care about the mouse moving into an area for which this
|
||||||
// pres shell doesn't receive mouse move events, we don't check which widget
|
// pres shell doesn't receive mouse move events, we don't check which widget
|
||||||
// the mouse exit was for since this seems to vary by platform. Hopefully
|
// the mouse exit was for since this seems to vary by platform. Hopefully
|
||||||
|
@ -6662,7 +6664,7 @@ DispatchPointerFromMouseOrTouch(PresShell* aShell,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
int16_t button = mouseEvent->button;
|
int16_t button = mouseEvent->button;
|
||||||
switch (mouseEvent->message) {
|
switch (mouseEvent->mMessage) {
|
||||||
case NS_MOUSE_MOVE:
|
case NS_MOUSE_MOVE:
|
||||||
if (mouseEvent->buttons == 0) {
|
if (mouseEvent->buttons == 0) {
|
||||||
button = -1;
|
button = -1;
|
||||||
|
@ -6680,7 +6682,7 @@ DispatchPointerFromMouseOrTouch(PresShell* aShell,
|
||||||
}
|
}
|
||||||
|
|
||||||
WidgetPointerEvent event(*mouseEvent);
|
WidgetPointerEvent event(*mouseEvent);
|
||||||
event.message = pointerMessage;
|
event.mMessage = pointerMessage;
|
||||||
event.button = button;
|
event.button = button;
|
||||||
event.pressure = event.buttons ?
|
event.pressure = event.buttons ?
|
||||||
mouseEvent->pressure ? mouseEvent->pressure : 0.5f :
|
mouseEvent->pressure ? mouseEvent->pressure : 0.5f :
|
||||||
|
@ -6691,7 +6693,7 @@ DispatchPointerFromMouseOrTouch(PresShell* aShell,
|
||||||
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
|
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
|
||||||
// loop over all touches and dispatch pointer events on each touch
|
// loop over all touches and dispatch pointer events on each touch
|
||||||
// copy the event
|
// copy the event
|
||||||
switch (touchEvent->message) {
|
switch (touchEvent->mMessage) {
|
||||||
case NS_TOUCH_MOVE:
|
case NS_TOUCH_MOVE:
|
||||||
pointerMessage = NS_POINTER_MOVE;
|
pointerMessage = NS_POINTER_MOVE;
|
||||||
break;
|
break;
|
||||||
|
@ -6840,7 +6842,7 @@ PresShell::DispatchBeforeKeyboardEventInternal(const nsTArray<nsCOMPtr<Element>
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t message =
|
uint32_t message =
|
||||||
(aEvent.message == NS_KEY_DOWN) ? NS_KEY_BEFORE_DOWN : NS_KEY_BEFORE_UP;
|
(aEvent.mMessage == NS_KEY_DOWN) ? NS_KEY_BEFORE_DOWN : NS_KEY_BEFORE_UP;
|
||||||
nsCOMPtr<EventTarget> eventTarget;
|
nsCOMPtr<EventTarget> eventTarget;
|
||||||
// Dispatch before events from the outermost element.
|
// Dispatch before events from the outermost element.
|
||||||
for (int32_t i = length - 1; i >= 0; i--) {
|
for (int32_t i = length - 1; i >= 0; i--) {
|
||||||
|
@ -6874,7 +6876,7 @@ PresShell::DispatchAfterKeyboardEventInternal(const nsTArray<nsCOMPtr<Element> >
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t message =
|
uint32_t message =
|
||||||
(aEvent.message == NS_KEY_DOWN) ? NS_KEY_AFTER_DOWN : NS_KEY_AFTER_UP;
|
(aEvent.mMessage == NS_KEY_DOWN) ? NS_KEY_AFTER_DOWN : NS_KEY_AFTER_UP;
|
||||||
bool embeddedCancelled = aEmbeddedCancelled;
|
bool embeddedCancelled = aEmbeddedCancelled;
|
||||||
nsCOMPtr<EventTarget> eventTarget;
|
nsCOMPtr<EventTarget> eventTarget;
|
||||||
// Dispatch after events from the innermost element.
|
// Dispatch after events from the innermost element.
|
||||||
|
@ -6901,8 +6903,8 @@ PresShell::DispatchAfterKeyboardEvent(nsINode* aTarget,
|
||||||
MOZ_ASSERT(aTarget);
|
MOZ_ASSERT(aTarget);
|
||||||
MOZ_ASSERT(BeforeAfterKeyboardEventEnabled());
|
MOZ_ASSERT(BeforeAfterKeyboardEventEnabled());
|
||||||
|
|
||||||
if (NS_WARN_IF(aEvent.message != NS_KEY_DOWN &&
|
if (NS_WARN_IF(aEvent.mMessage != NS_KEY_DOWN &&
|
||||||
aEvent.message != NS_KEY_UP)) {
|
aEvent.mMessage != NS_KEY_UP)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6931,7 +6933,7 @@ PresShell::HandleKeyboardEvent(nsINode* aTarget,
|
||||||
nsEventStatus* aStatus,
|
nsEventStatus* aStatus,
|
||||||
EventDispatchingCallback* aEventCB)
|
EventDispatchingCallback* aEventCB)
|
||||||
{
|
{
|
||||||
if (aEvent.message == NS_KEY_PRESS ||
|
if (aEvent.mMessage == NS_KEY_PRESS ||
|
||||||
!BeforeAfterKeyboardEventEnabled()) {
|
!BeforeAfterKeyboardEventEnabled()) {
|
||||||
EventDispatcher::Dispatch(aTarget, mPresContext,
|
EventDispatcher::Dispatch(aTarget, mPresContext,
|
||||||
&aEvent, nullptr, aStatus, aEventCB);
|
&aEvent, nullptr, aStatus, aEventCB);
|
||||||
|
@ -6939,7 +6941,7 @@ PresShell::HandleKeyboardEvent(nsINode* aTarget,
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(aTarget);
|
MOZ_ASSERT(aTarget);
|
||||||
MOZ_ASSERT(aEvent.message == NS_KEY_DOWN || aEvent.message == NS_KEY_UP);
|
MOZ_ASSERT(aEvent.mMessage == NS_KEY_DOWN || aEvent.mMessage == NS_KEY_UP);
|
||||||
|
|
||||||
// Build up a target chain. Each item in the chain will receive a before event.
|
// Build up a target chain. Each item in the chain will receive a before event.
|
||||||
nsAutoTArray<nsCOMPtr<Element>, 5> chain;
|
nsAutoTArray<nsCOMPtr<Element>, 5> chain;
|
||||||
|
@ -7120,7 +7122,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (aEvent->IsIMERelatedEvent()) {
|
if (aEvent->IsIMERelatedEvent()) {
|
||||||
nsPrintfCString warning("%d event is discarded", aEvent->message);
|
nsPrintfCString warning("%d event is discarded", aEvent->mMessage);
|
||||||
NS_WARNING(warning.get());
|
NS_WARNING(warning.get());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -7175,7 +7177,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||||
if (presShell != this) {
|
if (presShell != this) {
|
||||||
nsIFrame* frame = presShell->GetRootFrame();
|
nsIFrame* frame = presShell->GetRootFrame();
|
||||||
if (!frame) {
|
if (!frame) {
|
||||||
if (aEvent->message == NS_QUERY_TEXT_CONTENT ||
|
if (aEvent->mMessage == NS_QUERY_TEXT_CONTENT ||
|
||||||
aEvent->IsContentCommandEvent()) {
|
aEvent->IsContentCommandEvent()) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -7194,7 +7196,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||||
|
|
||||||
if (aEvent->mClass == eKeyboardEventClass &&
|
if (aEvent->mClass == eKeyboardEventClass &&
|
||||||
mDocument && mDocument->EventHandlingSuppressed()) {
|
mDocument && mDocument->EventHandlingSuppressed()) {
|
||||||
if (aEvent->message == NS_KEY_DOWN) {
|
if (aEvent->mMessage == NS_KEY_DOWN) {
|
||||||
mNoDelayedKeyEvents = true;
|
mNoDelayedKeyEvents = true;
|
||||||
} else if (!mNoDelayedKeyEvents) {
|
} else if (!mNoDelayedKeyEvents) {
|
||||||
DelayedEvent* event = new DelayedKeyEvent(aEvent->AsKeyboardEvent());
|
DelayedEvent* event = new DelayedKeyEvent(aEvent->AsKeyboardEvent());
|
||||||
|
@ -7302,12 +7304,12 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||||
|
|
||||||
// all touch events except for touchstart use a captured target
|
// all touch events except for touchstart use a captured target
|
||||||
if (aEvent->mClass == eTouchEventClass &&
|
if (aEvent->mClass == eTouchEventClass &&
|
||||||
aEvent->message != NS_TOUCH_START) {
|
aEvent->mMessage != NS_TOUCH_START) {
|
||||||
captureRetarget = true;
|
captureRetarget = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
|
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
|
||||||
bool isWindowLevelMouseExit = (aEvent->message == NS_MOUSE_EXIT_WIDGET) &&
|
bool isWindowLevelMouseExit = (aEvent->mMessage == NS_MOUSE_EXIT_WIDGET) &&
|
||||||
(mouseEvent && mouseEvent->exit == WidgetMouseEvent::eTopLevel);
|
(mouseEvent && mouseEvent->exit == WidgetMouseEvent::eTopLevel);
|
||||||
|
|
||||||
// Get the frame at the event point. However, don't do this if we're
|
// Get the frame at the event point. However, don't do this if we're
|
||||||
|
@ -7318,7 +7320,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||||
if (!captureRetarget && !isWindowLevelMouseExit) {
|
if (!captureRetarget && !isWindowLevelMouseExit) {
|
||||||
nsPoint eventPoint;
|
nsPoint eventPoint;
|
||||||
uint32_t flags = 0;
|
uint32_t flags = 0;
|
||||||
if (aEvent->message == NS_TOUCH_START) {
|
if (aEvent->mMessage == NS_TOUCH_START) {
|
||||||
flags |= INPUT_IGNORE_ROOT_SCROLL_FRAME;
|
flags |= INPUT_IGNORE_ROOT_SCROLL_FRAME;
|
||||||
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
|
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
|
||||||
// if this is a continuing session, ensure that all these events are
|
// if this is a continuing session, ensure that all these events are
|
||||||
|
@ -7446,7 +7448,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aEvent->mClass == ePointerEventClass &&
|
if (aEvent->mClass == ePointerEventClass &&
|
||||||
aEvent->message != NS_POINTER_DOWN) {
|
aEvent->mMessage != NS_POINTER_DOWN) {
|
||||||
if (WidgetPointerEvent* pointerEvent = aEvent->AsPointerEvent()) {
|
if (WidgetPointerEvent* pointerEvent = aEvent->AsPointerEvent()) {
|
||||||
uint32_t pointerId = pointerEvent->pointerId;
|
uint32_t pointerId = pointerEvent->pointerId;
|
||||||
nsIContent* pointerCapturingContent = GetPointerCapturingContent(pointerId);
|
nsIContent* pointerCapturingContent = GetPointerCapturingContent(pointerId);
|
||||||
|
@ -7461,8 +7463,8 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||||
frame = capturingFrame;
|
frame = capturingFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pointerEvent->message == NS_POINTER_UP ||
|
if (pointerEvent->mMessage == NS_POINTER_UP ||
|
||||||
pointerEvent->message == NS_POINTER_CANCEL) {
|
pointerEvent->mMessage == NS_POINTER_CANCEL) {
|
||||||
// Implicitly releasing capture for given pointer.
|
// Implicitly releasing capture for given pointer.
|
||||||
// LOST_POINTER_CAPTURE should be send after NS_POINTER_UP or NS_POINTER_CANCEL.
|
// LOST_POINTER_CAPTURE should be send after NS_POINTER_UP or NS_POINTER_CANCEL.
|
||||||
releasePointerCaptureCaller.SetTarget(pointerId, pointerCapturingContent);
|
releasePointerCaptureCaller.SetTarget(pointerId, pointerCapturingContent);
|
||||||
|
@ -7475,9 +7477,10 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||||
// a document which needs events suppressed
|
// a document which needs events suppressed
|
||||||
if (aEvent->mClass == eMouseEventClass &&
|
if (aEvent->mClass == eMouseEventClass &&
|
||||||
frame->PresContext()->Document()->EventHandlingSuppressed()) {
|
frame->PresContext()->Document()->EventHandlingSuppressed()) {
|
||||||
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
|
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
|
||||||
mNoDelayedMouseEvents = true;
|
mNoDelayedMouseEvents = true;
|
||||||
} else if (!mNoDelayedMouseEvents && aEvent->message == NS_MOUSE_BUTTON_UP) {
|
} else if (!mNoDelayedMouseEvents &&
|
||||||
|
aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
|
||||||
DelayedEvent* event = new DelayedMouseEvent(aEvent->AsMouseEvent());
|
DelayedEvent* event = new DelayedMouseEvent(aEvent->AsMouseEvent());
|
||||||
if (!mDelayedEvents.AppendElement(event)) {
|
if (!mDelayedEvents.AppendElement(event)) {
|
||||||
delete event;
|
delete event;
|
||||||
|
@ -7493,7 +7496,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||||
|
|
||||||
PresShell* shell =
|
PresShell* shell =
|
||||||
static_cast<PresShell*>(frame->PresContext()->PresShell());
|
static_cast<PresShell*>(frame->PresContext()->PresShell());
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_TOUCH_MOVE:
|
case NS_TOUCH_MOVE:
|
||||||
case NS_TOUCH_CANCEL:
|
case NS_TOUCH_CANCEL:
|
||||||
case NS_TOUCH_END: {
|
case NS_TOUCH_END: {
|
||||||
|
@ -7623,11 +7626,12 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aEvent->message == NS_KEY_DOWN) {
|
if (aEvent->mMessage == NS_KEY_DOWN) {
|
||||||
NS_IF_RELEASE(gKeyDownTarget);
|
NS_IF_RELEASE(gKeyDownTarget);
|
||||||
NS_IF_ADDREF(gKeyDownTarget = eventTarget);
|
NS_IF_ADDREF(gKeyDownTarget = eventTarget);
|
||||||
}
|
}
|
||||||
else if ((aEvent->message == NS_KEY_PRESS || aEvent->message == NS_KEY_UP) &&
|
else if ((aEvent->mMessage == NS_KEY_PRESS ||
|
||||||
|
aEvent->mMessage == NS_KEY_UP) &&
|
||||||
gKeyDownTarget) {
|
gKeyDownTarget) {
|
||||||
// If a different element is now focused for the keypress/keyup event
|
// If a different element is now focused for the keypress/keyup event
|
||||||
// than what was focused during the keydown event, check if the new
|
// than what was focused during the keydown event, check if the new
|
||||||
|
@ -7643,7 +7647,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aEvent->message == NS_KEY_UP) {
|
if (aEvent->mMessage == NS_KEY_UP) {
|
||||||
NS_RELEASE(gKeyDownTarget);
|
NS_RELEASE(gKeyDownTarget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7831,7 +7835,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
|
||||||
|
|
||||||
// XXX How about IME events and input events for plugins?
|
// XXX How about IME events and input events for plugins?
|
||||||
if (aEvent->mFlags.mIsTrusted) {
|
if (aEvent->mFlags.mIsTrusted) {
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_KEY_PRESS:
|
case NS_KEY_PRESS:
|
||||||
case NS_KEY_DOWN:
|
case NS_KEY_DOWN:
|
||||||
case NS_KEY_UP: {
|
case NS_KEY_UP: {
|
||||||
|
@ -7851,7 +7855,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
|
||||||
// The event listeners in chrome can prevent this ESC behavior by
|
// The event listeners in chrome can prevent this ESC behavior by
|
||||||
// calling prevent default on the preceding keydown/press events.
|
// calling prevent default on the preceding keydown/press events.
|
||||||
if (!mIsLastChromeOnlyEscapeKeyConsumed &&
|
if (!mIsLastChromeOnlyEscapeKeyConsumed &&
|
||||||
aEvent->message == NS_KEY_UP) {
|
aEvent->mMessage == NS_KEY_UP) {
|
||||||
// ESC key released while in DOM fullscreen mode.
|
// ESC key released while in DOM fullscreen mode.
|
||||||
// Fully exit all browser windows and documents from
|
// Fully exit all browser windows and documents from
|
||||||
// fullscreen mode.
|
// fullscreen mode.
|
||||||
|
@ -7863,7 +7867,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
|
||||||
if (!mIsLastChromeOnlyEscapeKeyConsumed && pointerLockedDoc) {
|
if (!mIsLastChromeOnlyEscapeKeyConsumed && pointerLockedDoc) {
|
||||||
aEvent->mFlags.mDefaultPrevented = true;
|
aEvent->mFlags.mDefaultPrevented = true;
|
||||||
aEvent->mFlags.mOnlyChromeDispatch = true;
|
aEvent->mFlags.mOnlyChromeDispatch = true;
|
||||||
if (aEvent->message == NS_KEY_UP) {
|
if (aEvent->mMessage == NS_KEY_UP) {
|
||||||
nsIDocument::UnlockPointer();
|
nsIDocument::UnlockPointer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7902,7 +7906,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aEvent->message == NS_CONTEXTMENU) {
|
if (aEvent->mMessage == NS_CONTEXTMENU) {
|
||||||
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
|
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
|
||||||
if (mouseEvent->context == WidgetMouseEvent::eContextMenuKey &&
|
if (mouseEvent->context == WidgetMouseEvent::eContextMenuKey &&
|
||||||
!AdjustContextMenuKeyEvent(mouseEvent)) {
|
!AdjustContextMenuKeyEvent(mouseEvent)) {
|
||||||
|
@ -7917,7 +7921,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
|
||||||
AutoHandlingUserInputStatePusher userInpStatePusher(isHandlingUserInput,
|
AutoHandlingUserInputStatePusher userInpStatePusher(isHandlingUserInput,
|
||||||
aEvent, mDocument);
|
aEvent, mDocument);
|
||||||
|
|
||||||
if (aEvent->mFlags.mIsTrusted && aEvent->message == NS_MOUSE_MOVE) {
|
if (aEvent->mFlags.mIsTrusted && aEvent->mMessage == NS_MOUSE_MOVE) {
|
||||||
nsIPresShell::AllowMouseCapture(
|
nsIPresShell::AllowMouseCapture(
|
||||||
EventStateManager::GetActiveEventStateManager() == manager);
|
EventStateManager::GetActiveEventStateManager() == manager);
|
||||||
}
|
}
|
||||||
|
@ -7962,12 +7966,12 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_KEY_PRESS:
|
case NS_KEY_PRESS:
|
||||||
case NS_KEY_DOWN:
|
case NS_KEY_DOWN:
|
||||||
case NS_KEY_UP: {
|
case NS_KEY_UP: {
|
||||||
if (aEvent->AsKeyboardEvent()->keyCode == NS_VK_ESCAPE) {
|
if (aEvent->AsKeyboardEvent()->keyCode == NS_VK_ESCAPE) {
|
||||||
if (aEvent->message == NS_KEY_UP) {
|
if (aEvent->mMessage == NS_KEY_UP) {
|
||||||
// Reset this flag after key up is handled.
|
// Reset this flag after key up is handled.
|
||||||
mIsLastChromeOnlyEscapeKeyConsumed = false;
|
mIsLastChromeOnlyEscapeKeyConsumed = false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -8069,9 +8073,9 @@ PresShell::DispatchTouchEventToDOM(WidgetEvent* aEvent,
|
||||||
// calling preventDefault on touchstart or the first touchmove for a
|
// calling preventDefault on touchstart or the first touchmove for a
|
||||||
// point prevents mouse events. calling it on the touchend should
|
// point prevents mouse events. calling it on the touchend should
|
||||||
// prevent click dispatching.
|
// prevent click dispatching.
|
||||||
bool canPrevent = (aEvent->message == NS_TOUCH_START) ||
|
bool canPrevent = (aEvent->mMessage == NS_TOUCH_START) ||
|
||||||
(aEvent->message == NS_TOUCH_MOVE && aTouchIsNew) ||
|
(aEvent->mMessage == NS_TOUCH_MOVE && aTouchIsNew) ||
|
||||||
(aEvent->message == NS_TOUCH_END);
|
(aEvent->mMessage == NS_TOUCH_END);
|
||||||
bool preventDefault = false;
|
bool preventDefault = false;
|
||||||
nsEventStatus tmpStatus = nsEventStatus_eIgnore;
|
nsEventStatus tmpStatus = nsEventStatus_eIgnore;
|
||||||
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
|
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
|
||||||
|
@ -8099,7 +8103,7 @@ PresShell::DispatchTouchEventToDOM(WidgetEvent* aEvent,
|
||||||
}
|
}
|
||||||
// copy the event
|
// copy the event
|
||||||
WidgetTouchEvent newEvent(touchEvent->mFlags.mIsTrusted,
|
WidgetTouchEvent newEvent(touchEvent->mFlags.mIsTrusted,
|
||||||
touchEvent->message, touchEvent->widget);
|
touchEvent->mMessage, touchEvent->widget);
|
||||||
newEvent.AssignTouchEventData(*touchEvent, false);
|
newEvent.AssignTouchEventData(*touchEvent, false);
|
||||||
newEvent.target = targetPtr;
|
newEvent.target = targetPtr;
|
||||||
|
|
||||||
|
@ -9536,7 +9540,7 @@ PresShell::DelayedMouseEvent::DelayedMouseEvent(WidgetMouseEvent* aEvent) :
|
||||||
{
|
{
|
||||||
WidgetMouseEvent* mouseEvent =
|
WidgetMouseEvent* mouseEvent =
|
||||||
new WidgetMouseEvent(aEvent->mFlags.mIsTrusted,
|
new WidgetMouseEvent(aEvent->mFlags.mIsTrusted,
|
||||||
aEvent->message,
|
aEvent->mMessage,
|
||||||
aEvent->widget,
|
aEvent->widget,
|
||||||
aEvent->reason,
|
aEvent->reason,
|
||||||
aEvent->context);
|
aEvent->context);
|
||||||
|
@ -9549,7 +9553,7 @@ PresShell::DelayedKeyEvent::DelayedKeyEvent(WidgetKeyboardEvent* aEvent) :
|
||||||
{
|
{
|
||||||
WidgetKeyboardEvent* keyEvent =
|
WidgetKeyboardEvent* keyEvent =
|
||||||
new WidgetKeyboardEvent(aEvent->mFlags.mIsTrusted,
|
new WidgetKeyboardEvent(aEvent->mFlags.mIsTrusted,
|
||||||
aEvent->message,
|
aEvent->mMessage,
|
||||||
aEvent->widget);
|
aEvent->widget);
|
||||||
keyEvent->AssignKeyEventData(*aEvent, false);
|
keyEvent->AssignKeyEventData(*aEvent, false);
|
||||||
keyEvent->mFlags.mIsSynthesizedForTests = aEvent->mFlags.mIsSynthesizedForTests;
|
keyEvent->mFlags.mIsSynthesizedForTests = aEvent->mFlags.mIsSynthesizedForTests;
|
||||||
|
|
|
@ -1133,7 +1133,7 @@ nsComboboxControlFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
#if COMBOBOX_ROLLUP_CONSUME_EVENT == 0
|
#if COMBOBOX_ROLLUP_CONSUME_EVENT == 0
|
||||||
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
|
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
|
||||||
nsIWidget* widget = GetNearestWidget();
|
nsIWidget* widget = GetNearestWidget();
|
||||||
if (widget && GetContent() == widget->GetLastRollup()) {
|
if (widget && GetContent() == widget->GetLastRollup()) {
|
||||||
// This event did a Rollup on this control - prevent it from opening
|
// This event did a Rollup on this control - prevent it from opening
|
||||||
|
|
|
@ -162,7 +162,7 @@ nsImageControlFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
|
|
||||||
*aEventStatus = nsEventStatus_eIgnore;
|
*aEventStatus = nsEventStatus_eIgnore;
|
||||||
|
|
||||||
if (aEvent->message == NS_MOUSE_BUTTON_UP &&
|
if (aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
|
||||||
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
|
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
|
||||||
// Store click point for HTMLInputElement::SubmitNamesValues
|
// Store click point for HTMLInputElement::SubmitNamesValues
|
||||||
// Do this on MouseUp because the specs don't say and that's what IE does
|
// Do this on MouseUp because the specs don't say and that's what IE does
|
||||||
|
|
|
@ -898,11 +898,11 @@ nsListControlFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
"NS_MOUSE_LEFT_CLICK",
|
"NS_MOUSE_LEFT_CLICK",
|
||||||
"NS_MOUSE_MIDDLE_CLICK",
|
"NS_MOUSE_MIDDLE_CLICK",
|
||||||
"NS_MOUSE_RIGHT_CLICK"};
|
"NS_MOUSE_RIGHT_CLICK"};
|
||||||
int inx = aEvent->message-NS_MOUSE_MESSAGE_START;
|
int inx = aEvent->mMessage-NS_MOUSE_MESSAGE_START;
|
||||||
if (inx >= 0 && inx <= (NS_MOUSE_RIGHT_CLICK-NS_MOUSE_MESSAGE_START)) {
|
if (inx >= 0 && inx <= (NS_MOUSE_RIGHT_CLICK-NS_MOUSE_MESSAGE_START)) {
|
||||||
printf("Mouse in ListFrame %s [%d]\n", desc[inx], aEvent->message);
|
printf("Mouse in ListFrame %s [%d]\n", desc[inx], aEvent->mMessage);
|
||||||
} else {
|
} else {
|
||||||
printf("Mouse in ListFrame <UNKNOWN> [%d]\n", aEvent->message);
|
printf("Mouse in ListFrame <UNKNOWN> [%d]\n", aEvent->mMessage);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if (nsEventStatus_eConsumeNoDefault == *aEventStatus)
|
if (nsEventStatus_eConsumeNoDefault == *aEventStatus)
|
||||||
|
|
|
@ -2558,7 +2558,7 @@ nsFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
nsEventStatus* aEventStatus)
|
nsEventStatus* aEventStatus)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (aEvent->message == NS_MOUSE_MOVE) {
|
if (aEvent->mMessage == NS_MOUSE_MOVE) {
|
||||||
// XXX If the second argument of HandleDrag() is WidgetMouseEvent,
|
// XXX If the second argument of HandleDrag() is WidgetMouseEvent,
|
||||||
// the implementation becomes simpler.
|
// the implementation becomes simpler.
|
||||||
return HandleDrag(aPresContext, aEvent, aEventStatus);
|
return HandleDrag(aPresContext, aEvent, aEventStatus);
|
||||||
|
@ -2567,9 +2567,11 @@ nsFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
if ((aEvent->mClass == eMouseEventClass &&
|
if ((aEvent->mClass == eMouseEventClass &&
|
||||||
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) ||
|
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) ||
|
||||||
aEvent->mClass == eTouchEventClass) {
|
aEvent->mClass == eTouchEventClass) {
|
||||||
if (aEvent->message == NS_MOUSE_BUTTON_DOWN || aEvent->message == NS_TOUCH_START) {
|
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
|
||||||
|
aEvent->mMessage == NS_TOUCH_START) {
|
||||||
HandlePress(aPresContext, aEvent, aEventStatus);
|
HandlePress(aPresContext, aEvent, aEventStatus);
|
||||||
} else if (aEvent->message == NS_MOUSE_BUTTON_UP || aEvent->message == NS_TOUCH_END) {
|
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP ||
|
||||||
|
aEvent->mMessage == NS_TOUCH_END) {
|
||||||
HandleRelease(aPresContext, aEvent, aEventStatus);
|
HandleRelease(aPresContext, aEvent, aEventStatus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2602,8 +2604,8 @@ nsFrame::GetDataForTableSelection(const nsFrameSelection* aFrameSelection,
|
||||||
// (Mouse down does normal selection unless Ctrl/Cmd is pressed)
|
// (Mouse down does normal selection unless Ctrl/Cmd is pressed)
|
||||||
bool doTableSelection =
|
bool doTableSelection =
|
||||||
displaySelection == nsISelectionDisplay::DISPLAY_ALL && selectingTableCells &&
|
displaySelection == nsISelectionDisplay::DISPLAY_ALL && selectingTableCells &&
|
||||||
(aMouseEvent->message == NS_MOUSE_MOVE ||
|
(aMouseEvent->mMessage == NS_MOUSE_MOVE ||
|
||||||
(aMouseEvent->message == NS_MOUSE_BUTTON_UP &&
|
(aMouseEvent->mMessage == NS_MOUSE_BUTTON_UP &&
|
||||||
aMouseEvent->button == WidgetMouseEvent::eLeftButton) ||
|
aMouseEvent->button == WidgetMouseEvent::eLeftButton) ||
|
||||||
aMouseEvent->IsShift());
|
aMouseEvent->IsShift());
|
||||||
|
|
||||||
|
|
|
@ -651,7 +651,7 @@ nsresult nsHTMLFramesetFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
NS_ENSURE_ARG_POINTER(aEventStatus);
|
NS_ENSURE_ARG_POINTER(aEventStatus);
|
||||||
if (mDragger) {
|
if (mDragger) {
|
||||||
// the nsFramesetBorderFrame has captured NS_MOUSE_DOWN
|
// the nsFramesetBorderFrame has captured NS_MOUSE_DOWN
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_MOUSE_MOVE:
|
case NS_MOUSE_MOVE:
|
||||||
MouseDrag(aPresContext, aEvent);
|
MouseDrag(aPresContext, aEvent);
|
||||||
break;
|
break;
|
||||||
|
@ -1537,7 +1537,7 @@ nsHTMLFramesetBorderFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aEvent->message == NS_MOUSE_BUTTON_DOWN &&
|
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
|
||||||
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
|
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
|
||||||
nsHTMLFramesetFrame* parentFrame = do_QueryFrame(GetParent());
|
nsHTMLFramesetFrame* parentFrame = do_QueryFrame(GetParent());
|
||||||
if (parentFrame) {
|
if (parentFrame) {
|
||||||
|
|
|
@ -2010,9 +2010,9 @@ nsImageFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
{
|
{
|
||||||
NS_ENSURE_ARG_POINTER(aEventStatus);
|
NS_ENSURE_ARG_POINTER(aEventStatus);
|
||||||
|
|
||||||
if ((aEvent->message == NS_MOUSE_BUTTON_UP &&
|
if ((aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
|
||||||
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) ||
|
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) ||
|
||||||
aEvent->message == NS_MOUSE_MOVE) {
|
aEvent->mMessage == NS_MOUSE_MOVE) {
|
||||||
nsImageMap* map = GetImageMap();
|
nsImageMap* map = GetImageMap();
|
||||||
bool isServerMap = IsServerImageMap();
|
bool isServerMap = IsServerImageMap();
|
||||||
if ((nullptr != map) || isServerMap) {
|
if ((nullptr != map) || isServerMap) {
|
||||||
|
@ -2050,7 +2050,7 @@ nsImageFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
uri->SetSpec(spec);
|
uri->SetSpec(spec);
|
||||||
|
|
||||||
bool clicked = false;
|
bool clicked = false;
|
||||||
if (aEvent->message == NS_MOUSE_BUTTON_UP) {
|
if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
|
||||||
*aEventStatus = nsEventStatus_eConsumeDoDefault;
|
*aEventStatus = nsEventStatus_eConsumeDoDefault;
|
||||||
clicked = true;
|
clicked = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1761,13 +1761,13 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
|
|
||||||
mInstanceOwner->ConsiderNewEventloopNestingLevel();
|
mInstanceOwner->ConsiderNewEventloopNestingLevel();
|
||||||
|
|
||||||
if (anEvent->message == NS_PLUGIN_ACTIVATE) {
|
if (anEvent->mMessage == NS_PLUGIN_ACTIVATE) {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
nsCOMPtr<nsIDOMElement> elem = do_QueryInterface(GetContent());
|
nsCOMPtr<nsIDOMElement> elem = do_QueryInterface(GetContent());
|
||||||
if (fm && elem)
|
if (fm && elem)
|
||||||
return fm->SetFocus(elem, 0);
|
return fm->SetFocus(elem, 0);
|
||||||
}
|
}
|
||||||
else if (anEvent->message == NS_PLUGIN_FOCUS) {
|
else if (anEvent->mMessage == NS_PLUGIN_FOCUS) {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm)
|
if (fm)
|
||||||
return fm->FocusPlugin(GetContent());
|
return fm->FocusPlugin(GetContent());
|
||||||
|
@ -1788,8 +1788,8 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
|
|
||||||
#ifdef XP_MACOSX
|
#ifdef XP_MACOSX
|
||||||
// we want to process some native mouse events in the cocoa event model
|
// we want to process some native mouse events in the cocoa event model
|
||||||
if ((anEvent->message == NS_MOUSE_ENTER_WIDGET ||
|
if ((anEvent->mMessage == NS_MOUSE_ENTER_WIDGET ||
|
||||||
anEvent->message == NS_WHEEL_WHEEL) &&
|
anEvent->mMessage == NS_WHEEL_WHEEL) &&
|
||||||
mInstanceOwner->GetEventModel() == NPEventModelCocoa) {
|
mInstanceOwner->GetEventModel() == NPEventModelCocoa) {
|
||||||
*anEventStatus = mInstanceOwner->ProcessEvent(*anEvent);
|
*anEventStatus = mInstanceOwner->ProcessEvent(*anEvent);
|
||||||
// Due to plugin code reentering Gecko, this frame may be dead at this
|
// Due to plugin code reentering Gecko, this frame may be dead at this
|
||||||
|
@ -1801,7 +1801,7 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
// and mouse-up) are needed to make the routing of mouse events while
|
// and mouse-up) are needed to make the routing of mouse events while
|
||||||
// dragging conform to standard OS X practice, and to the Cocoa NPAPI spec.
|
// dragging conform to standard OS X practice, and to the Cocoa NPAPI spec.
|
||||||
// See bug 525078 and bug 909678.
|
// See bug 525078 and bug 909678.
|
||||||
if (anEvent->message == NS_MOUSE_BUTTON_DOWN) {
|
if (anEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
|
||||||
nsIPresShell::SetCapturingContent(GetContent(), CAPTURE_IGNOREALLOWED);
|
nsIPresShell::SetCapturingContent(GetContent(), CAPTURE_IGNOREALLOWED);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1812,7 +1812,7 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
// nsPluginFrameSuper::HandleEvent() might have killed us.
|
// nsPluginFrameSuper::HandleEvent() might have killed us.
|
||||||
|
|
||||||
#ifdef XP_MACOSX
|
#ifdef XP_MACOSX
|
||||||
if (anEvent->message == NS_MOUSE_BUTTON_UP) {
|
if (anEvent->mMessage == NS_MOUSE_BUTTON_UP) {
|
||||||
nsIPresShell::SetCapturingContent(nullptr, 0);
|
nsIPresShell::SetCapturingContent(nullptr, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -118,7 +118,7 @@ GetActionForEvent(nsIDOMEvent* aEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keyEvent->mFlags.mInSystemGroup) {
|
if (keyEvent->mFlags.mInSystemGroup) {
|
||||||
NS_ASSERTION(keyEvent->message == NS_KEY_DOWN,
|
NS_ASSERTION(keyEvent->mMessage == NS_KEY_DOWN,
|
||||||
"Assuming we're listening only keydown event in system group");
|
"Assuming we're listening only keydown event in system group");
|
||||||
return eEventAction_StopPropagation;
|
return eEventAction_StopPropagation;
|
||||||
}
|
}
|
||||||
|
@ -126,8 +126,8 @@ GetActionForEvent(nsIDOMEvent* aEvent)
|
||||||
if (keyEvent->IsAlt() || keyEvent->IsControl() || keyEvent->IsMeta()) {
|
if (keyEvent->IsAlt() || keyEvent->IsControl() || keyEvent->IsMeta()) {
|
||||||
// Don't consume keydown event because following keypress event may be
|
// Don't consume keydown event because following keypress event may be
|
||||||
// handled as access key or shortcut key.
|
// handled as access key or shortcut key.
|
||||||
return (keyEvent->message == NS_KEY_DOWN) ? eEventAction_StopPropagation :
|
return (keyEvent->mMessage == NS_KEY_DOWN) ? eEventAction_StopPropagation :
|
||||||
eEventAction_Suppress;
|
eEventAction_Suppress;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const uint32_t kOKKeyCodes[] = {
|
static const uint32_t kOKKeyCodes[] = {
|
||||||
|
|
|
@ -44,7 +44,8 @@ struct AnimationEventInfo {
|
||||||
// InternalAnimationEvent doesn't support copy-construction, so we need
|
// InternalAnimationEvent doesn't support copy-construction, so we need
|
||||||
// to ourselves in order to work with nsTArray
|
// to ourselves in order to work with nsTArray
|
||||||
AnimationEventInfo(const AnimationEventInfo &aOther)
|
AnimationEventInfo(const AnimationEventInfo &aOther)
|
||||||
: mElement(aOther.mElement), mEvent(true, aOther.mEvent.message)
|
: mElement(aOther.mElement)
|
||||||
|
, mEvent(true, aOther.mEvent.mMessage)
|
||||||
{
|
{
|
||||||
mEvent.AssignAnimationEventData(aOther.mEvent, false);
|
mEvent.AssignAnimationEventData(aOther.mEvent, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,7 @@ nsButtonBoxFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_KEY_DOWN: {
|
case NS_KEY_DOWN: {
|
||||||
WidgetKeyboardEvent* keyEvent = aEvent->AsKeyboardEvent();
|
WidgetKeyboardEvent* keyEvent = aEvent->AsKeyboardEvent();
|
||||||
if (!keyEvent) {
|
if (!keyEvent) {
|
||||||
|
|
|
@ -394,7 +394,7 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
|
|
||||||
bool onmenu = IsOnMenu();
|
bool onmenu = IsOnMenu();
|
||||||
|
|
||||||
if (aEvent->message == NS_KEY_PRESS && !IsDisabled()) {
|
if (aEvent->mMessage == NS_KEY_PRESS && !IsDisabled()) {
|
||||||
WidgetKeyboardEvent* keyEvent = aEvent->AsKeyboardEvent();
|
WidgetKeyboardEvent* keyEvent = aEvent->AsKeyboardEvent();
|
||||||
uint32_t keyCode = keyEvent->keyCode;
|
uint32_t keyCode = keyEvent->keyCode;
|
||||||
#ifdef XP_MACOSX
|
#ifdef XP_MACOSX
|
||||||
|
@ -413,7 +413,7 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (aEvent->message == NS_MOUSE_BUTTON_DOWN &&
|
else if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
|
||||||
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
|
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
|
||||||
!IsDisabled() && IsMenu()) {
|
!IsDisabled() && IsMenu()) {
|
||||||
// The menu item was selected. Bring up the menu.
|
// The menu item was selected. Bring up the menu.
|
||||||
|
@ -431,10 +431,10 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
#ifndef NSCONTEXTMENUISMOUSEUP
|
#ifndef NSCONTEXTMENUISMOUSEUP
|
||||||
(aEvent->message == NS_MOUSE_BUTTON_UP &&
|
(aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
|
||||||
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eRightButton) &&
|
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eRightButton) &&
|
||||||
#else
|
#else
|
||||||
aEvent->message == NS_CONTEXTMENU &&
|
aEvent->mMessage == NS_CONTEXTMENU &&
|
||||||
#endif
|
#endif
|
||||||
onmenu && !IsMenu() && !IsDisabled()) {
|
onmenu && !IsMenu() && !IsDisabled()) {
|
||||||
// if this menu is a context menu it accepts right-clicks...fire away!
|
// if this menu is a context menu it accepts right-clicks...fire away!
|
||||||
|
@ -452,14 +452,14 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
Execute(aEvent);
|
Execute(aEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (aEvent->message == NS_MOUSE_BUTTON_UP &&
|
else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
|
||||||
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
|
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
|
||||||
!IsMenu() && !IsDisabled()) {
|
!IsMenu() && !IsDisabled()) {
|
||||||
// Execute the execute event handler.
|
// Execute the execute event handler.
|
||||||
*aEventStatus = nsEventStatus_eConsumeNoDefault;
|
*aEventStatus = nsEventStatus_eConsumeNoDefault;
|
||||||
Execute(aEvent);
|
Execute(aEvent);
|
||||||
}
|
}
|
||||||
else if (aEvent->message == NS_MOUSE_OUT) {
|
else if (aEvent->mMessage == NS_MOUSE_OUT) {
|
||||||
// Kill our timer if one is active.
|
// Kill our timer if one is active.
|
||||||
if (mOpenTimer) {
|
if (mOpenTimer) {
|
||||||
mOpenTimer->Cancel();
|
mOpenTimer->Cancel();
|
||||||
|
@ -479,7 +479,7 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (aEvent->message == NS_MOUSE_MOVE &&
|
else if (aEvent->mMessage == NS_MOUSE_MOVE &&
|
||||||
(onmenu || (menuParent && menuParent->IsMenuBar()))) {
|
(onmenu || (menuParent && menuParent->IsMenuBar()))) {
|
||||||
if (gEatMouseMove) {
|
if (gEatMouseMove) {
|
||||||
gEatMouseMove = false;
|
gEatMouseMove = false;
|
||||||
|
|
|
@ -61,7 +61,7 @@ nsResizerFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
nsWeakFrame weakFrame(this);
|
nsWeakFrame weakFrame(this);
|
||||||
bool doDefault = true;
|
bool doDefault = true;
|
||||||
|
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_TOUCH_START:
|
case NS_TOUCH_START:
|
||||||
case NS_MOUSE_BUTTON_DOWN: {
|
case NS_MOUSE_BUTTON_DOWN: {
|
||||||
if (aEvent->mClass == eTouchEventClass ||
|
if (aEvent->mClass == eTouchEventClass ||
|
||||||
|
|
|
@ -205,7 +205,7 @@ nsRootBoxFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aEvent->message == NS_MOUSE_BUTTON_UP) {
|
if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
|
||||||
nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
|
nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,8 +83,7 @@ nsAutoRepeatBoxFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(aEvent->message)
|
switch(aEvent->mMessage) {
|
||||||
{
|
|
||||||
// repeat mode may be "hover" for repeating while the mouse is hovering
|
// repeat mode may be "hover" for repeating while the mouse is hovering
|
||||||
// over the element, otherwise repetition is done while the element is
|
// over the element, otherwise repetition is done while the element is
|
||||||
// active (pressed).
|
// active (pressed).
|
||||||
|
|
|
@ -52,7 +52,7 @@ nsScrollbarButtonFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_MOUSE_BUTTON_DOWN:
|
case NS_MOUSE_BUTTON_DOWN:
|
||||||
mCursorOnThis = true;
|
mCursorOnThis = true;
|
||||||
// if we didn't handle the press ourselves, pass it on to the superclass
|
// if we didn't handle the press ourselves, pass it on to the superclass
|
||||||
|
|
|
@ -477,7 +477,7 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
|
|
||||||
if (isDraggingThumb())
|
if (isDraggingThumb())
|
||||||
{
|
{
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_TOUCH_MOVE:
|
case NS_TOUCH_MOVE:
|
||||||
case NS_MOUSE_MOVE: {
|
case NS_MOUSE_MOVE: {
|
||||||
nsPoint eventPoint;
|
nsPoint eventPoint;
|
||||||
|
@ -596,9 +596,9 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eRightButton) {
|
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eRightButton) {
|
||||||
// HandlePress and HandleRelease are usually called via
|
// HandlePress and HandleRelease are usually called via
|
||||||
// nsFrame::HandleEvent, but only for the left mouse button.
|
// nsFrame::HandleEvent, but only for the left mouse button.
|
||||||
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
|
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
|
||||||
HandlePress(aPresContext, aEvent, aEventStatus);
|
HandlePress(aPresContext, aEvent, aEventStatus);
|
||||||
} else if (aEvent->message == NS_MOUSE_BUTTON_UP) {
|
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
|
||||||
HandleRelease(aPresContext, aEvent, aEventStatus);
|
HandleRelease(aPresContext, aEvent, aEventStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -607,10 +607,13 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// XXX hack until handle release is actually called in nsframe.
|
// XXX hack until handle release is actually called in nsframe.
|
||||||
// if (aEvent->message == NS_MOUSE_OUT || aEvent->message == NS_MOUSE_RIGHT_BUTTON_UP || aEvent->message == NS_MOUSE_LEFT_BUTTON_UP)
|
// if (aEvent->mMessage == NS_MOUSE_OUT ||
|
||||||
// HandleRelease(aPresContext, aEvent, aEventStatus);
|
// aEvent->mMessage == NS_MOUSE_RIGHT_BUTTON_UP ||
|
||||||
|
// aEvent->mMessage == NS_MOUSE_LEFT_BUTTON_UP) {
|
||||||
|
// HandleRelease(aPresContext, aEvent, aEventStatus);
|
||||||
|
// }
|
||||||
|
|
||||||
if (aEvent->message == NS_MOUSE_OUT && mChange)
|
if (aEvent->mMessage == NS_MOUSE_OUT && mChange)
|
||||||
HandleRelease(aPresContext, aEvent, aEventStatus);
|
HandleRelease(aPresContext, aEvent, aEventStatus);
|
||||||
|
|
||||||
return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
|
return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
|
||||||
|
@ -1042,7 +1045,7 @@ nsSliderFrame::RemoveListener()
|
||||||
bool
|
bool
|
||||||
nsSliderFrame::ShouldScrollForEvent(WidgetGUIEvent* aEvent)
|
nsSliderFrame::ShouldScrollForEvent(WidgetGUIEvent* aEvent)
|
||||||
{
|
{
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_TOUCH_START:
|
case NS_TOUCH_START:
|
||||||
case NS_TOUCH_END:
|
case NS_TOUCH_END:
|
||||||
return true;
|
return true;
|
||||||
|
@ -1070,11 +1073,11 @@ nsSliderFrame::ShouldScrollToClickForEvent(WidgetGUIEvent* aEvent)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aEvent->message == NS_TOUCH_START) {
|
if (aEvent->mMessage == NS_TOUCH_START) {
|
||||||
return GetScrollToClick();
|
return GetScrollToClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aEvent->message != NS_MOUSE_BUTTON_DOWN) {
|
if (aEvent->mMessage != NS_MOUSE_BUTTON_DOWN) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -388,7 +388,7 @@ nsSplitterFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
|
|
||||||
nsWeakFrame weakFrame(this);
|
nsWeakFrame weakFrame(this);
|
||||||
nsRefPtr<nsSplitterFrameInner> kungFuDeathGrip(mInner);
|
nsRefPtr<nsSplitterFrameInner> kungFuDeathGrip(mInner);
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
case NS_MOUSE_MOVE:
|
case NS_MOUSE_MOVE:
|
||||||
mInner->MouseDrag(aPresContext, aEvent);
|
mInner->MouseDrag(aPresContext, aEvent);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -66,7 +66,7 @@ nsTitleBarFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
|
|
||||||
bool doDefault = true;
|
bool doDefault = true;
|
||||||
|
|
||||||
switch (aEvent->message) {
|
switch (aEvent->mMessage) {
|
||||||
|
|
||||||
case NS_MOUSE_BUTTON_DOWN: {
|
case NS_MOUSE_BUTTON_DOWN: {
|
||||||
if (aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
|
if (aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
|
||||||
|
|
|
@ -2563,7 +2563,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
WidgetGUIEvent* aEvent,
|
WidgetGUIEvent* aEvent,
|
||||||
nsEventStatus* aEventStatus)
|
nsEventStatus* aEventStatus)
|
||||||
{
|
{
|
||||||
if (aEvent->message == NS_MOUSE_OVER || aEvent->message == NS_MOUSE_MOVE) {
|
if (aEvent->mMessage == NS_MOUSE_OVER || aEvent->mMessage == NS_MOUSE_MOVE) {
|
||||||
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this);
|
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this);
|
||||||
int32_t xTwips = pt.x - mInnerBox.x;
|
int32_t xTwips = pt.x - mInnerBox.x;
|
||||||
int32_t yTwips = pt.y - mInnerBox.y;
|
int32_t yTwips = pt.y - mInnerBox.y;
|
||||||
|
@ -2576,14 +2576,12 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
if (mMouseOverRow != -1)
|
if (mMouseOverRow != -1)
|
||||||
InvalidateRow(mMouseOverRow);
|
InvalidateRow(mMouseOverRow);
|
||||||
}
|
}
|
||||||
}
|
} else if (aEvent->mMessage == NS_MOUSE_OUT) {
|
||||||
else if (aEvent->message == NS_MOUSE_OUT) {
|
|
||||||
if (mMouseOverRow != -1) {
|
if (mMouseOverRow != -1) {
|
||||||
InvalidateRow(mMouseOverRow);
|
InvalidateRow(mMouseOverRow);
|
||||||
mMouseOverRow = -1;
|
mMouseOverRow = -1;
|
||||||
}
|
}
|
||||||
}
|
} else if (aEvent->mMessage == NS_DRAGDROP_ENTER) {
|
||||||
else if (aEvent->message == NS_DRAGDROP_ENTER) {
|
|
||||||
if (!mSlots)
|
if (!mSlots)
|
||||||
mSlots = new Slots();
|
mSlots = new Slots();
|
||||||
|
|
||||||
|
@ -2600,8 +2598,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
mSlots->mDropRow = -1;
|
mSlots->mDropRow = -1;
|
||||||
mSlots->mDropOrient = -1;
|
mSlots->mDropOrient = -1;
|
||||||
mSlots->mDragAction = GetDropEffect(aEvent);
|
mSlots->mDragAction = GetDropEffect(aEvent);
|
||||||
}
|
} else if (aEvent->mMessage == NS_DRAGDROP_OVER) {
|
||||||
else if (aEvent->message == NS_DRAGDROP_OVER) {
|
|
||||||
// The mouse is hovering over this tree. If we determine things are
|
// The mouse is hovering over this tree. If we determine things are
|
||||||
// different from the last time, invalidate the drop feedback at the old
|
// different from the last time, invalidate the drop feedback at the old
|
||||||
// position, query the view to see if the current location is droppable,
|
// position, query the view to see if the current location is droppable,
|
||||||
|
@ -2710,8 +2707,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
// Indicate that the drop is allowed by preventing the default behaviour.
|
// Indicate that the drop is allowed by preventing the default behaviour.
|
||||||
if (mSlots->mDropAllowed)
|
if (mSlots->mDropAllowed)
|
||||||
*aEventStatus = nsEventStatus_eConsumeNoDefault;
|
*aEventStatus = nsEventStatus_eConsumeNoDefault;
|
||||||
}
|
} else if (aEvent->mMessage == NS_DRAGDROP_DROP) {
|
||||||
else if (aEvent->message == NS_DRAGDROP_DROP) {
|
|
||||||
// this event was meant for another frame, so ignore it
|
// this event was meant for another frame, so ignore it
|
||||||
if (!mSlots)
|
if (!mSlots)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -2735,8 +2731,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
mSlots->mDropOrient = -1;
|
mSlots->mDropOrient = -1;
|
||||||
mSlots->mIsDragging = false;
|
mSlots->mIsDragging = false;
|
||||||
*aEventStatus = nsEventStatus_eConsumeNoDefault; // already handled the drop
|
*aEventStatus = nsEventStatus_eConsumeNoDefault; // already handled the drop
|
||||||
}
|
} else if (aEvent->mMessage == NS_DRAGDROP_EXIT) {
|
||||||
else if (aEvent->message == NS_DRAGDROP_EXIT) {
|
|
||||||
// this event was meant for another frame, so ignore it
|
// this event was meant for another frame, so ignore it
|
||||||
if (!mSlots)
|
if (!mSlots)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
@ -753,11 +753,11 @@ nsViewManager::DispatchEvent(WidgetGUIEvent *aEvent,
|
||||||
// Ignore mouse exit and enter (we'll get moves if the user
|
// Ignore mouse exit and enter (we'll get moves if the user
|
||||||
// is really moving the mouse) since we get them when we
|
// is really moving the mouse) since we get them when we
|
||||||
// create and destroy widgets.
|
// create and destroy widgets.
|
||||||
mouseEvent->message != NS_MOUSE_EXIT_WIDGET &&
|
mouseEvent->mMessage != NS_MOUSE_EXIT_WIDGET &&
|
||||||
mouseEvent->message != NS_MOUSE_ENTER_WIDGET) ||
|
mouseEvent->mMessage != NS_MOUSE_ENTER_WIDGET) ||
|
||||||
aEvent->HasKeyEventMessage() ||
|
aEvent->HasKeyEventMessage() ||
|
||||||
aEvent->HasIMEEventMessage() ||
|
aEvent->HasIMEEventMessage() ||
|
||||||
aEvent->message == NS_PLUGIN_INPUT_EVENT) {
|
aEvent->mMessage == NS_PLUGIN_INPUT_EVENT) {
|
||||||
gLastUserEventTime = PR_IntervalToMicroseconds(PR_IntervalNow());
|
gLastUserEventTime = PR_IntervalToMicroseconds(PR_IntervalNow());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -599,7 +599,7 @@ class WidgetEvent
|
||||||
protected:
|
protected:
|
||||||
WidgetEvent(bool aIsTrusted, uint32_t aMessage, EventClassID aEventClassID)
|
WidgetEvent(bool aIsTrusted, uint32_t aMessage, EventClassID aEventClassID)
|
||||||
: mClass(aEventClassID)
|
: mClass(aEventClassID)
|
||||||
, message(aMessage)
|
, mMessage(aMessage)
|
||||||
, refPoint(0, 0)
|
, refPoint(0, 0)
|
||||||
, lastRefPoint(0, 0)
|
, lastRefPoint(0, 0)
|
||||||
, time(0)
|
, time(0)
|
||||||
|
@ -621,7 +621,7 @@ protected:
|
||||||
public:
|
public:
|
||||||
WidgetEvent(bool aIsTrusted, uint32_t aMessage)
|
WidgetEvent(bool aIsTrusted, uint32_t aMessage)
|
||||||
: mClass(eBasicEventClass)
|
: mClass(eBasicEventClass)
|
||||||
, message(aMessage)
|
, mMessage(aMessage)
|
||||||
, refPoint(0, 0)
|
, refPoint(0, 0)
|
||||||
, lastRefPoint(0, 0)
|
, lastRefPoint(0, 0)
|
||||||
, time(0)
|
, time(0)
|
||||||
|
@ -650,7 +650,7 @@ public:
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mClass == eBasicEventClass,
|
MOZ_ASSERT(mClass == eBasicEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
WidgetEvent* result = new WidgetEvent(false, message);
|
WidgetEvent* result = new WidgetEvent(false, mMessage);
|
||||||
result->AssignEventData(*this, true);
|
result->AssignEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -658,7 +658,7 @@ public:
|
||||||
|
|
||||||
EventClassID mClass;
|
EventClassID mClass;
|
||||||
// See GUI MESSAGES,
|
// See GUI MESSAGES,
|
||||||
uint32_t message;
|
uint32_t mMessage;
|
||||||
// Relative to the widget of the event, or if there is no widget then it is
|
// Relative to the widget of the event, or if there is no widget then it is
|
||||||
// in screen coordinates. Not modified by layout code.
|
// in screen coordinates. Not modified by layout code.
|
||||||
LayoutDeviceIntPoint refPoint;
|
LayoutDeviceIntPoint refPoint;
|
||||||
|
@ -686,7 +686,7 @@ public:
|
||||||
void AssignEventData(const WidgetEvent& aEvent, bool aCopyTargets)
|
void AssignEventData(const WidgetEvent& aEvent, bool aCopyTargets)
|
||||||
{
|
{
|
||||||
// mClass should be initialized with the constructor.
|
// mClass should be initialized with the constructor.
|
||||||
// message should be initialized with the constructor.
|
// mMessage should be initialized with the constructor.
|
||||||
refPoint = aEvent.refPoint;
|
refPoint = aEvent.refPoint;
|
||||||
// lastRefPoint doesn't need to be copied.
|
// lastRefPoint doesn't need to be copied.
|
||||||
time = aEvent.time;
|
time = aEvent.time;
|
||||||
|
@ -735,24 +735,24 @@ public:
|
||||||
bool IsNativeEventDelivererForPlugin() const;
|
bool IsNativeEventDelivererForPlugin() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the event message is one of mouse events.
|
* Returns true if the event mMessage is one of mouse events.
|
||||||
*/
|
*/
|
||||||
bool HasMouseEventMessage() const;
|
bool HasMouseEventMessage() const;
|
||||||
/**
|
/**
|
||||||
* Returns true if the event message is one of drag events.
|
* Returns true if the event mMessage is one of drag events.
|
||||||
*/
|
*/
|
||||||
bool HasDragEventMessage() const;
|
bool HasDragEventMessage() const;
|
||||||
/**
|
/**
|
||||||
* Returns true if the event message is one of key events.
|
* Returns true if the event mMessage is one of key events.
|
||||||
*/
|
*/
|
||||||
bool HasKeyEventMessage() const;
|
bool HasKeyEventMessage() const;
|
||||||
/**
|
/**
|
||||||
* Returns true if the event message is one of composition events or text
|
* Returns true if the event mMessage is one of composition events or text
|
||||||
* event.
|
* event.
|
||||||
*/
|
*/
|
||||||
bool HasIMEEventMessage() const;
|
bool HasIMEEventMessage() const;
|
||||||
/**
|
/**
|
||||||
* Returns true if the event message is one of plugin activation events.
|
* Returns true if the event mMessage is one of plugin activation events.
|
||||||
*/
|
*/
|
||||||
bool HasPluginActivationEventMessage() const;
|
bool HasPluginActivationEventMessage() const;
|
||||||
|
|
||||||
|
@ -842,7 +842,7 @@ public:
|
||||||
MOZ_ASSERT(mClass == eGUIEventClass,
|
MOZ_ASSERT(mClass == eGUIEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
WidgetGUIEvent* result = new WidgetGUIEvent(false, message, nullptr);
|
WidgetGUIEvent* result = new WidgetGUIEvent(false, mMessage, nullptr);
|
||||||
result->AssignGUIEventData(*this, true);
|
result->AssignGUIEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -1006,7 +1006,7 @@ public:
|
||||||
MOZ_ASSERT(mClass == eInputEventClass,
|
MOZ_ASSERT(mClass == eInputEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
WidgetInputEvent* result = new WidgetInputEvent(false, message, nullptr);
|
WidgetInputEvent* result = new WidgetInputEvent(false, mMessage, nullptr);
|
||||||
result->AssignInputEventData(*this, true);
|
result->AssignInputEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -1175,7 +1175,7 @@ public:
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mClass == eUIEventClass,
|
MOZ_ASSERT(mClass == eUIEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
InternalUIEvent* result = new InternalUIEvent(false, message);
|
InternalUIEvent* result = new InternalUIEvent(false, mMessage);
|
||||||
result->AssignUIEventData(*this, true);
|
result->AssignUIEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -515,11 +515,11 @@ ContentCacheInParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent,
|
||||||
aEvent.mSucceeded = false;
|
aEvent.mSucceeded = false;
|
||||||
aEvent.mReply.mFocusedWidget = aWidget;
|
aEvent.mReply.mFocusedWidget = aWidget;
|
||||||
|
|
||||||
switch (aEvent.message) {
|
switch (aEvent.mMessage) {
|
||||||
case NS_QUERY_SELECTED_TEXT:
|
case NS_QUERY_SELECTED_TEXT:
|
||||||
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
||||||
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
|
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
|
||||||
"aEvent={ message=NS_QUERY_SELECTED_TEXT }, aWidget=0x%p)",
|
"aEvent={ mMessage=NS_QUERY_SELECTED_TEXT }, aWidget=0x%p)",
|
||||||
this, aWidget));
|
this, aWidget));
|
||||||
if (NS_WARN_IF(!IsSelectionValid())) {
|
if (NS_WARN_IF(!IsSelectionValid())) {
|
||||||
// If content cache hasn't been initialized properly, make the query
|
// If content cache hasn't been initialized properly, make the query
|
||||||
|
@ -560,7 +560,7 @@ ContentCacheInParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent,
|
||||||
case NS_QUERY_TEXT_CONTENT: {
|
case NS_QUERY_TEXT_CONTENT: {
|
||||||
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
||||||
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
|
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
|
||||||
"aEvent={ message=NS_QUERY_TEXT_CONTENT, mInput={ mOffset=%u, "
|
"aEvent={ mMessage=NS_QUERY_TEXT_CONTENT, mInput={ mOffset=%u, "
|
||||||
"mLength=%u } }, aWidget=0x%p), mText.Length()=%u",
|
"mLength=%u } }, aWidget=0x%p), mText.Length()=%u",
|
||||||
this, aEvent.mInput.mOffset,
|
this, aEvent.mInput.mOffset,
|
||||||
aEvent.mInput.mLength, aWidget, mText.Length()));
|
aEvent.mInput.mLength, aWidget, mText.Length()));
|
||||||
|
@ -586,7 +586,7 @@ ContentCacheInParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent,
|
||||||
case NS_QUERY_TEXT_RECT:
|
case NS_QUERY_TEXT_RECT:
|
||||||
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
||||||
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
|
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
|
||||||
"aEvent={ message=NS_QUERY_TEXT_RECT, mInput={ mOffset=%u, "
|
"aEvent={ mMessage=NS_QUERY_TEXT_RECT, mInput={ mOffset=%u, "
|
||||||
"mLength=%u } }, aWidget=0x%p), mText.Length()=%u",
|
"mLength=%u } }, aWidget=0x%p), mText.Length()=%u",
|
||||||
this, aEvent.mInput.mOffset, aEvent.mInput.mLength, aWidget,
|
this, aEvent.mInput.mOffset, aEvent.mInput.mLength, aWidget,
|
||||||
mText.Length()));
|
mText.Length()));
|
||||||
|
@ -641,7 +641,7 @@ ContentCacheInParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent,
|
||||||
case NS_QUERY_CARET_RECT:
|
case NS_QUERY_CARET_RECT:
|
||||||
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
||||||
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
|
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
|
||||||
"aEvent={ message=NS_QUERY_CARET_RECT, mInput={ mOffset=%u } }, "
|
"aEvent={ mMessage=NS_QUERY_CARET_RECT, mInput={ mOffset=%u } }, "
|
||||||
"aWidget=0x%p), mText.Length()=%u",
|
"aWidget=0x%p), mText.Length()=%u",
|
||||||
this, aEvent.mInput.mOffset, aWidget, mText.Length()));
|
this, aEvent.mInput.mOffset, aWidget, mText.Length()));
|
||||||
if (NS_WARN_IF(!IsSelectionValid())) {
|
if (NS_WARN_IF(!IsSelectionValid())) {
|
||||||
|
@ -668,7 +668,7 @@ ContentCacheInParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent,
|
||||||
case NS_QUERY_EDITOR_RECT:
|
case NS_QUERY_EDITOR_RECT:
|
||||||
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
||||||
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
|
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
|
||||||
"aEvent={ message=NS_QUERY_EDITOR_RECT }, aWidget=0x%p)",
|
"aEvent={ mMessage=NS_QUERY_EDITOR_RECT }, aWidget=0x%p)",
|
||||||
this, aWidget));
|
this, aWidget));
|
||||||
aEvent.mReply.mRect = mEditorRect;
|
aEvent.mReply.mRect = mEditorRect;
|
||||||
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
||||||
|
@ -846,17 +846,17 @@ ContentCacheInParent::OnCompositionEvent(const WidgetCompositionEvent& aEvent)
|
||||||
{
|
{
|
||||||
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
||||||
("ContentCacheInParent: 0x%p OnCompositionEvent(aEvent={ "
|
("ContentCacheInParent: 0x%p OnCompositionEvent(aEvent={ "
|
||||||
"message=%s, mData=\"%s\" (Length()=%u), mRanges->Length()=%u }), "
|
"mMessage=%s, mData=\"%s\" (Length()=%u), mRanges->Length()=%u }), "
|
||||||
"mPendingEventsNeedingAck=%u, mIsComposing=%s, "
|
"mPendingEventsNeedingAck=%u, mIsComposing=%s, "
|
||||||
"mRequestedToCommitOrCancelComposition=%s",
|
"mRequestedToCommitOrCancelComposition=%s",
|
||||||
this, GetEventMessageName(aEvent.message),
|
this, GetEventMessageName(aEvent.mMessage),
|
||||||
NS_ConvertUTF16toUTF8(aEvent.mData).get(), aEvent.mData.Length(),
|
NS_ConvertUTF16toUTF8(aEvent.mData).get(), aEvent.mData.Length(),
|
||||||
aEvent.mRanges ? aEvent.mRanges->Length() : 0, mPendingEventsNeedingAck,
|
aEvent.mRanges ? aEvent.mRanges->Length() : 0, mPendingEventsNeedingAck,
|
||||||
GetBoolName(mIsComposing),
|
GetBoolName(mIsComposing),
|
||||||
GetBoolName(mRequestedToCommitOrCancelComposition)));
|
GetBoolName(mRequestedToCommitOrCancelComposition)));
|
||||||
|
|
||||||
if (!aEvent.CausesDOMTextEvent()) {
|
if (!aEvent.CausesDOMTextEvent()) {
|
||||||
MOZ_ASSERT(aEvent.message == NS_COMPOSITION_START);
|
MOZ_ASSERT(aEvent.mMessage == NS_COMPOSITION_START);
|
||||||
mIsComposing = !aEvent.CausesDOMCompositionEndEvent();
|
mIsComposing = !aEvent.CausesDOMCompositionEndEvent();
|
||||||
mCompositionStart = mSelection.StartOffset();
|
mCompositionStart = mSelection.StartOffset();
|
||||||
// XXX What's this case??
|
// XXX What's this case??
|
||||||
|
@ -900,10 +900,10 @@ ContentCacheInParent::OnSelectionEvent(
|
||||||
{
|
{
|
||||||
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
MOZ_LOG(sContentCacheLog, LogLevel::Info,
|
||||||
("ContentCacheInParent: 0x%p OnSelectionEvent(aEvent={ "
|
("ContentCacheInParent: 0x%p OnSelectionEvent(aEvent={ "
|
||||||
"message=%s, mOffset=%u, mLength=%u, mReversed=%s, "
|
"mMessage=%s, mOffset=%u, mLength=%u, mReversed=%s, "
|
||||||
"mExpandToClusterBoundary=%s, mUseNativeLineBreak=%s }), "
|
"mExpandToClusterBoundary=%s, mUseNativeLineBreak=%s }), "
|
||||||
"mPendingEventsNeedingAck=%u, mIsComposing=%s",
|
"mPendingEventsNeedingAck=%u, mIsComposing=%s",
|
||||||
this, GetEventMessageName(aSelectionEvent.message),
|
this, GetEventMessageName(aSelectionEvent.mMessage),
|
||||||
aSelectionEvent.mOffset, aSelectionEvent.mLength,
|
aSelectionEvent.mOffset, aSelectionEvent.mLength,
|
||||||
GetBoolName(aSelectionEvent.mReversed),
|
GetBoolName(aSelectionEvent.mReversed),
|
||||||
GetBoolName(aSelectionEvent.mExpandToClusterBoundary),
|
GetBoolName(aSelectionEvent.mExpandToClusterBoundary),
|
||||||
|
|
|
@ -51,7 +51,7 @@ public:
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
InternalScrollPortEvent* result =
|
InternalScrollPortEvent* result =
|
||||||
new InternalScrollPortEvent(false, message, nullptr);
|
new InternalScrollPortEvent(false, mMessage, nullptr);
|
||||||
result->AssignScrollPortEventData(*this, true);
|
result->AssignScrollPortEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -92,7 +92,7 @@ public:
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
InternalScrollAreaEvent* result =
|
InternalScrollAreaEvent* result =
|
||||||
new InternalScrollAreaEvent(false, message, nullptr);
|
new InternalScrollAreaEvent(false, mMessage, nullptr);
|
||||||
result->AssignScrollAreaEventData(*this, true);
|
result->AssignScrollAreaEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -131,7 +131,7 @@ public:
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mClass == eFormEventClass,
|
MOZ_ASSERT(mClass == eFormEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
InternalFormEvent* result = new InternalFormEvent(false, message);
|
InternalFormEvent* result = new InternalFormEvent(false, mMessage);
|
||||||
result->AssignFormEventData(*this, true);
|
result->AssignFormEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -168,7 +168,8 @@ public:
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mClass == eClipboardEventClass,
|
MOZ_ASSERT(mClass == eClipboardEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
InternalClipboardEvent* result = new InternalClipboardEvent(false, message);
|
InternalClipboardEvent* result =
|
||||||
|
new InternalClipboardEvent(false, mMessage);
|
||||||
result->AssignClipboardEventData(*this, true);
|
result->AssignClipboardEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -205,7 +206,7 @@ public:
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mClass == eFocusEventClass,
|
MOZ_ASSERT(mClass == eFocusEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
InternalFocusEvent* result = new InternalFocusEvent(false, message);
|
InternalFocusEvent* result = new InternalFocusEvent(false, mMessage);
|
||||||
result->AssignFocusEventData(*this, true);
|
result->AssignFocusEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -251,7 +252,7 @@ public:
|
||||||
MOZ_ASSERT(mClass == eTransitionEventClass,
|
MOZ_ASSERT(mClass == eTransitionEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
InternalTransitionEvent* result =
|
InternalTransitionEvent* result =
|
||||||
new InternalTransitionEvent(false, message);
|
new InternalTransitionEvent(false, mMessage);
|
||||||
result->AssignTransitionEventData(*this, true);
|
result->AssignTransitionEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -295,7 +296,8 @@ public:
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mClass == eAnimationEventClass,
|
MOZ_ASSERT(mClass == eAnimationEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
InternalAnimationEvent* result = new InternalAnimationEvent(false, message);
|
InternalAnimationEvent* result =
|
||||||
|
new InternalAnimationEvent(false, mMessage);
|
||||||
result->AssignAnimationEventData(*this, true);
|
result->AssignAnimationEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -336,7 +338,7 @@ public:
|
||||||
MOZ_ASSERT(mClass == eSVGZoomEventClass,
|
MOZ_ASSERT(mClass == eSVGZoomEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
InternalSVGZoomEvent* result = new InternalSVGZoomEvent(false, message);
|
InternalSVGZoomEvent* result = new InternalSVGZoomEvent(false, mMessage);
|
||||||
result->AssignSVGZoomEventData(*this, true);
|
result->AssignSVGZoomEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -372,7 +374,7 @@ public:
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mClass == eSMILTimeEventClass,
|
MOZ_ASSERT(mClass == eSMILTimeEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
InternalSMILTimeEvent* result = new InternalSMILTimeEvent(false, message);
|
InternalSMILTimeEvent* result = new InternalSMILTimeEvent(false, mMessage);
|
||||||
result->AssignSMILTimeEventData(*this, true);
|
result->AssignSMILTimeEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -35,7 +35,7 @@ MultiTouchInput::MultiTouchInput(const WidgetTouchEvent& aTouchEvent)
|
||||||
MOZ_ASSERT(NS_IsMainThread(),
|
MOZ_ASSERT(NS_IsMainThread(),
|
||||||
"Can only copy from WidgetTouchEvent on main thread");
|
"Can only copy from WidgetTouchEvent on main thread");
|
||||||
|
|
||||||
switch (aTouchEvent.message) {
|
switch (aTouchEvent.mMessage) {
|
||||||
case NS_TOUCH_START:
|
case NS_TOUCH_START:
|
||||||
mType = MULTITOUCH_START;
|
mType = MULTITOUCH_START;
|
||||||
break;
|
break;
|
||||||
|
@ -181,7 +181,7 @@ MultiTouchInput::MultiTouchInput(const WidgetMouseEvent& aMouseEvent)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread(),
|
MOZ_ASSERT(NS_IsMainThread(),
|
||||||
"Can only copy from WidgetMouseEvent on main thread");
|
"Can only copy from WidgetMouseEvent on main thread");
|
||||||
switch (aMouseEvent.message) {
|
switch (aMouseEvent.mMessage) {
|
||||||
case NS_MOUSE_BUTTON_DOWN:
|
case NS_MOUSE_BUTTON_DOWN:
|
||||||
mType = MULTITOUCH_START;
|
mType = MULTITOUCH_START;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -158,7 +158,7 @@ public:
|
||||||
MOZ_ASSERT(mClass == ePluginEventClass,
|
MOZ_ASSERT(mClass == ePluginEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
WidgetPluginEvent* result = new WidgetPluginEvent(false, message, nullptr);
|
WidgetPluginEvent* result = new WidgetPluginEvent(false, mMessage, nullptr);
|
||||||
result->AssignPluginEventData(*this, true);
|
result->AssignPluginEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -155,7 +155,7 @@ public:
|
||||||
*/
|
*/
|
||||||
bool IsLeftClickEvent() const
|
bool IsLeftClickEvent() const
|
||||||
{
|
{
|
||||||
return message == NS_MOUSE_CLICK && button == eLeftButton;
|
return mMessage == NS_MOUSE_CLICK && button == eLeftButton;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ public:
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
virtual ~WidgetMouseEvent()
|
virtual ~WidgetMouseEvent()
|
||||||
{
|
{
|
||||||
NS_WARN_IF_FALSE(message != NS_CONTEXTMENU ||
|
NS_WARN_IF_FALSE(mMessage != NS_CONTEXTMENU ||
|
||||||
button ==
|
button ==
|
||||||
((context == eNormal) ? eRightButton : eLeftButton),
|
((context == eNormal) ? eRightButton : eLeftButton),
|
||||||
"Wrong button set to NS_CONTEXTMENU event?");
|
"Wrong button set to NS_CONTEXTMENU event?");
|
||||||
|
@ -253,7 +253,7 @@ public:
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
WidgetMouseEvent* result =
|
WidgetMouseEvent* result =
|
||||||
new WidgetMouseEvent(false, message, nullptr, reason, context);
|
new WidgetMouseEvent(false, mMessage, nullptr, reason, context);
|
||||||
result->AssignMouseEventData(*this, true);
|
result->AssignMouseEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -287,7 +287,7 @@ public:
|
||||||
*/
|
*/
|
||||||
bool IsContextMenuKeyEvent() const
|
bool IsContextMenuKeyEvent() const
|
||||||
{
|
{
|
||||||
return message == NS_CONTEXTMENU && context == eContextMenuKey;
|
return mMessage == NS_CONTEXTMENU && context == eContextMenuKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -332,7 +332,7 @@ public:
|
||||||
MOZ_ASSERT(mClass == eDragEventClass,
|
MOZ_ASSERT(mClass == eDragEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
WidgetDragEvent* result = new WidgetDragEvent(false, message, nullptr);
|
WidgetDragEvent* result = new WidgetDragEvent(false, mMessage, nullptr);
|
||||||
result->AssignDragEventData(*this, true);
|
result->AssignDragEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -394,7 +394,7 @@ public:
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
WidgetMouseScrollEvent* result =
|
WidgetMouseScrollEvent* result =
|
||||||
new WidgetMouseScrollEvent(false, message, nullptr);
|
new WidgetMouseScrollEvent(false, mMessage, nullptr);
|
||||||
result->AssignMouseScrollEventData(*this, true);
|
result->AssignMouseScrollEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -462,7 +462,7 @@ public:
|
||||||
MOZ_ASSERT(mClass == eWheelEventClass,
|
MOZ_ASSERT(mClass == eWheelEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
WidgetWheelEvent* result = new WidgetWheelEvent(false, message, nullptr);
|
WidgetWheelEvent* result = new WidgetWheelEvent(false, mMessage, nullptr);
|
||||||
result->AssignWheelEventData(*this, true);
|
result->AssignWheelEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -608,7 +608,7 @@ public:
|
||||||
|
|
||||||
void UpdateFlags()
|
void UpdateFlags()
|
||||||
{
|
{
|
||||||
switch (message) {
|
switch (mMessage) {
|
||||||
case NS_POINTER_ENTER:
|
case NS_POINTER_ENTER:
|
||||||
case NS_POINTER_LEAVE:
|
case NS_POINTER_LEAVE:
|
||||||
mFlags.mBubbles = false;
|
mFlags.mBubbles = false;
|
||||||
|
@ -630,7 +630,7 @@ public:
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
WidgetPointerEvent* result =
|
WidgetPointerEvent* result =
|
||||||
new WidgetPointerEvent(false, message, nullptr);
|
new WidgetPointerEvent(false, mMessage, nullptr);
|
||||||
result->AssignPointerEventData(*this, true);
|
result->AssignPointerEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -113,7 +113,7 @@ public:
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
WidgetKeyboardEvent* result =
|
WidgetKeyboardEvent* result =
|
||||||
new WidgetKeyboardEvent(false, message, nullptr);
|
new WidgetKeyboardEvent(false, mMessage, nullptr);
|
||||||
result->AssignKeyEventData(*this, true);
|
result->AssignKeyEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -281,10 +281,10 @@ private:
|
||||||
* This is extended from WidgetKeyboardEvent and is mapped to DOM event
|
* This is extended from WidgetKeyboardEvent and is mapped to DOM event
|
||||||
* "BeforeAfterKeyboardEvent".
|
* "BeforeAfterKeyboardEvent".
|
||||||
*
|
*
|
||||||
* Event message: NS_KEY_BEFORE_DOWN
|
* Event mMessage: NS_KEY_BEFORE_DOWN
|
||||||
* NS_KEY_BEFORE_UP
|
* NS_KEY_BEFORE_UP
|
||||||
* NS_KEY_AFTER_DOWN
|
* NS_KEY_AFTER_DOWN
|
||||||
* NS_KEY_AFTER_UP
|
* NS_KEY_AFTER_UP
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
class InternalBeforeAfterKeyboardEvent : public WidgetKeyboardEvent
|
class InternalBeforeAfterKeyboardEvent : public WidgetKeyboardEvent
|
||||||
{
|
{
|
||||||
|
@ -318,7 +318,7 @@ public:
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
InternalBeforeAfterKeyboardEvent* result =
|
InternalBeforeAfterKeyboardEvent* result =
|
||||||
new InternalBeforeAfterKeyboardEvent(false, message, nullptr);
|
new InternalBeforeAfterKeyboardEvent(false, mMessage, nullptr);
|
||||||
result->AssignBeforeAfterKeyEventData(*this, true);
|
result->AssignBeforeAfterKeyEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -376,7 +376,7 @@ public:
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
WidgetCompositionEvent* result =
|
WidgetCompositionEvent* result =
|
||||||
new WidgetCompositionEvent(false, message, nullptr);
|
new WidgetCompositionEvent(false, mMessage, nullptr);
|
||||||
result->AssignCompositionEventData(*this, true);
|
result->AssignCompositionEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -426,16 +426,16 @@ public:
|
||||||
|
|
||||||
bool CausesDOMTextEvent() const
|
bool CausesDOMTextEvent() const
|
||||||
{
|
{
|
||||||
return message == NS_COMPOSITION_CHANGE ||
|
return mMessage == NS_COMPOSITION_CHANGE ||
|
||||||
message == NS_COMPOSITION_COMMIT ||
|
mMessage == NS_COMPOSITION_COMMIT ||
|
||||||
message == NS_COMPOSITION_COMMIT_AS_IS;
|
mMessage == NS_COMPOSITION_COMMIT_AS_IS;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CausesDOMCompositionEndEvent() const
|
bool CausesDOMCompositionEndEvent() const
|
||||||
{
|
{
|
||||||
return message == NS_COMPOSITION_END ||
|
return mMessage == NS_COMPOSITION_END ||
|
||||||
message == NS_COMPOSITION_COMMIT ||
|
mMessage == NS_COMPOSITION_COMMIT ||
|
||||||
message == NS_COMPOSITION_COMMIT_AS_IS;
|
mMessage == NS_COMPOSITION_COMMIT_AS_IS;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -481,7 +481,7 @@ public:
|
||||||
void InitForQueryTextContent(uint32_t aOffset, uint32_t aLength,
|
void InitForQueryTextContent(uint32_t aOffset, uint32_t aLength,
|
||||||
bool aUseNativeLineBreak = true)
|
bool aUseNativeLineBreak = true)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(message == NS_QUERY_TEXT_CONTENT,
|
NS_ASSERTION(mMessage == NS_QUERY_TEXT_CONTENT,
|
||||||
"wrong initializer is called");
|
"wrong initializer is called");
|
||||||
mInput.mOffset = aOffset;
|
mInput.mOffset = aOffset;
|
||||||
mInput.mLength = aLength;
|
mInput.mLength = aLength;
|
||||||
|
@ -491,7 +491,7 @@ public:
|
||||||
void InitForQueryCaretRect(uint32_t aOffset,
|
void InitForQueryCaretRect(uint32_t aOffset,
|
||||||
bool aUseNativeLineBreak = true)
|
bool aUseNativeLineBreak = true)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(message == NS_QUERY_CARET_RECT,
|
NS_ASSERTION(mMessage == NS_QUERY_CARET_RECT,
|
||||||
"wrong initializer is called");
|
"wrong initializer is called");
|
||||||
mInput.mOffset = aOffset;
|
mInput.mOffset = aOffset;
|
||||||
mUseNativeLineBreak = aUseNativeLineBreak;
|
mUseNativeLineBreak = aUseNativeLineBreak;
|
||||||
|
@ -500,7 +500,7 @@ public:
|
||||||
void InitForQueryTextRect(uint32_t aOffset, uint32_t aLength,
|
void InitForQueryTextRect(uint32_t aOffset, uint32_t aLength,
|
||||||
bool aUseNativeLineBreak = true)
|
bool aUseNativeLineBreak = true)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(message == NS_QUERY_TEXT_RECT,
|
NS_ASSERTION(mMessage == NS_QUERY_TEXT_RECT,
|
||||||
"wrong initializer is called");
|
"wrong initializer is called");
|
||||||
mInput.mOffset = aOffset;
|
mInput.mOffset = aOffset;
|
||||||
mInput.mLength = aLength;
|
mInput.mLength = aLength;
|
||||||
|
@ -509,37 +509,37 @@ public:
|
||||||
|
|
||||||
void InitForQueryDOMWidgetHittest(const mozilla::LayoutDeviceIntPoint& aPoint)
|
void InitForQueryDOMWidgetHittest(const mozilla::LayoutDeviceIntPoint& aPoint)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(message == NS_QUERY_DOM_WIDGET_HITTEST,
|
NS_ASSERTION(mMessage == NS_QUERY_DOM_WIDGET_HITTEST,
|
||||||
"wrong initializer is called");
|
"wrong initializer is called");
|
||||||
refPoint = aPoint;
|
refPoint = aPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RequestFontRanges()
|
void RequestFontRanges()
|
||||||
{
|
{
|
||||||
NS_ASSERTION(message == NS_QUERY_TEXT_CONTENT,
|
NS_ASSERTION(mMessage == NS_QUERY_TEXT_CONTENT,
|
||||||
"not querying text content");
|
"not querying text content");
|
||||||
mWithFontRanges = true;
|
mWithFontRanges = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t GetSelectionStart(void) const
|
uint32_t GetSelectionStart(void) const
|
||||||
{
|
{
|
||||||
NS_ASSERTION(message == NS_QUERY_SELECTED_TEXT,
|
NS_ASSERTION(mMessage == NS_QUERY_SELECTED_TEXT,
|
||||||
"not querying selection");
|
"not querying selection");
|
||||||
return mReply.mOffset + (mReply.mReversed ? mReply.mString.Length() : 0);
|
return mReply.mOffset + (mReply.mReversed ? mReply.mString.Length() : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t GetSelectionEnd(void) const
|
uint32_t GetSelectionEnd(void) const
|
||||||
{
|
{
|
||||||
NS_ASSERTION(message == NS_QUERY_SELECTED_TEXT,
|
NS_ASSERTION(mMessage == NS_QUERY_SELECTED_TEXT,
|
||||||
"not querying selection");
|
"not querying selection");
|
||||||
return mReply.mOffset + (mReply.mReversed ? 0 : mReply.mString.Length());
|
return mReply.mOffset + (mReply.mReversed ? 0 : mReply.mString.Length());
|
||||||
}
|
}
|
||||||
|
|
||||||
mozilla::WritingMode GetWritingMode(void) const
|
mozilla::WritingMode GetWritingMode(void) const
|
||||||
{
|
{
|
||||||
NS_ASSERTION(message == NS_QUERY_SELECTED_TEXT ||
|
NS_ASSERTION(mMessage == NS_QUERY_SELECTED_TEXT ||
|
||||||
message == NS_QUERY_CARET_RECT ||
|
mMessage == NS_QUERY_CARET_RECT ||
|
||||||
message == NS_QUERY_TEXT_RECT,
|
mMessage == NS_QUERY_TEXT_RECT,
|
||||||
"not querying selection or text rect");
|
"not querying selection or text rect");
|
||||||
return mReply.mWritingMode;
|
return mReply.mWritingMode;
|
||||||
}
|
}
|
||||||
|
@ -709,7 +709,7 @@ public:
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
InternalEditorInputEvent* result =
|
InternalEditorInputEvent* result =
|
||||||
new InternalEditorInputEvent(false, message, nullptr);
|
new InternalEditorInputEvent(false, mMessage, nullptr);
|
||||||
result->AssignEditorInputEventData(*this, true);
|
result->AssignEditorInputEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
WidgetGestureNotifyEvent* result =
|
WidgetGestureNotifyEvent* result =
|
||||||
new WidgetGestureNotifyEvent(false, message, nullptr);
|
new WidgetGestureNotifyEvent(false, mMessage, nullptr);
|
||||||
result->AssignGestureNotifyEventData(*this, true);
|
result->AssignGestureNotifyEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -106,7 +106,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
WidgetSimpleGestureEvent(const WidgetSimpleGestureEvent& aOther)
|
WidgetSimpleGestureEvent(const WidgetSimpleGestureEvent& aOther)
|
||||||
: WidgetMouseEventBase(aOther.mFlags.mIsTrusted, aOther.message,
|
: WidgetMouseEventBase(aOther.mFlags.mIsTrusted, aOther.mMessage,
|
||||||
aOther.widget, eSimpleGestureEventClass)
|
aOther.widget, eSimpleGestureEventClass)
|
||||||
, allowedDirections(aOther.allowedDirections)
|
, allowedDirections(aOther.allowedDirections)
|
||||||
, direction(aOther.direction)
|
, direction(aOther.direction)
|
||||||
|
@ -121,7 +121,7 @@ public:
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
WidgetSimpleGestureEvent* result =
|
WidgetSimpleGestureEvent* result =
|
||||||
new WidgetSimpleGestureEvent(false, message, nullptr);
|
new WidgetSimpleGestureEvent(false, mMessage, nullptr);
|
||||||
result->AssignSimpleGestureEventData(*this, true);
|
result->AssignSimpleGestureEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
@ -166,14 +166,14 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
WidgetTouchEvent(const WidgetTouchEvent& aOther)
|
WidgetTouchEvent(const WidgetTouchEvent& aOther)
|
||||||
: WidgetInputEvent(aOther.mFlags.mIsTrusted, aOther.message, aOther.widget,
|
: WidgetInputEvent(aOther.mFlags.mIsTrusted, aOther.mMessage, aOther.widget,
|
||||||
eTouchEventClass)
|
eTouchEventClass)
|
||||||
{
|
{
|
||||||
modifiers = aOther.modifiers;
|
modifiers = aOther.modifiers;
|
||||||
time = aOther.time;
|
time = aOther.time;
|
||||||
timeStamp = aOther.timeStamp;
|
timeStamp = aOther.timeStamp;
|
||||||
touches.AppendElements(aOther.touches);
|
touches.AppendElements(aOther.touches);
|
||||||
mFlags.mCancelable = message != NS_TOUCH_CANCEL;
|
mFlags.mCancelable = mMessage != NS_TOUCH_CANCEL;
|
||||||
MOZ_COUNT_CTOR(WidgetTouchEvent);
|
MOZ_COUNT_CTOR(WidgetTouchEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ public:
|
||||||
: WidgetInputEvent(aIsTrusted, aMessage, aWidget, eTouchEventClass)
|
: WidgetInputEvent(aIsTrusted, aMessage, aWidget, eTouchEventClass)
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(WidgetTouchEvent);
|
MOZ_COUNT_CTOR(WidgetTouchEvent);
|
||||||
mFlags.mCancelable = message != NS_TOUCH_CANCEL;
|
mFlags.mCancelable = mMessage != NS_TOUCH_CANCEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~WidgetTouchEvent()
|
virtual ~WidgetTouchEvent()
|
||||||
|
@ -194,7 +194,7 @@ public:
|
||||||
MOZ_ASSERT(mClass == eTouchEventClass,
|
MOZ_ASSERT(mClass == eTouchEventClass,
|
||||||
"Duplicate() must be overridden by sub class");
|
"Duplicate() must be overridden by sub class");
|
||||||
// Not copying widget, it is a weak reference.
|
// Not copying widget, it is a weak reference.
|
||||||
WidgetTouchEvent* result = new WidgetTouchEvent(false, message, nullptr);
|
WidgetTouchEvent* result = new WidgetTouchEvent(false, mMessage, nullptr);
|
||||||
result->AssignTouchEventData(*this, true);
|
result->AssignTouchEventData(*this, true);
|
||||||
result->mFlags = mFlags;
|
result->mFlags = mFlags;
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -77,7 +77,7 @@ WidgetEvent::IsNativeEventDelivererForPlugin() const
|
||||||
bool
|
bool
|
||||||
WidgetEvent::HasMouseEventMessage() const
|
WidgetEvent::HasMouseEventMessage() const
|
||||||
{
|
{
|
||||||
switch (message) {
|
switch (mMessage) {
|
||||||
case NS_MOUSE_BUTTON_DOWN:
|
case NS_MOUSE_BUTTON_DOWN:
|
||||||
case NS_MOUSE_BUTTON_UP:
|
case NS_MOUSE_BUTTON_UP:
|
||||||
case NS_MOUSE_CLICK:
|
case NS_MOUSE_CLICK:
|
||||||
|
@ -98,7 +98,7 @@ WidgetEvent::HasMouseEventMessage() const
|
||||||
bool
|
bool
|
||||||
WidgetEvent::HasDragEventMessage() const
|
WidgetEvent::HasDragEventMessage() const
|
||||||
{
|
{
|
||||||
switch (message) {
|
switch (mMessage) {
|
||||||
case NS_DRAGDROP_ENTER:
|
case NS_DRAGDROP_ENTER:
|
||||||
case NS_DRAGDROP_OVER:
|
case NS_DRAGDROP_OVER:
|
||||||
case NS_DRAGDROP_EXIT:
|
case NS_DRAGDROP_EXIT:
|
||||||
|
@ -118,7 +118,7 @@ WidgetEvent::HasDragEventMessage() const
|
||||||
bool
|
bool
|
||||||
WidgetEvent::HasKeyEventMessage() const
|
WidgetEvent::HasKeyEventMessage() const
|
||||||
{
|
{
|
||||||
switch (message) {
|
switch (mMessage) {
|
||||||
case NS_KEY_DOWN:
|
case NS_KEY_DOWN:
|
||||||
case NS_KEY_PRESS:
|
case NS_KEY_PRESS:
|
||||||
case NS_KEY_UP:
|
case NS_KEY_UP:
|
||||||
|
@ -135,7 +135,7 @@ WidgetEvent::HasKeyEventMessage() const
|
||||||
bool
|
bool
|
||||||
WidgetEvent::HasIMEEventMessage() const
|
WidgetEvent::HasIMEEventMessage() const
|
||||||
{
|
{
|
||||||
switch (message) {
|
switch (mMessage) {
|
||||||
case NS_COMPOSITION_START:
|
case NS_COMPOSITION_START:
|
||||||
case NS_COMPOSITION_END:
|
case NS_COMPOSITION_END:
|
||||||
case NS_COMPOSITION_UPDATE:
|
case NS_COMPOSITION_UPDATE:
|
||||||
|
@ -151,8 +151,8 @@ WidgetEvent::HasIMEEventMessage() const
|
||||||
bool
|
bool
|
||||||
WidgetEvent::HasPluginActivationEventMessage() const
|
WidgetEvent::HasPluginActivationEventMessage() const
|
||||||
{
|
{
|
||||||
return message == NS_PLUGIN_ACTIVATE ||
|
return mMessage == NS_PLUGIN_ACTIVATE ||
|
||||||
message == NS_PLUGIN_FOCUS;
|
mMessage == NS_PLUGIN_FOCUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
|
|
@ -966,7 +966,7 @@ nsWindow::OnMouseEvent(AndroidGeckoEvent *ae)
|
||||||
nsRefPtr<nsWindow> kungFuDeathGrip(this);
|
nsRefPtr<nsWindow> kungFuDeathGrip(this);
|
||||||
|
|
||||||
WidgetMouseEvent event = ae->MakeMouseEvent(this);
|
WidgetMouseEvent event = ae->MakeMouseEvent(this);
|
||||||
if (event.message == NS_EVENT_NULL) {
|
if (event.mMessage == NS_EVENT_NULL) {
|
||||||
// invalid event type, abort
|
// invalid event type, abort
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1001,7 +1001,7 @@ nsWindow::OnContextmenuEvent(AndroidGeckoEvent *ae)
|
||||||
// triggering further element behaviour such as link-clicks.
|
// triggering further element behaviour such as link-clicks.
|
||||||
if (contextMenuStatus == nsEventStatus_eConsumeNoDefault) {
|
if (contextMenuStatus == nsEventStatus_eConsumeNoDefault) {
|
||||||
WidgetTouchEvent canceltouchEvent = ae->MakeTouchEvent(this);
|
WidgetTouchEvent canceltouchEvent = ae->MakeTouchEvent(this);
|
||||||
canceltouchEvent.message = NS_TOUCH_CANCEL;
|
canceltouchEvent.mMessage = NS_TOUCH_CANCEL;
|
||||||
DispatchEvent(&canceltouchEvent);
|
DispatchEvent(&canceltouchEvent);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1052,7 +1052,7 @@ bool nsWindow::OnMultitouchEvent(AndroidGeckoEvent *ae)
|
||||||
bool isDownEvent = false;
|
bool isDownEvent = false;
|
||||||
|
|
||||||
WidgetTouchEvent event = ae->MakeTouchEvent(this);
|
WidgetTouchEvent event = ae->MakeTouchEvent(this);
|
||||||
if (event.message != NS_EVENT_NULL) {
|
if (event.mMessage != NS_EVENT_NULL) {
|
||||||
nsEventStatus status;
|
nsEventStatus status;
|
||||||
DispatchEvent(&event, status);
|
DispatchEvent(&event, status);
|
||||||
// We check mMultipleActionsPrevented because that's what <input type=range>
|
// We check mMultipleActionsPrevented because that's what <input type=range>
|
||||||
|
@ -1061,7 +1061,7 @@ bool nsWindow::OnMultitouchEvent(AndroidGeckoEvent *ae)
|
||||||
// from running.
|
// from running.
|
||||||
preventDefaultActions = (status == nsEventStatus_eConsumeNoDefault ||
|
preventDefaultActions = (status == nsEventStatus_eConsumeNoDefault ||
|
||||||
event.mFlags.mMultipleActionsPrevented);
|
event.mFlags.mMultipleActionsPrevented);
|
||||||
isDownEvent = (event.message == NS_TOUCH_START);
|
isDownEvent = (event.mMessage == NS_TOUCH_START);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isDownEvent && event.touches.Length() == 1) {
|
if (isDownEvent && event.touches.Length() == 1) {
|
||||||
|
@ -1461,7 +1461,7 @@ nsWindow::InitKeyEvent(WidgetKeyboardEvent& event, AndroidGeckoEvent& key,
|
||||||
event.mCodeNameIndex = ConvertAndroidScanCodeToCodeNameIndex(key);
|
event.mCodeNameIndex = ConvertAndroidScanCodeToCodeNameIndex(key);
|
||||||
uint32_t domKeyCode = ConvertAndroidKeyCodeToDOMKeyCode(key.KeyCode());
|
uint32_t domKeyCode = ConvertAndroidKeyCodeToDOMKeyCode(key.KeyCode());
|
||||||
|
|
||||||
if (event.message == NS_KEY_PRESS) {
|
if (event.mMessage == NS_KEY_PRESS) {
|
||||||
// Android gives us \n, so filter out some control characters.
|
// Android gives us \n, so filter out some control characters.
|
||||||
int charCode = key.UnicodeChar();
|
int charCode = key.UnicodeChar();
|
||||||
if (!charCode) {
|
if (!charCode) {
|
||||||
|
@ -1473,13 +1473,13 @@ nsWindow::InitKeyEvent(WidgetKeyboardEvent& event, AndroidGeckoEvent& key,
|
||||||
event.mPluginEvent.Clear();
|
event.mPluginEvent.Clear();
|
||||||
} else {
|
} else {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (event.message != NS_KEY_DOWN && event.message != NS_KEY_UP) {
|
if (event.mMessage != NS_KEY_DOWN && event.mMessage != NS_KEY_UP) {
|
||||||
ALOG("InitKeyEvent: unexpected event.message %d", event.message);
|
ALOG("InitKeyEvent: unexpected event.mMessage %d", event.mMessage);
|
||||||
}
|
}
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
|
|
||||||
// Flash will want a pluginEvent for keydown and keyup events.
|
// Flash will want a pluginEvent for keydown and keyup events.
|
||||||
ANPKeyActions action = event.message == NS_KEY_DOWN
|
ANPKeyActions action = event.mMessage == NS_KEY_DOWN
|
||||||
? kDown_ANPKeyAction
|
? kDown_ANPKeyAction
|
||||||
: kUp_ANPKeyAction;
|
: kUp_ANPKeyAction;
|
||||||
InitPluginEvent(pluginEvent, action, key);
|
InitPluginEvent(pluginEvent, action, key);
|
||||||
|
@ -1500,13 +1500,13 @@ nsWindow::InitKeyEvent(WidgetKeyboardEvent& event, AndroidGeckoEvent& key,
|
||||||
// Note that on Android 4.x, Alt modifier isn't set when the key input
|
// Note that on Android 4.x, Alt modifier isn't set when the key input
|
||||||
// causes text input even while right Alt key is pressed. However, this
|
// causes text input even while right Alt key is pressed. However, this
|
||||||
// is necessary for Android 2.3 compatibility.
|
// is necessary for Android 2.3 compatibility.
|
||||||
if (event.message == NS_KEY_PRESS &&
|
if (event.mMessage == NS_KEY_PRESS &&
|
||||||
key.UnicodeChar() && key.UnicodeChar() != key.BaseUnicodeChar()) {
|
key.UnicodeChar() && key.UnicodeChar() != key.BaseUnicodeChar()) {
|
||||||
event.modifiers &= ~(MODIFIER_ALT | MODIFIER_CONTROL | MODIFIER_META);
|
event.modifiers &= ~(MODIFIER_ALT | MODIFIER_CONTROL | MODIFIER_META);
|
||||||
}
|
}
|
||||||
|
|
||||||
event.mIsRepeat =
|
event.mIsRepeat =
|
||||||
(event.message == NS_KEY_DOWN || event.message == NS_KEY_PRESS) &&
|
(event.mMessage == NS_KEY_DOWN || event.mMessage == NS_KEY_PRESS) &&
|
||||||
(!!(key.Flags() & AKEY_EVENT_FLAG_LONG_PRESS) || !!key.RepeatCount());
|
(!!(key.Flags() & AKEY_EVENT_FLAG_LONG_PRESS) || !!key.RepeatCount());
|
||||||
event.location =
|
event.location =
|
||||||
WidgetKeyboardEvent::ComputeLocationFromCodeValue(event.mCodeNameIndex);
|
WidgetKeyboardEvent::ComputeLocationFromCodeValue(event.mCodeNameIndex);
|
||||||
|
|
|
@ -225,7 +225,7 @@ GetNativeKeyEventType(NSEvent* aNativeEvent)
|
||||||
static const char*
|
static const char*
|
||||||
GetGeckoKeyEventType(const WidgetEvent& aEvent)
|
GetGeckoKeyEventType(const WidgetEvent& aEvent)
|
||||||
{
|
{
|
||||||
switch (aEvent.message) {
|
switch (aEvent.mMessage) {
|
||||||
case NS_KEY_DOWN: return "NS_KEY_DOWN";
|
case NS_KEY_DOWN: return "NS_KEY_DOWN";
|
||||||
case NS_KEY_UP: return "NS_KEY_UP";
|
case NS_KEY_UP: return "NS_KEY_UP";
|
||||||
case NS_KEY_PRESS: return "NS_KEY_PRESS";
|
case NS_KEY_PRESS: return "NS_KEY_PRESS";
|
||||||
|
@ -761,7 +761,7 @@ TISInputSourceWrapper::InitKeyEvent(NSEvent *aNativeKeyEvent,
|
||||||
|
|
||||||
MOZ_LOG(gLog, LogLevel::Info,
|
MOZ_LOG(gLog, LogLevel::Info,
|
||||||
("%p TISInputSourceWrapper::InitKeyEvent, aNativeKeyEvent=%p, "
|
("%p TISInputSourceWrapper::InitKeyEvent, aNativeKeyEvent=%p, "
|
||||||
"aKeyEvent.message=%s, aInsertString=%p, IsOpenedIMEMode()=%s",
|
"aKeyEvent.mMessage=%s, aInsertString=%p, IsOpenedIMEMode()=%s",
|
||||||
this, aNativeKeyEvent, GetGeckoKeyEventType(aKeyEvent), aInsertString,
|
this, aNativeKeyEvent, GetGeckoKeyEventType(aKeyEvent), aInsertString,
|
||||||
TrueOrFalse(IsOpenedIMEMode())));
|
TrueOrFalse(IsOpenedIMEMode())));
|
||||||
|
|
||||||
|
@ -948,7 +948,7 @@ TISInputSourceWrapper::InitKeyEvent(NSEvent *aNativeKeyEvent,
|
||||||
this, OnOrOff(aKeyEvent.IsShift()), OnOrOff(aKeyEvent.IsControl()),
|
this, OnOrOff(aKeyEvent.IsShift()), OnOrOff(aKeyEvent.IsControl()),
|
||||||
OnOrOff(aKeyEvent.IsAlt()), OnOrOff(aKeyEvent.IsMeta())));
|
OnOrOff(aKeyEvent.IsAlt()), OnOrOff(aKeyEvent.IsMeta())));
|
||||||
|
|
||||||
if (aKeyEvent.message == NS_KEY_PRESS &&
|
if (aKeyEvent.mMessage == NS_KEY_PRESS &&
|
||||||
(isPrintableKey || !insertString.IsEmpty())) {
|
(isPrintableKey || !insertString.IsEmpty())) {
|
||||||
InitKeyPressEvent(aNativeKeyEvent,
|
InitKeyPressEvent(aNativeKeyEvent,
|
||||||
insertString.IsEmpty() ? 0 : insertString[0],
|
insertString.IsEmpty() ? 0 : insertString[0],
|
||||||
|
@ -1038,7 +1038,7 @@ TISInputSourceWrapper::InitKeyPressEvent(NSEvent *aNativeKeyEvent,
|
||||||
{
|
{
|
||||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||||
|
|
||||||
NS_ASSERTION(aKeyEvent.message == NS_KEY_PRESS,
|
NS_ASSERTION(aKeyEvent.mMessage == NS_KEY_PRESS,
|
||||||
"aKeyEvent must be NS_KEY_PRESS event");
|
"aKeyEvent must be NS_KEY_PRESS event");
|
||||||
|
|
||||||
if (MOZ_LOG_TEST(gLog, LogLevel::Info)) {
|
if (MOZ_LOG_TEST(gLog, LogLevel::Info)) {
|
||||||
|
@ -1050,7 +1050,7 @@ TISInputSourceWrapper::InitKeyPressEvent(NSEvent *aNativeKeyEvent,
|
||||||
MOZ_LOG(gLog, LogLevel::Info,
|
MOZ_LOG(gLog, LogLevel::Info,
|
||||||
("%p TISInputSourceWrapper::InitKeyPressEvent, aNativeKeyEvent=%p, "
|
("%p TISInputSourceWrapper::InitKeyPressEvent, aNativeKeyEvent=%p, "
|
||||||
"[aNativeKeyEvent characters]=\"%s\", aInsertChar=0x%X(%s), "
|
"[aNativeKeyEvent characters]=\"%s\", aInsertChar=0x%X(%s), "
|
||||||
"aKeyEvent.message=%s, aKbType=0x%X, IsOpenedIMEMode()=%s",
|
"aKeyEvent.mMessage=%s, aKbType=0x%X, IsOpenedIMEMode()=%s",
|
||||||
this, aNativeKeyEvent, utf8Chars.get(), aInsertChar,
|
this, aNativeKeyEvent, utf8Chars.get(), aInsertChar,
|
||||||
utf8ExpectedChar.get(), GetGeckoKeyEventType(aKeyEvent), aKbType,
|
utf8ExpectedChar.get(), GetGeckoKeyEventType(aKeyEvent), aKbType,
|
||||||
TrueOrFalse(IsOpenedIMEMode())));
|
TrueOrFalse(IsOpenedIMEMode())));
|
||||||
|
@ -3777,7 +3777,7 @@ TextInputHandlerBase::OnDestroyWidget(nsChildView* aDestroyingWidget)
|
||||||
bool
|
bool
|
||||||
TextInputHandlerBase::DispatchEvent(WidgetGUIEvent& aEvent)
|
TextInputHandlerBase::DispatchEvent(WidgetGUIEvent& aEvent)
|
||||||
{
|
{
|
||||||
if (aEvent.message == NS_KEY_PRESS) {
|
if (aEvent.mMessage == NS_KEY_PRESS) {
|
||||||
WidgetInputEvent& inputEvent = *aEvent.AsInputEvent();
|
WidgetInputEvent& inputEvent = *aEvent.AsInputEvent();
|
||||||
if (!inputEvent.IsMeta()) {
|
if (!inputEvent.IsMeta()) {
|
||||||
MOZ_LOG(gLog, LogLevel::Info,
|
MOZ_LOG(gLog, LogLevel::Info,
|
||||||
|
@ -3919,7 +3919,7 @@ TextInputHandlerBase::AttachNativeKeyEvent(WidgetKeyboardEvent& aKeyEvent)
|
||||||
aKeyEvent.modifiers));
|
aKeyEvent.modifiers));
|
||||||
|
|
||||||
NSEventType eventType;
|
NSEventType eventType;
|
||||||
if (aKeyEvent.message == NS_KEY_UP) {
|
if (aKeyEvent.mMessage == NS_KEY_UP) {
|
||||||
eventType = NSKeyUp;
|
eventType = NSKeyUp;
|
||||||
} else {
|
} else {
|
||||||
eventType = NSKeyDown;
|
eventType = NSKeyDown;
|
||||||
|
|
|
@ -2201,7 +2201,7 @@ IMContextWrapper::Selection::Assign(const IMENotification& aIMENotification)
|
||||||
void
|
void
|
||||||
IMContextWrapper::Selection::Assign(const WidgetQueryContentEvent& aEvent)
|
IMContextWrapper::Selection::Assign(const WidgetQueryContentEvent& aEvent)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aEvent.message == NS_QUERY_SELECTED_TEXT);
|
MOZ_ASSERT(aEvent.mMessage == NS_QUERY_SELECTED_TEXT);
|
||||||
MOZ_ASSERT(aEvent.mSucceeded);
|
MOZ_ASSERT(aEvent.mSucceeded);
|
||||||
mOffset = aEvent.mReply.mOffset;
|
mOffset = aEvent.mReply.mOffset;
|
||||||
mLength = aEvent.mReply.mString.Length();
|
mLength = aEvent.mReply.mString.Length();
|
||||||
|
|
|
@ -983,13 +983,13 @@ KeymapWrapper::InitKeyEvent(WidgetKeyboardEvent& aKeyEvent,
|
||||||
aGdkKeyEvent->keyval, aGdkKeyEvent->state,
|
aGdkKeyEvent->keyval, aGdkKeyEvent->state,
|
||||||
aGdkKeyEvent->hardware_keycode,
|
aGdkKeyEvent->hardware_keycode,
|
||||||
GetBoolName(aGdkKeyEvent->is_modifier),
|
GetBoolName(aGdkKeyEvent->is_modifier),
|
||||||
((aKeyEvent.message == NS_KEY_DOWN) ? "NS_KEY_DOWN" :
|
((aKeyEvent.mMessage == NS_KEY_DOWN) ? "NS_KEY_DOWN" :
|
||||||
(aKeyEvent.message == NS_KEY_PRESS) ? "NS_KEY_PRESS" :
|
(aKeyEvent.mMessage == NS_KEY_PRESS) ? "NS_KEY_PRESS" :
|
||||||
"NS_KEY_UP"),
|
"NS_KEY_UP"),
|
||||||
GetBoolName(aKeyEvent.IsShift()), GetBoolName(aKeyEvent.IsControl()),
|
GetBoolName(aKeyEvent.IsShift()), GetBoolName(aKeyEvent.IsControl()),
|
||||||
GetBoolName(aKeyEvent.IsAlt()), GetBoolName(aKeyEvent.IsMeta())));
|
GetBoolName(aKeyEvent.IsAlt()), GetBoolName(aKeyEvent.IsMeta())));
|
||||||
|
|
||||||
if (aKeyEvent.message == NS_KEY_PRESS) {
|
if (aKeyEvent.mMessage == NS_KEY_PRESS) {
|
||||||
keymapWrapper->InitKeypressEvent(aKeyEvent, aGdkKeyEvent);
|
keymapWrapper->InitKeypressEvent(aKeyEvent, aGdkKeyEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1323,7 +1323,7 @@ void
|
||||||
KeymapWrapper::InitKeypressEvent(WidgetKeyboardEvent& aKeyEvent,
|
KeymapWrapper::InitKeypressEvent(WidgetKeyboardEvent& aKeyEvent,
|
||||||
GdkEventKey* aGdkKeyEvent)
|
GdkEventKey* aGdkKeyEvent)
|
||||||
{
|
{
|
||||||
NS_ENSURE_TRUE_VOID(aKeyEvent.message == NS_KEY_PRESS);
|
NS_ENSURE_TRUE_VOID(aKeyEvent.mMessage == NS_KEY_PRESS);
|
||||||
|
|
||||||
aKeyEvent.charCode = GetCharCodeFor(aGdkKeyEvent);
|
aKeyEvent.charCode = GetCharCodeFor(aGdkKeyEvent);
|
||||||
if (!aKeyEvent.charCode) {
|
if (!aKeyEvent.charCode) {
|
||||||
|
|
|
@ -992,7 +992,7 @@ nsBaseWidget::ProcessUntransformedAPZEvent(WidgetInputEvent* aEvent,
|
||||||
// TODO: Eventually we'll be able to move the SendSetTargetAPZCNotification
|
// TODO: Eventually we'll be able to move the SendSetTargetAPZCNotification
|
||||||
// call into APZEventState::Process*Event() as well.
|
// call into APZEventState::Process*Event() as well.
|
||||||
if (WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent()) {
|
if (WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent()) {
|
||||||
if (touchEvent->message == NS_TOUCH_START) {
|
if (touchEvent->mMessage == NS_TOUCH_START) {
|
||||||
if (gfxPrefs::TouchActionEnabled()) {
|
if (gfxPrefs::TouchActionEnabled()) {
|
||||||
APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(this, *touchEvent,
|
APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(this, *touchEvent,
|
||||||
aInputBlockId, mSetAllowedTouchBehaviorCallback);
|
aInputBlockId, mSetAllowedTouchBehaviorCallback);
|
||||||
|
@ -2628,7 +2628,7 @@ nsBaseWidget::debug_GuiEventToString(WidgetGUIEvent* aGuiEvent)
|
||||||
#define _ASSIGN_eventName(_value,_name)\
|
#define _ASSIGN_eventName(_value,_name)\
|
||||||
case _value: eventName.AssignLiteral(_name) ; break
|
case _value: eventName.AssignLiteral(_name) ; break
|
||||||
|
|
||||||
switch(aGuiEvent->message)
|
switch(aGuiEvent->mMessage)
|
||||||
{
|
{
|
||||||
_ASSIGN_eventName(NS_BLUR_CONTENT,"NS_BLUR_CONTENT");
|
_ASSIGN_eventName(NS_BLUR_CONTENT,"NS_BLUR_CONTENT");
|
||||||
_ASSIGN_eventName(NS_DRAGDROP_GESTURE,"NS_DND_GESTURE");
|
_ASSIGN_eventName(NS_DRAGDROP_GESTURE,"NS_DND_GESTURE");
|
||||||
|
@ -2670,7 +2670,7 @@ case _value: eventName.AssignLiteral(_name) ; break
|
||||||
{
|
{
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
||||||
snprintf_literal(buf,"UNKNOWN: %d",aGuiEvent->message);
|
snprintf_literal(buf,"UNKNOWN: %d",aGuiEvent->mMessage);
|
||||||
|
|
||||||
CopyASCIItoUTF16(buf, eventName);
|
CopyASCIItoUTF16(buf, eventName);
|
||||||
}
|
}
|
||||||
|
@ -2802,15 +2802,13 @@ nsBaseWidget::debug_DumpEvent(FILE * aFileOut,
|
||||||
const nsAutoCString & aWidgetName,
|
const nsAutoCString & aWidgetName,
|
||||||
int32_t aWindowID)
|
int32_t aWindowID)
|
||||||
{
|
{
|
||||||
if (aGuiEvent->message == NS_MOUSE_MOVE)
|
if (aGuiEvent->mMessage == NS_MOUSE_MOVE) {
|
||||||
{
|
|
||||||
if (!debug_GetCachedBoolPref("nglayout.debug.motion_event_dumping"))
|
if (!debug_GetCachedBoolPref("nglayout.debug.motion_event_dumping"))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aGuiEvent->message == NS_MOUSE_ENTER_WIDGET ||
|
if (aGuiEvent->mMessage == NS_MOUSE_ENTER_WIDGET ||
|
||||||
aGuiEvent->message == NS_MOUSE_EXIT_WIDGET)
|
aGuiEvent->mMessage == NS_MOUSE_EXIT_WIDGET) {
|
||||||
{
|
|
||||||
if (!debug_GetCachedBoolPref("nglayout.debug.crossing_event_dumping"))
|
if (!debug_GetCachedBoolPref("nglayout.debug.crossing_event_dumping"))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ struct ParamTraits<mozilla::WidgetEvent>
|
||||||
{
|
{
|
||||||
WriteParam(aMsg,
|
WriteParam(aMsg,
|
||||||
static_cast<mozilla::EventClassIDType>(aParam.mClass));
|
static_cast<mozilla::EventClassIDType>(aParam.mClass));
|
||||||
WriteParam(aMsg, aParam.message);
|
WriteParam(aMsg, aParam.mMessage);
|
||||||
WriteParam(aMsg, aParam.refPoint);
|
WriteParam(aMsg, aParam.refPoint);
|
||||||
WriteParam(aMsg, aParam.time);
|
WriteParam(aMsg, aParam.time);
|
||||||
WriteParam(aMsg, aParam.timeStamp);
|
WriteParam(aMsg, aParam.timeStamp);
|
||||||
|
@ -59,7 +59,7 @@ struct ParamTraits<mozilla::WidgetEvent>
|
||||||
{
|
{
|
||||||
mozilla::EventClassIDType eventClassID = 0;
|
mozilla::EventClassIDType eventClassID = 0;
|
||||||
bool ret = ReadParam(aMsg, aIter, &eventClassID) &&
|
bool ret = ReadParam(aMsg, aIter, &eventClassID) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->message) &&
|
ReadParam(aMsg, aIter, &aResult->mMessage) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->refPoint) &&
|
ReadParam(aMsg, aIter, &aResult->refPoint) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->time) &&
|
ReadParam(aMsg, aIter, &aResult->time) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->timeStamp) &&
|
ReadParam(aMsg, aIter, &aResult->timeStamp) &&
|
||||||
|
|
|
@ -1100,7 +1100,7 @@ InitKeyEvent(WidgetKeyboardEvent& aEvent, QKeyEvent* aQEvent)
|
||||||
aQEvent->modifiers() & Qt::MetaModifier);
|
aQEvent->modifiers() & Qt::MetaModifier);
|
||||||
|
|
||||||
aEvent.mIsRepeat =
|
aEvent.mIsRepeat =
|
||||||
(aEvent.message == NS_KEY_DOWN || aEvent.message == NS_KEY_PRESS) &&
|
(aEvent.mMessage == NS_KEY_DOWN || aEvent.mMessage == NS_KEY_PRESS) &&
|
||||||
aQEvent->isAutoRepeat();
|
aQEvent->isAutoRepeat();
|
||||||
aEvent.time = 0;
|
aEvent.time = 0;
|
||||||
|
|
||||||
|
|
|
@ -1143,7 +1143,7 @@ NativeKey::InitKeyEvent(WidgetKeyboardEvent& aKeyEvent,
|
||||||
nsIntPoint point(0, 0);
|
nsIntPoint point(0, 0);
|
||||||
mWidget->InitEvent(aKeyEvent, &point);
|
mWidget->InitEvent(aKeyEvent, &point);
|
||||||
|
|
||||||
switch (aKeyEvent.message) {
|
switch (aKeyEvent.mMessage) {
|
||||||
case NS_KEY_DOWN:
|
case NS_KEY_DOWN:
|
||||||
aKeyEvent.keyCode = mDOMKeyCode;
|
aKeyEvent.keyCode = mDOMKeyCode;
|
||||||
// Unique id for this keydown event and its associated keypress.
|
// Unique id for this keydown event and its associated keypress.
|
||||||
|
|
|
@ -821,7 +821,7 @@ MouseScrollHandler::LastEventInfo::InitWheelEvent(
|
||||||
WidgetWheelEvent& aWheelEvent,
|
WidgetWheelEvent& aWheelEvent,
|
||||||
const ModifierKeyState& aModKeyState)
|
const ModifierKeyState& aModKeyState)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aWheelEvent.message == NS_WHEEL_WHEEL);
|
MOZ_ASSERT(aWheelEvent.mMessage == NS_WHEEL_WHEEL);
|
||||||
|
|
||||||
// XXX Why don't we use lParam value? We should use lParam value because
|
// XXX Why don't we use lParam value? We should use lParam value because
|
||||||
// our internal message is always posted by original message handler.
|
// our internal message is always posted by original message handler.
|
||||||
|
|
|
@ -334,13 +334,13 @@ nsWinGesture::ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam,
|
||||||
// The low 32 bits are the distance in pixels.
|
// The low 32 bits are the distance in pixels.
|
||||||
mZoomIntermediate = (float)gi.ullArguments;
|
mZoomIntermediate = (float)gi.ullArguments;
|
||||||
|
|
||||||
evt.message = NS_SIMPLE_GESTURE_MAGNIFY_START;
|
evt.mMessage = NS_SIMPLE_GESTURE_MAGNIFY_START;
|
||||||
evt.delta = 0.0;
|
evt.delta = 0.0;
|
||||||
}
|
}
|
||||||
else if (gi.dwFlags & GF_END) {
|
else if (gi.dwFlags & GF_END) {
|
||||||
// Send a zoom end event, the delta is the change
|
// Send a zoom end event, the delta is the change
|
||||||
// in touch points.
|
// in touch points.
|
||||||
evt.message = NS_SIMPLE_GESTURE_MAGNIFY;
|
evt.mMessage = NS_SIMPLE_GESTURE_MAGNIFY;
|
||||||
// (positive for a "zoom in")
|
// (positive for a "zoom in")
|
||||||
evt.delta = -1.0 * (mZoomIntermediate - (float)gi.ullArguments);
|
evt.delta = -1.0 * (mZoomIntermediate - (float)gi.ullArguments);
|
||||||
mZoomIntermediate = (float)gi.ullArguments;
|
mZoomIntermediate = (float)gi.ullArguments;
|
||||||
|
@ -348,7 +348,7 @@ nsWinGesture::ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam,
|
||||||
else {
|
else {
|
||||||
// Send a zoom intermediate event, the delta is the change
|
// Send a zoom intermediate event, the delta is the change
|
||||||
// in touch points.
|
// in touch points.
|
||||||
evt.message = NS_SIMPLE_GESTURE_MAGNIFY_UPDATE;
|
evt.mMessage = NS_SIMPLE_GESTURE_MAGNIFY_UPDATE;
|
||||||
// (positive for a "zoom in")
|
// (positive for a "zoom in")
|
||||||
evt.delta = -1.0 * (mZoomIntermediate - (float)gi.ullArguments);
|
evt.delta = -1.0 * (mZoomIntermediate - (float)gi.ullArguments);
|
||||||
mZoomIntermediate = (float)gi.ullArguments;
|
mZoomIntermediate = (float)gi.ullArguments;
|
||||||
|
@ -385,11 +385,11 @@ nsWinGesture::ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam,
|
||||||
evt.direction = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
|
evt.direction = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
|
||||||
|
|
||||||
if (gi.dwFlags & GF_BEGIN)
|
if (gi.dwFlags & GF_BEGIN)
|
||||||
evt.message = NS_SIMPLE_GESTURE_ROTATE_START;
|
evt.mMessage = NS_SIMPLE_GESTURE_ROTATE_START;
|
||||||
else if (gi.dwFlags & GF_END)
|
else if (gi.dwFlags & GF_END)
|
||||||
evt.message = NS_SIMPLE_GESTURE_ROTATE;
|
evt.mMessage = NS_SIMPLE_GESTURE_ROTATE;
|
||||||
else
|
else
|
||||||
evt.message = NS_SIMPLE_GESTURE_ROTATE_UPDATE;
|
evt.mMessage = NS_SIMPLE_GESTURE_ROTATE_UPDATE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -397,7 +397,7 @@ nsWinGesture::ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam,
|
||||||
{
|
{
|
||||||
// Normally maps to "restore" from whatever you may have recently changed. A simple
|
// Normally maps to "restore" from whatever you may have recently changed. A simple
|
||||||
// double click.
|
// double click.
|
||||||
evt.message = NS_SIMPLE_GESTURE_TAP;
|
evt.mMessage = NS_SIMPLE_GESTURE_TAP;
|
||||||
evt.clickCount = 1;
|
evt.clickCount = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -405,7 +405,7 @@ nsWinGesture::ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam,
|
||||||
case GID_PRESSANDTAP:
|
case GID_PRESSANDTAP:
|
||||||
{
|
{
|
||||||
// Two finger right click. Defaults to right click if it falls through.
|
// Two finger right click. Defaults to right click if it falls through.
|
||||||
evt.message = NS_SIMPLE_GESTURE_PRESSTAP;
|
evt.mMessage = NS_SIMPLE_GESTURE_PRESSTAP;
|
||||||
evt.clickCount = 1;
|
evt.clickCount = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -4080,7 +4080,7 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam,
|
||||||
LONG curMsgTime = ::GetMessageTime();
|
LONG curMsgTime = ::GetMessageTime();
|
||||||
|
|
||||||
if (aEventType == NS_MOUSE_DOUBLECLICK) {
|
if (aEventType == NS_MOUSE_DOUBLECLICK) {
|
||||||
event.message = NS_MOUSE_BUTTON_DOWN;
|
event.mMessage = NS_MOUSE_BUTTON_DOWN;
|
||||||
event.button = aButton;
|
event.button = aButton;
|
||||||
sLastClickCount = 2;
|
sLastClickCount = 2;
|
||||||
sLastMouseDownTime = curMsgTime;
|
sLastMouseDownTime = curMsgTime;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче