From 103ad74923f4962732d206c3315bb551de000fee Mon Sep 17 00:00:00 2001 From: Randall Barker Date: Wed, 17 Feb 2016 16:19:34 -0800 Subject: [PATCH] Bug 1248090 - Fix nsWindow::NPZCSupport unsafe usage of nsWindow::WidgetToScreenOffset r=snorp --- widget/android/nsWindow.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index 44230423cd56..778ef6b7dffa 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -539,8 +539,7 @@ public: return false; } - ScreenIntPoint offset = ViewAs(mWindow->WidgetToScreenOffset(), PixelCastJustification::LayoutDeviceIsScreenForBounds); - ScreenPoint origin = ScreenPoint(aX, aY) - offset; + ScreenPoint origin = ScreenPoint(aX, aY); ScrollWheelInput input(aTime, TimeStamp::Now(), GetModifiers(aMetaState), ScrollWheelInput::SCROLLMODE_SMOOTH, @@ -616,8 +615,7 @@ public: return false; } - ScreenIntPoint offset = ViewAs(mWindow->WidgetToScreenOffset(), PixelCastJustification::LayoutDeviceIsScreenForBounds); - ScreenPoint origin = ScreenPoint(aX, aY) - offset; + ScreenPoint origin = ScreenPoint(aX, aY); MouseInput input(type, MouseInput::NONE, 0, origin, aTime, TimeStamp(), GetModifiers(aMetaState)); @@ -724,9 +722,6 @@ public: MOZ_ASSERT(pointerId.Length() == toolMajor.Length()); MOZ_ASSERT(pointerId.Length() == toolMinor.Length()); - const nsIntPoint& offset = - mWindow->WidgetToScreenOffset().ToUnknownPoint(); - for (size_t i = startIndex; i < endIndex; i++) { float orien = orientation[i] * 180.0f / M_PI; @@ -737,7 +732,7 @@ public: } nsIntPoint point = nsIntPoint(int32_t(floorf(x[i])), - int32_t(floorf(y[i]))) - offset; + int32_t(floorf(y[i]))); // w3c touchevent radii are given with an orientation between 0 and // 90. The radii are found by removing the orientation and