mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-18 14:56:07 +00:00
Bug 866232 - Only fire mozbrowserasyncscroll events on the top-level scrollable for backwards compatibility. r=BenWa
This commit is contained in:
parent
61c09db07a
commit
6762cc18a8
@ -1454,15 +1454,18 @@ void AsyncPanZoomController::SendAsyncScrollEvent() {
|
||||
return;
|
||||
}
|
||||
|
||||
FrameMetrics::ViewID scrollId;
|
||||
CSSRect contentRect;
|
||||
CSSSize scrollableSize;
|
||||
{
|
||||
// XXX bug 890932 - there should be a lock here. but it causes a deadlock.
|
||||
scrollId = mFrameMetrics.mScrollId;
|
||||
scrollableSize = mFrameMetrics.mScrollableRect.Size();
|
||||
contentRect = mFrameMetrics.CalculateCompositedRectInCssPixels();
|
||||
contentRect.MoveTo(mCurrentAsyncScrollOffset);
|
||||
}
|
||||
|
||||
controller->SendAsyncScrollDOMEvent(contentRect, scrollableSize);
|
||||
controller->SendAsyncScrollDOMEvent(scrollId, contentRect, scrollableSize);
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::UpdateScrollOffset(const CSSPoint& aScrollOffset)
|
||||
|
@ -51,7 +51,8 @@ public:
|
||||
* |aContentRect| is in CSS pixels, relative to the current cssPage.
|
||||
* |aScrollableSize| is the current content width/height in CSS pixels.
|
||||
*/
|
||||
virtual void SendAsyncScrollDOMEvent(const CSSRect &aContentRect,
|
||||
virtual void SendAsyncScrollDOMEvent(FrameMetrics::ViewID aScrollId,
|
||||
const CSSRect &aContentRect,
|
||||
const CSSSize &aScrollableSize) = 0;
|
||||
|
||||
/**
|
||||
|
@ -26,7 +26,7 @@ public:
|
||||
MOCK_METHOD1(HandleDoubleTap, void(const CSSIntPoint&));
|
||||
MOCK_METHOD1(HandleSingleTap, void(const CSSIntPoint&));
|
||||
MOCK_METHOD1(HandleLongTap, void(const CSSIntPoint&));
|
||||
MOCK_METHOD2(SendAsyncScrollDOMEvent, void(const CSSRect &aContentRect, const CSSSize &aScrollableSize));
|
||||
MOCK_METHOD3(SendAsyncScrollDOMEvent, void(FrameMetrics::ViewID aScrollId, const CSSRect &aContentRect, const CSSSize &aScrollableSize));
|
||||
MOCK_METHOD2(PostDelayedTask, void(Task* aTask, int aDelayMs));
|
||||
};
|
||||
|
||||
@ -242,7 +242,7 @@ TEST(AsyncPanZoomController, Pan) {
|
||||
apzc->SetFrameMetrics(TestFrameMetrics());
|
||||
apzc->NotifyLayersUpdated(TestFrameMetrics(), true);
|
||||
|
||||
EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_)).Times(4);
|
||||
EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(4);
|
||||
EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1);
|
||||
|
||||
int time = 0;
|
||||
@ -274,7 +274,7 @@ TEST(AsyncPanZoomController, Fling) {
|
||||
apzc->SetFrameMetrics(TestFrameMetrics());
|
||||
apzc->NotifyLayersUpdated(TestFrameMetrics(), true);
|
||||
|
||||
EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_)).Times(2);
|
||||
EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(2);
|
||||
EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1);
|
||||
|
||||
int time = 0;
|
||||
@ -303,7 +303,7 @@ TEST(AsyncPanZoomController, OverScrollPanning) {
|
||||
apzc->SetFrameMetrics(TestFrameMetrics());
|
||||
apzc->NotifyLayersUpdated(TestFrameMetrics(), true);
|
||||
|
||||
EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_)).Times(3);
|
||||
EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(3);
|
||||
EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1);
|
||||
|
||||
// Pan sufficiently to hit overscroll behavior
|
||||
@ -361,7 +361,7 @@ SetScrollableFrameMetrics(Layer* aLayer, FrameMetrics::ViewID aScrollId, MockCon
|
||||
|
||||
// when we do the next tree update, a new APZC will be created for this layer,
|
||||
// and that will invoke these functions once.
|
||||
EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_)).Times(1);
|
||||
EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(1);
|
||||
EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1);
|
||||
}
|
||||
|
||||
|
@ -552,7 +552,8 @@ public:
|
||||
|
||||
void ClearRenderFrame() { mRenderFrame = nullptr; }
|
||||
|
||||
virtual void SendAsyncScrollDOMEvent(const CSSRect& aContentRect,
|
||||
virtual void SendAsyncScrollDOMEvent(FrameMetrics::ViewID aScrollId,
|
||||
const CSSRect& aContentRect,
|
||||
const CSSSize& aContentSize) MOZ_OVERRIDE
|
||||
{
|
||||
if (MessageLoop::current() != mUILoop) {
|
||||
@ -560,10 +561,10 @@ public:
|
||||
FROM_HERE,
|
||||
NewRunnableMethod(this,
|
||||
&RemoteContentController::SendAsyncScrollDOMEvent,
|
||||
aContentRect, aContentSize));
|
||||
aScrollId, aContentRect, aContentSize));
|
||||
return;
|
||||
}
|
||||
if (mRenderFrame) {
|
||||
if (mRenderFrame && aScrollId == FrameMetrics::ROOT_SCROLL_ID) {
|
||||
TabParent* browser = static_cast<TabParent*>(mRenderFrame->Manager());
|
||||
BrowserElementParent::DispatchAsyncScrollEvent(browser, aContentRect,
|
||||
aContentSize);
|
||||
|
@ -2850,7 +2850,9 @@ AndroidBridge::HandleLongTap(const CSSIntPoint& aPoint)
|
||||
}
|
||||
|
||||
void
|
||||
AndroidBridge::SendAsyncScrollDOMEvent(const CSSRect& aContentRect, const CSSSize& aScrollableSize)
|
||||
AndroidBridge::SendAsyncScrollDOMEvent(mozilla::layers::FrameMetrics::ViewID aScrollId,
|
||||
const CSSRect& aContentRect,
|
||||
const CSSSize& aScrollableSize)
|
||||
{
|
||||
// FIXME implement this
|
||||
}
|
||||
|
@ -601,7 +601,9 @@ public:
|
||||
void HandleDoubleTap(const CSSIntPoint& aPoint) MOZ_OVERRIDE;
|
||||
void HandleSingleTap(const CSSIntPoint& aPoint) MOZ_OVERRIDE;
|
||||
void HandleLongTap(const CSSIntPoint& aPoint) MOZ_OVERRIDE;
|
||||
void SendAsyncScrollDOMEvent(const CSSRect& aContentRect, const CSSSize& aScrollableSize) MOZ_OVERRIDE;
|
||||
void SendAsyncScrollDOMEvent(mozilla::layers::FrameMetrics::ViewID aScrollId,
|
||||
const CSSRect& aContentRect,
|
||||
const CSSSize& aScrollableSize) MOZ_OVERRIDE;
|
||||
void PostDelayedTask(Task* aTask, int aDelayMs) MOZ_OVERRIDE;
|
||||
int64_t RunDelayedTasks();
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user