@@ -109,7 +109,7 @@ using namespace mozilla::dom;
109
109
110
110
#define NS_USER_INTERACTION_INTERVAL 5000 // ms
111
111
112
- static const nsIntPoint kInvalidRefPoint = nsIntPoint (-1 ,-1 );
112
+ static const LayoutDeviceIntPoint kInvalidRefPoint = LayoutDeviceIntPoint (-1 ,-1 );
113
113
114
114
static bool sLeftClickOnly = true ;
115
115
static bool sKeyCausesActivation = true ;
@@ -120,9 +120,9 @@ bool nsEventStateManager::sNormalLMouseEventInProcess = false;
120
120
nsEventStateManager* nsEventStateManager::sActiveESM = nullptr ;
121
121
nsIDocument* nsEventStateManager::sMouseOverDocument = nullptr ;
122
122
nsWeakFrame nsEventStateManager::sLastDragOverFrame = nullptr ;
123
- nsIntPoint nsEventStateManager::sLastRefPoint = kInvalidRefPoint ;
124
- nsIntPoint nsEventStateManager::sLastScreenPoint = nsIntPoint(0 ,0 );
125
- nsIntPoint nsEventStateManager::sSynthCenteringPoint = kInvalidRefPoint ;
123
+ LayoutDeviceIntPoint nsEventStateManager::sLastRefPoint = kInvalidRefPoint ;
124
+ nsIntPoint nsEventStateManager::sLastScreenPoint = nsIntPoint(0 , 0 );
125
+ LayoutDeviceIntPoint nsEventStateManager::sSynthCenteringPoint = kInvalidRefPoint ;
126
126
CSSIntPoint nsEventStateManager::sLastClientPoint = CSSIntPoint(0 , 0 );
127
127
bool nsEventStateManager::sIsPointerLocked = false ;
128
128
// Reference to the pointer locked element.
@@ -567,7 +567,8 @@ nsMouseWheelTransaction::GetScreenPoint(nsGUIEvent* aEvent)
567
567
{
568
568
NS_ASSERTION (aEvent, " aEvent is null" );
569
569
NS_ASSERTION (aEvent->widget, " aEvent-widget is null" );
570
- return aEvent->refPoint + aEvent->widget ->WidgetToScreenOffset ();
570
+ return LayoutDeviceIntPoint::ToUntyped (aEvent->refPoint ) +
571
+ aEvent->widget ->WidgetToScreenOffset ();
571
572
}
572
573
573
574
uint32_t
@@ -1547,19 +1548,18 @@ nsEventStateManager::GetChildProcessOffset(nsFrameLoader* aFrameLoader,
1547
1548
nsEventStateManager::MapEventCoordinatesForChildProcess (
1548
1549
const LayoutDeviceIntPoint& aOffset, nsEvent* aEvent)
1549
1550
{
1550
- nsIntPoint aOffsetIntPoint (aOffset.x , aOffset.y );
1551
1551
if (aEvent->eventStructType != NS_TOUCH_EVENT) {
1552
- aEvent->refPoint = aOffsetIntPoint ;
1552
+ aEvent->refPoint = aOffset ;
1553
1553
} else {
1554
- aEvent->refPoint = nsIntPoint ();
1554
+ aEvent->refPoint = LayoutDeviceIntPoint ();
1555
1555
nsTouchEvent* touchEvent = static_cast <nsTouchEvent*>(aEvent);
1556
1556
// Then offset all the touch points by that distance, to put them
1557
1557
// in the space where top-left is 0,0.
1558
1558
const nsTArray< nsRefPtr<Touch> >& touches = touchEvent->touches ;
1559
1559
for (uint32_t i = 0 ; i < touches.Length (); ++i) {
1560
1560
nsIDOMTouch* touch = touches[i];
1561
1561
if (touch) {
1562
- touch->mRefPoint += aOffsetIntPoint ;
1562
+ touch->mRefPoint += LayoutDeviceIntPoint::ToUntyped (aOffset) ;
1563
1563
}
1564
1564
}
1565
1565
}
@@ -1921,7 +1921,7 @@ nsEventStateManager::BeginTrackingDragGesture(nsPresContext* aPresContext,
1921
1921
// Note that |inDownEvent| could be either a mouse down event or a
1922
1922
// synthesized mouse move event.
1923
1923
mGestureDownPoint = inDownEvent->refPoint +
1924
- inDownEvent->widget ->WidgetToScreenOffset ();
1924
+ LayoutDeviceIntPoint::FromUntyped ( inDownEvent->widget ->WidgetToScreenOffset () );
1925
1925
1926
1926
inDownFrame->GetContentForEvent (inDownEvent,
1927
1927
getter_AddRefs (mGestureDownContent ));
@@ -1959,8 +1959,8 @@ nsEventStateManager::FillInEventFromGestureDown(nsMouseEvent* aEvent)
1959
1959
// Set the coordinates in the new event to the coordinates of
1960
1960
// the old event, adjusted for the fact that the widget might be
1961
1961
// different
1962
- nsIntPoint tmpPoint = aEvent->widget-> WidgetToScreenOffset ();
1963
- aEvent->refPoint = mGestureDownPoint - tmpPoint ;
1962
+ aEvent->refPoint = mGestureDownPoint -
1963
+ LayoutDeviceIntPoint::FromUntyped ( aEvent->widget-> WidgetToScreenOffset ()) ;
1964
1964
aEvent->modifiers = mGestureModifiers ;
1965
1965
aEvent->buttons = mGestureDownButtons ;
1966
1966
}
@@ -2016,7 +2016,8 @@ nsEventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
2016
2016
}
2017
2017
2018
2018
// fire drag gesture if mouse has moved enough
2019
- nsIntPoint pt = aEvent->refPoint + aEvent->widget ->WidgetToScreenOffset ();
2019
+ LayoutDeviceIntPoint pt = aEvent->refPoint +
2020
+ LayoutDeviceIntPoint::FromUntyped (aEvent->widget ->WidgetToScreenOffset ());
2020
2021
if (DeprecatedAbs (pt.x - mGestureDownPoint .x ) > pixelThresholdX ||
2021
2022
DeprecatedAbs (pt.y - mGestureDownPoint .y ) > pixelThresholdY) {
2022
2023
if (mClickHoldContextMenu ) {
@@ -3486,9 +3487,9 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
3486
3487
nsMouseEvent* mouseEvent = static_cast <nsMouseEvent*>(aEvent);
3487
3488
event.refPoint = mouseEvent->refPoint ;
3488
3489
if (mouseEvent->widget ) {
3489
- event.refPoint += mouseEvent->widget ->WidgetToScreenOffset ();
3490
+ event.refPoint += LayoutDeviceIntPoint::FromUntyped ( mouseEvent->widget ->WidgetToScreenOffset () );
3490
3491
}
3491
- event.refPoint -= widget->WidgetToScreenOffset ();
3492
+ event.refPoint -= LayoutDeviceIntPoint::FromUntyped ( widget->WidgetToScreenOffset () );
3492
3493
event.modifiers = mouseEvent->modifiers ;
3493
3494
event.buttons = mouseEvent->buttons ;
3494
3495
event.inputSource = mouseEvent->inputSource ;
@@ -4145,12 +4146,12 @@ nsEventStateManager::NotifyMouseOver(nsGUIEvent* aEvent, nsIContent* aContent)
4145
4146
// mode (see bug 799523 comment 35, and bug 729011). Using integer CSS pix
4146
4147
// makes us throw away the fractional error that results, rather than having
4147
4148
// it manifest as a potential one-device-pix discrepancy.
4148
- static nsIntPoint
4149
+ static LayoutDeviceIntPoint
4149
4150
GetWindowInnerRectCenter (nsPIDOMWindow* aWindow,
4150
4151
nsIWidget* aWidget,
4151
4152
nsPresContext* aContext)
4152
4153
{
4153
- NS_ENSURE_TRUE (aWindow && aWidget && aContext, nsIntPoint (0 ,0 ));
4154
+ NS_ENSURE_TRUE (aWindow && aWidget && aContext, LayoutDeviceIntPoint (0 , 0 ));
4154
4155
4155
4156
float cssInnerX = 0.0 ;
4156
4157
aWindow->GetMozInnerScreenX (&cssInnerX);
@@ -4172,7 +4173,7 @@ GetWindowInnerRectCenter(nsPIDOMWindow* aWindow,
4172
4173
int32_t cssScreenX = aContext->DevPixelsToIntCSSPixels (screen.x );
4173
4174
int32_t cssScreenY = aContext->DevPixelsToIntCSSPixels (screen.y );
4174
4175
4175
- return nsIntPoint (
4176
+ return LayoutDeviceIntPoint (
4176
4177
aContext->CSSPixelsToDevPixels (innerX - cssScreenX + innerWidth / 2 ),
4177
4178
aContext->CSSPixelsToDevPixels (innerY - cssScreenY + innerHeight / 2 ));
4178
4179
}
@@ -4200,9 +4201,9 @@ nsEventStateManager::GenerateMouseEnterExit(nsGUIEvent* aEvent)
4200
4201
// (locked) pointer can continue moving and won't stop at the screen
4201
4202
// boundary. We cancel the synthetic event so that we don't end up
4202
4203
// dispatching the centering move event to content.
4203
- nsIntPoint center = GetWindowInnerRectCenter ( mDocument -> GetWindow (),
4204
- aEvent->widget ,
4205
- mPresContext );
4204
+ LayoutDeviceIntPoint center =
4205
+ GetWindowInnerRectCenter ( mDocument -> GetWindow (), aEvent->widget ,
4206
+ mPresContext );
4206
4207
aEvent->lastRefPoint = center;
4207
4208
if (aEvent->refPoint != center) {
4208
4209
// Mouse move doesn't finish at the center of the window. Dispatch a
@@ -4212,7 +4213,7 @@ nsEventStateManager::GenerateMouseEnterExit(nsGUIEvent* aEvent)
4212
4213
// in the other branch here.
4213
4214
sSynthCenteringPoint = center;
4214
4215
aEvent->widget ->SynthesizeNativeMouseMove (
4215
- center + aEvent->widget ->WidgetToScreenOffset ());
4216
+ LayoutDeviceIntPoint::ToUntyped ( center) + aEvent->widget ->WidgetToScreenOffset ());
4216
4217
} else if (aEvent->refPoint == sSynthCenteringPoint ) {
4217
4218
// This is the "synthetic native" event we dispatched to re-center the
4218
4219
// pointer. Cancel it so we don't expose the centering move to content.
@@ -4302,7 +4303,7 @@ nsEventStateManager::SetPointerLock(nsIWidget* aWidget,
4302
4303
aWidget,
4303
4304
mPresContext );
4304
4305
aWidget->SynthesizeNativeMouseMove (
4305
- sLastRefPoint + aWidget->WidgetToScreenOffset ());
4306
+ LayoutDeviceIntPoint::ToUntyped ( sLastRefPoint ) + aWidget->WidgetToScreenOffset ());
4306
4307
4307
4308
// Retarget all events to this element via capture.
4308
4309
nsIPresShell::SetCapturingContent (aElement, CAPTURE_POINTERLOCK);
@@ -4318,7 +4319,7 @@ nsEventStateManager::SetPointerLock(nsIWidget* aWidget,
4318
4319
// no movement.
4319
4320
sLastRefPoint = mPreLockPoint ;
4320
4321
aWidget->SynthesizeNativeMouseMove (
4321
- mPreLockPoint + aWidget->WidgetToScreenOffset ());
4322
+ LayoutDeviceIntPoint::ToUntyped ( mPreLockPoint ) + aWidget->WidgetToScreenOffset ());
4322
4323
4323
4324
// Don't retarget events to this element any more.
4324
4325
nsIPresShell::SetCapturingContent (nullptr , CAPTURE_POINTERLOCK);
0 commit comments