mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 900bd9173e8f (bug 676470) for mochitest-other asserts.
CLOSED TREE
This commit is contained in:
parent
1c576a7b21
commit
6c476fc4fe
@ -481,9 +481,32 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
||||
mCurrentTarget = aTargetFrame;
|
||||
mCurrentTargetContent = nullptr;
|
||||
|
||||
// Focus events don't necessarily need a frame.
|
||||
if (NS_EVENT_NEEDS_FRAME(aEvent)) {
|
||||
NS_ASSERTION(mCurrentTarget, "mCurrentTarget is null. this should not happen. see bug #13007");
|
||||
if (!mCurrentTarget) return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
if (aEvent->HasDragEventMessage() && sIsPointerLocked) {
|
||||
NS_ASSERTION(sIsPointerLocked,
|
||||
"sIsPointerLocked is true. Drag events should be suppressed when the pointer is locked.");
|
||||
}
|
||||
#endif
|
||||
// Store last known screenPoint and clientPoint so pointer lock
|
||||
// can use these values as constants.
|
||||
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
|
||||
if (aEvent->mFlags.mIsTrusted &&
|
||||
((mouseEvent && mouseEvent->IsReal()) ||
|
||||
aEvent->mClass == eWheelEventClass) &&
|
||||
!sIsPointerLocked) {
|
||||
sLastScreenPoint =
|
||||
UIEvent::CalculateScreenPoint(aPresContext, aEvent);
|
||||
sLastClientPoint =
|
||||
UIEvent::CalculateClientPoint(aPresContext, aEvent, nullptr);
|
||||
}
|
||||
|
||||
// Do not take account NS_MOUSE_ENTER/EXIT so that loading a page
|
||||
// when user is not active doesn't change the state to active.
|
||||
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
|
||||
if (aEvent->mFlags.mIsTrusted &&
|
||||
((mouseEvent && mouseEvent->IsReal() &&
|
||||
mouseEvent->message != NS_MOUSE_ENTER &&
|
||||
@ -501,38 +524,10 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
||||
++gMouseOrKeyboardEventCounter;
|
||||
}
|
||||
|
||||
WheelTransaction::OnEvent(aEvent);
|
||||
|
||||
// Focus events don't necessarily need a frame.
|
||||
if (NS_EVENT_NEEDS_FRAME(aEvent)) {
|
||||
NS_ASSERTION(mCurrentTarget,
|
||||
"mCurrentTarget is null. this should not happen. "
|
||||
"see bug #13007");
|
||||
if (!mCurrentTarget) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG
|
||||
if (aEvent->HasDragEventMessage() && sIsPointerLocked) {
|
||||
NS_ASSERTION(sIsPointerLocked,
|
||||
"sIsPointerLocked is true. Drag events should be suppressed when "
|
||||
"the pointer is locked.");
|
||||
}
|
||||
#endif
|
||||
// Store last known screenPoint and clientPoint so pointer lock
|
||||
// can use these values as constants.
|
||||
if (aEvent->mFlags.mIsTrusted &&
|
||||
((mouseEvent && mouseEvent->IsReal()) ||
|
||||
aEvent->mClass == eWheelEventClass) &&
|
||||
!sIsPointerLocked) {
|
||||
sLastScreenPoint =
|
||||
UIEvent::CalculateScreenPoint(aPresContext, aEvent);
|
||||
sLastClientPoint =
|
||||
UIEvent::CalculateClientPoint(aPresContext, aEvent, nullptr);
|
||||
}
|
||||
|
||||
*aStatus = nsEventStatus_eIgnore;
|
||||
|
||||
WheelTransaction::OnEvent(aEvent);
|
||||
|
||||
switch (aEvent->message) {
|
||||
case NS_CONTEXTMENU:
|
||||
if (sIsPointerLocked) {
|
||||
|
Loading…
Reference in New Issue
Block a user