mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
Rename ContentReceivedTouch to ContentReceivedInputBlock. (bug 1013432 part 3, r=kats)
--HG-- extra : rebase_source : ee0d05d4774fac9fb34297953e90e61f1d979d5d
This commit is contained in:
parent
d2831e46f4
commit
636a716c5b
@ -362,7 +362,7 @@ parent:
|
||||
* batched and only processed for panning and zooming if content does not
|
||||
* preventDefault.
|
||||
*/
|
||||
ContentReceivedTouch(ScrollableLayerGuid aGuid, uint64_t aInputBlockId, bool aPreventDefault);
|
||||
ContentReceivedInputBlock(ScrollableLayerGuid aGuid, uint64_t aInputBlockId, bool aPreventDefault);
|
||||
|
||||
/**
|
||||
* Notifies the APZ code of the results of the gecko hit-test for a
|
||||
|
@ -1581,7 +1581,7 @@ TabChild::SendPendingTouchPreventedResponse(bool aPreventDefault,
|
||||
{
|
||||
if (mPendingTouchPreventedResponse) {
|
||||
MOZ_ASSERT(aGuid == mPendingTouchPreventedGuid);
|
||||
SendContentReceivedTouch(mPendingTouchPreventedGuid, mPendingTouchPreventedBlockId, aPreventDefault);
|
||||
SendContentReceivedInputBlock(mPendingTouchPreventedGuid, mPendingTouchPreventedBlockId, aPreventDefault);
|
||||
mPendingTouchPreventedResponse = false;
|
||||
}
|
||||
}
|
||||
@ -2161,7 +2161,7 @@ TabChild::RecvHandleLongTap(const CSSPoint& aPoint, const ScrollableLayerGuid& a
|
||||
TABC_LOG("MOZLONGTAP event handled: %d\n", eventHandled);
|
||||
}
|
||||
|
||||
SendContentReceivedTouch(aGuid, aInputBlockId, eventHandled);
|
||||
SendContentReceivedInputBlock(aGuid, aInputBlockId, eventHandled);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -2606,11 +2606,11 @@ TabChild::RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
|
||||
if (mPendingTouchPreventedResponse) {
|
||||
// We can enter here if we get two TOUCH_STARTs in a row and didn't
|
||||
// respond to the first one. Respond to it now.
|
||||
SendContentReceivedTouch(mPendingTouchPreventedGuid, mPendingTouchPreventedBlockId, false);
|
||||
SendContentReceivedInputBlock(mPendingTouchPreventedGuid, mPendingTouchPreventedBlockId, false);
|
||||
mPendingTouchPreventedResponse = false;
|
||||
}
|
||||
if (isTouchPrevented) {
|
||||
SendContentReceivedTouch(aGuid, aInputBlockId, isTouchPrevented);
|
||||
SendContentReceivedInputBlock(aGuid, aInputBlockId, isTouchPrevented);
|
||||
} else {
|
||||
mPendingTouchPreventedResponse = true;
|
||||
mPendingTouchPreventedGuid = aGuid;
|
||||
|
@ -2108,12 +2108,12 @@ TabParent::RecvUpdateZoomConstraints(const uint32_t& aPresShellId,
|
||||
}
|
||||
|
||||
bool
|
||||
TabParent::RecvContentReceivedTouch(const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId,
|
||||
const bool& aPreventDefault)
|
||||
TabParent::RecvContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId,
|
||||
const bool& aPreventDefault)
|
||||
{
|
||||
if (RenderFrameParent* rfp = GetRenderFrame()) {
|
||||
rfp->ContentReceivedTouch(aGuid, aInputBlockId, aPreventDefault);
|
||||
rfp->ContentReceivedInputBlock(aGuid, aInputBlockId, aPreventDefault);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -207,9 +207,9 @@ public:
|
||||
const ViewID& aViewId,
|
||||
const bool& aIsRoot,
|
||||
const ZoomConstraints& aConstraints) MOZ_OVERRIDE;
|
||||
virtual bool RecvContentReceivedTouch(const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId,
|
||||
const bool& aPreventDefault) MOZ_OVERRIDE;
|
||||
virtual bool RecvContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId,
|
||||
const bool& aPreventDefault) MOZ_OVERRIDE;
|
||||
virtual bool RecvSetTargetAPZC(const uint64_t& aInputBlockId,
|
||||
const nsTArray<ScrollableLayerGuid>& aTargets) MOZ_OVERRIDE;
|
||||
|
||||
|
@ -219,7 +219,7 @@ It also activates inactive scrollframes that were hit by the input events.
|
||||
</li>
|
||||
<li value="8">
|
||||
The call stack unwinds back to the widget code, which sends two notifications to the APZ code on the input thread.
|
||||
The first notification is via APZCTreeManager::ContentReceivedTouch, and informs the APZ whether the input block was cancelled.
|
||||
The first notification is via APZCTreeManager::ContentReceivedInputBlock, and informs the APZ whether the input block was cancelled.
|
||||
The second notification is via APZCTreeManager::SetTargetAPZC, and informs the APZ the results of the Gecko hit-test during event dispatch.
|
||||
Note that Gecko may report that the input event did not hit any scrollable frame at all.
|
||||
These notifications happen only once per input block.
|
||||
|
@ -951,10 +951,9 @@ APZCTreeManager::ZoomToRect(const ScrollableLayerGuid& aGuid,
|
||||
}
|
||||
|
||||
void
|
||||
APZCTreeManager::ContentReceivedTouch(uint64_t aInputBlockId,
|
||||
bool aPreventDefault)
|
||||
APZCTreeManager::ContentReceivedInputBlock(uint64_t aInputBlockId, bool aPreventDefault)
|
||||
{
|
||||
mInputQueue->ContentReceivedTouch(aInputBlockId, aPreventDefault);
|
||||
mInputQueue->ContentReceivedInputBlock(aInputBlockId, aPreventDefault);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -211,8 +211,7 @@ public:
|
||||
* that have come in. If |aPreventDefault| is true, any touch events in the
|
||||
* queue will be discarded.
|
||||
*/
|
||||
void ContentReceivedTouch(uint64_t aInputBlockId,
|
||||
bool aPreventDefault);
|
||||
void ContentReceivedInputBlock(uint64_t aInputBlockId, bool aPreventDefault);
|
||||
|
||||
/**
|
||||
* When the event regions code is enabled, this function should be invoked to
|
||||
|
@ -17,8 +17,6 @@ namespace layers {
|
||||
class AsyncPanZoomController;
|
||||
class OverscrollHandoffChain;
|
||||
class CancelableBlockState;
|
||||
class TouchBlockState;
|
||||
class WheelBlockState;
|
||||
|
||||
/**
|
||||
* A base class that stores state common to various input blocks.
|
||||
|
@ -156,7 +156,7 @@ InputQueue::MaybeRequestContentResponse(const nsRefPtr<AsyncPanZoomController>&
|
||||
ScheduleMainThreadTimeout(aTarget, aBlock->GetBlockId());
|
||||
} else {
|
||||
// Content won't prevent-default this, so we can just pretend like we scheduled
|
||||
// a timeout and it expired. Note that we will still receive a ContentReceivedTouch
|
||||
// a timeout and it expired. Note that we will still receive a ContentReceivedInputBlock
|
||||
// callback for this block, and so we need to make sure we adjust the touch balance.
|
||||
INPQ_LOG("not waiting for content response on block %p\n", block);
|
||||
aBlock->TimeoutContentResponse();
|
||||
@ -263,7 +263,7 @@ InputQueue::MainThreadTimeout(const uint64_t& aInputBlockId) {
|
||||
}
|
||||
|
||||
void
|
||||
InputQueue::ContentReceivedTouch(uint64_t aInputBlockId, bool aPreventDefault) {
|
||||
InputQueue::ContentReceivedInputBlock(uint64_t aInputBlockId, bool aPreventDefault) {
|
||||
AsyncPanZoomController::AssertOnControllerThread();
|
||||
|
||||
INPQ_LOG("got a content response; block=%" PRIu64 "\n", aInputBlockId);
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
* decides whether or not it wants to cancel a block of events. The block
|
||||
* id to which this applies should be provided in |aInputBlockId|.
|
||||
*/
|
||||
void ContentReceivedTouch(uint64_t aInputBlockId, bool aPreventDefault);
|
||||
void ContentReceivedInputBlock(uint64_t aInputBlockId, bool aPreventDefault);
|
||||
/**
|
||||
* This function should be invoked to notify the InputQueue once the target
|
||||
* APZC to handle an input block has been confirmed. In practice this should
|
||||
|
@ -146,8 +146,8 @@ public:
|
||||
return GetInputQueue()->ReceiveInputEvent(this, true, aEvent, aOutInputBlockId);
|
||||
}
|
||||
|
||||
void ContentReceivedTouch(uint64_t aInputBlockId, bool aPreventDefault) {
|
||||
GetInputQueue()->ContentReceivedTouch(aInputBlockId, aPreventDefault);
|
||||
void ContentReceivedInputBlock(uint64_t aInputBlockId, bool aPreventDefault) {
|
||||
GetInputQueue()->ContentReceivedInputBlock(aInputBlockId, aPreventDefault);
|
||||
}
|
||||
|
||||
void SetAllowedTouchBehavior(uint64_t aInputBlockId, const nsTArray<TouchBehaviorFlags>& aBehaviors) {
|
||||
@ -708,7 +708,7 @@ TEST_F(APZCPinchGestureDetectorTester, Pinch_PreventDefault) {
|
||||
PinchWithTouchInput(apzc, 250, 300, 1.25, touchInputId, nullptr, nullptr, &blockId);
|
||||
|
||||
// Send the prevent-default notification for the touch block
|
||||
apzc->ContentReceivedTouch(blockId, true);
|
||||
apzc->ContentReceivedInputBlock(blockId, true);
|
||||
|
||||
// Run all pending tasks (this should include at least the
|
||||
// prevent-default timer).
|
||||
@ -918,7 +918,7 @@ protected:
|
||||
|
||||
// Send the signal that content has handled and preventDefaulted the touch
|
||||
// events. This flushes the event queue.
|
||||
apzc->ContentReceivedTouch(blockId, true);
|
||||
apzc->ContentReceivedInputBlock(blockId, true);
|
||||
// Run all pending tasks (this should include at least the
|
||||
// prevent-default timer).
|
||||
EXPECT_LE(1, mcc->RunThroughDelayedTasks());
|
||||
@ -1189,7 +1189,7 @@ protected:
|
||||
|
||||
// Start the fling down.
|
||||
Pan(apzc, time, touchStart, touchEnd, false, nullptr, nullptr, &blockId);
|
||||
apzc->ContentReceivedTouch(blockId, false);
|
||||
apzc->ContentReceivedInputBlock(blockId, false);
|
||||
while (mcc->RunThroughDelayedTasks());
|
||||
|
||||
// Sample the fling a couple of times to ensure it's going.
|
||||
@ -1209,7 +1209,7 @@ protected:
|
||||
|
||||
// respond to the touchdown that stopped the fling.
|
||||
// even if we do a prevent-default on it, the animation should remain stopped.
|
||||
apzc->ContentReceivedTouch(blockId, aPreventDefault);
|
||||
apzc->ContentReceivedInputBlock(blockId, aPreventDefault);
|
||||
while (mcc->RunThroughDelayedTasks());
|
||||
|
||||
// Verify the page hasn't moved
|
||||
@ -1299,7 +1299,7 @@ protected:
|
||||
apzc->SetAllowedTouchBehavior(blockId, allowedTouchBehaviors);
|
||||
}
|
||||
// Have content "respond" to the touchstart
|
||||
apzc->ContentReceivedTouch(blockId, false);
|
||||
apzc->ContentReceivedInputBlock(blockId, false);
|
||||
|
||||
MockFunction<void(std::string checkPointName)> check;
|
||||
|
||||
@ -1332,7 +1332,7 @@ protected:
|
||||
// in the queue. Deal with those here. We do the content response first
|
||||
// with preventDefault=false, and then we run the timeout task which
|
||||
// "loses the race" and does nothing.
|
||||
apzc->ContentReceivedTouch(blockId, false);
|
||||
apzc->ContentReceivedInputBlock(blockId, false);
|
||||
mcc->CheckHasDelayedTask();
|
||||
mcc->RunDelayedTask();
|
||||
|
||||
@ -1370,7 +1370,7 @@ protected:
|
||||
apzc->SetAllowedTouchBehavior(blockId, allowedTouchBehaviors);
|
||||
}
|
||||
// Have content "respond" to the touchstart
|
||||
apzc->ContentReceivedTouch(blockId, false);
|
||||
apzc->ContentReceivedInputBlock(blockId, false);
|
||||
|
||||
MockFunction<void(std::string checkPointName)> check;
|
||||
|
||||
@ -1398,7 +1398,7 @@ protected:
|
||||
// Send the signal that content has handled the long-tap, and then run
|
||||
// the timeout task (it will be a no-op because the content "wins" the
|
||||
// race. This takes the place of the "contextmenu" event.
|
||||
apzc->ContentReceivedTouch(blockId, true);
|
||||
apzc->ContentReceivedInputBlock(blockId, true);
|
||||
mcc->CheckHasDelayedTask();
|
||||
mcc->RunDelayedTask();
|
||||
|
||||
@ -1502,8 +1502,8 @@ TEST_F(APZCGestureDetectorTester, DoubleTap) {
|
||||
DoubleTapAndCheckStatus(apzc, 10, 10, time, &blockIds);
|
||||
|
||||
// responses to the two touchstarts
|
||||
apzc->ContentReceivedTouch(blockIds[0], false);
|
||||
apzc->ContentReceivedTouch(blockIds[1], false);
|
||||
apzc->ContentReceivedInputBlock(blockIds[0], false);
|
||||
apzc->ContentReceivedInputBlock(blockIds[1], false);
|
||||
|
||||
while (mcc->RunThroughDelayedTasks());
|
||||
|
||||
@ -1522,8 +1522,8 @@ TEST_F(APZCGestureDetectorTester, DoubleTapNotZoomable) {
|
||||
DoubleTapAndCheckStatus(apzc, 10, 10, time, &blockIds);
|
||||
|
||||
// responses to the two touchstarts
|
||||
apzc->ContentReceivedTouch(blockIds[0], false);
|
||||
apzc->ContentReceivedTouch(blockIds[1], false);
|
||||
apzc->ContentReceivedInputBlock(blockIds[0], false);
|
||||
apzc->ContentReceivedInputBlock(blockIds[1], false);
|
||||
|
||||
while (mcc->RunThroughDelayedTasks());
|
||||
|
||||
@ -1542,8 +1542,8 @@ TEST_F(APZCGestureDetectorTester, DoubleTapPreventDefaultFirstOnly) {
|
||||
DoubleTapAndCheckStatus(apzc, 10, 10, time, &blockIds);
|
||||
|
||||
// responses to the two touchstarts
|
||||
apzc->ContentReceivedTouch(blockIds[0], true);
|
||||
apzc->ContentReceivedTouch(blockIds[1], false);
|
||||
apzc->ContentReceivedInputBlock(blockIds[0], true);
|
||||
apzc->ContentReceivedInputBlock(blockIds[1], false);
|
||||
|
||||
while (mcc->RunThroughDelayedTasks());
|
||||
|
||||
@ -1562,8 +1562,8 @@ TEST_F(APZCGestureDetectorTester, DoubleTapPreventDefaultBoth) {
|
||||
DoubleTapAndCheckStatus(apzc, 10, 10, time, &blockIds);
|
||||
|
||||
// responses to the two touchstarts
|
||||
apzc->ContentReceivedTouch(blockIds[0], true);
|
||||
apzc->ContentReceivedTouch(blockIds[1], true);
|
||||
apzc->ContentReceivedInputBlock(blockIds[0], true);
|
||||
apzc->ContentReceivedInputBlock(blockIds[1], true);
|
||||
|
||||
while (mcc->RunThroughDelayedTasks());
|
||||
|
||||
@ -2227,7 +2227,7 @@ TEST_F(APZOverscrollHandoffTester, DeferredInputEventProcessing) {
|
||||
ApzcPanNoFling(childApzc, time, 90, 30, &blockId);
|
||||
|
||||
// Allow the pan to be processed.
|
||||
childApzc->ContentReceivedTouch(blockId, false);
|
||||
childApzc->ContentReceivedInputBlock(blockId, false);
|
||||
|
||||
// Make sure overscroll was handed off correctly.
|
||||
EXPECT_EQ(50, childApzc->GetFrameMetrics().GetScrollOffset().y);
|
||||
@ -2266,7 +2266,7 @@ TEST_F(APZOverscrollHandoffTester, LayerStructureChangesWhileEventsArePending) {
|
||||
ApzcPanNoFling(childApzc, time, 30, 90, &secondBlockId);
|
||||
|
||||
// Allow the first pan to be processed.
|
||||
childApzc->ContentReceivedTouch(blockId, false);
|
||||
childApzc->ContentReceivedInputBlock(blockId, false);
|
||||
|
||||
// Make sure things have scrolled according to the handoff chain in
|
||||
// place at the time the touch-start of the first pan was queued.
|
||||
@ -2275,7 +2275,7 @@ TEST_F(APZOverscrollHandoffTester, LayerStructureChangesWhileEventsArePending) {
|
||||
EXPECT_EQ(0, middleApzc->GetFrameMetrics().GetScrollOffset().y);
|
||||
|
||||
// Allow the second pan to be processed.
|
||||
childApzc->ContentReceivedTouch(secondBlockId, false);
|
||||
childApzc->ContentReceivedInputBlock(secondBlockId, false);
|
||||
|
||||
// Make sure things have scrolled according to the handoff chain in
|
||||
// place at the time the touch-start of the second pan was queued.
|
||||
|
@ -530,17 +530,17 @@ RenderFrameParent::ZoomToRect(uint32_t aPresShellId, ViewID aViewId,
|
||||
}
|
||||
|
||||
void
|
||||
RenderFrameParent::ContentReceivedTouch(const ScrollableLayerGuid& aGuid,
|
||||
uint64_t aInputBlockId,
|
||||
bool aPreventDefault)
|
||||
RenderFrameParent::ContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,
|
||||
uint64_t aInputBlockId,
|
||||
bool aPreventDefault)
|
||||
{
|
||||
if (aGuid.mLayersId != mLayersId) {
|
||||
// Guard against bad data from hijacked child processes
|
||||
NS_ERROR("Unexpected layers id in ContentReceivedTouch; dropping message...");
|
||||
NS_ERROR("Unexpected layers id in ContentReceivedInputBlock; dropping message...");
|
||||
return;
|
||||
}
|
||||
if (GetApzcTreeManager()) {
|
||||
GetApzcTreeManager()->ContentReceivedTouch(aInputBlockId, aPreventDefault);
|
||||
GetApzcTreeManager()->ContentReceivedInputBlock(aInputBlockId, aPreventDefault);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,9 +98,9 @@ public:
|
||||
|
||||
void ZoomToRect(uint32_t aPresShellId, ViewID aViewId, const CSSRect& aRect);
|
||||
|
||||
void ContentReceivedTouch(const ScrollableLayerGuid& aGuid,
|
||||
uint64_t aInputBlockId,
|
||||
bool aPreventDefault);
|
||||
void ContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,
|
||||
uint64_t aInputBlockId,
|
||||
bool aPreventDefault);
|
||||
void SetTargetAPZC(uint64_t aInputBlockId,
|
||||
const nsTArray<ScrollableLayerGuid>& aTargets);
|
||||
|
||||
|
@ -52,7 +52,7 @@ APZCCallbackHandler::NotifyDefaultPrevented(uint64_t aInputBlockId,
|
||||
MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
|
||||
APZCTreeManager* controller = nsWindow::GetAPZCTreeManager();
|
||||
if (controller) {
|
||||
controller->ContentReceivedTouch(aInputBlockId, aDefaultPrevented);
|
||||
controller->ContentReceivedInputBlock(aInputBlockId, aDefaultPrevented);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,12 +86,12 @@ APZController::SetPendingResponseFlusher(APZPendingResponseFlusher* aFlusher)
|
||||
}
|
||||
|
||||
void
|
||||
APZController::ContentReceivedTouch(const uint64_t aInputBlockId, bool aPreventDefault)
|
||||
APZController::ContentReceivedInputBlock(const uint64_t aInputBlockId, bool aPreventDefault)
|
||||
{
|
||||
if (!sAPZC) {
|
||||
return;
|
||||
}
|
||||
sAPZC->ContentReceivedTouch(aInputBlockId, aPreventDefault);
|
||||
sAPZC->ContentReceivedInputBlock(aInputBlockId, aPreventDefault);
|
||||
}
|
||||
|
||||
bool
|
||||
@ -221,7 +221,7 @@ APZController::HandleLongTap(const CSSPoint& aPoint,
|
||||
if (mFlusher) {
|
||||
mFlusher->FlushPendingContentResponse();
|
||||
}
|
||||
ContentReceivedTouch(aInputBlockId, false);
|
||||
ContentReceivedInputBlock(aInputBlockId, false);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
bool HitTestAPZC(mozilla::ScreenIntPoint& aPoint);
|
||||
void TransformCoordinateToGecko(const mozilla::ScreenIntPoint& aPoint,
|
||||
LayoutDeviceIntPoint* aRefPointOut);
|
||||
void ContentReceivedTouch(uint64_t aInputBlockId, bool aPreventDefault);
|
||||
void ContentReceivedInputBlock(uint64_t aInputBlockId, bool aPreventDefault);
|
||||
nsEventStatus ReceiveInputEvent(mozilla::WidgetInputEvent* aEvent,
|
||||
ScrollableLayerGuid* aOutTargetGuid,
|
||||
uint64_t* aOutInputBlockId);
|
||||
|
@ -1090,7 +1090,7 @@ MetroWidget::ApzContentConsumingTouch(uint64_t aInputBlockId)
|
||||
if (!mController) {
|
||||
return;
|
||||
}
|
||||
mController->ContentReceivedTouch(aInputBlockId, true);
|
||||
mController->ContentReceivedInputBlock(aInputBlockId, true);
|
||||
}
|
||||
|
||||
void
|
||||
@ -1100,7 +1100,7 @@ MetroWidget::ApzContentIgnoringTouch(uint64_t aInputBlockId)
|
||||
if (!mController) {
|
||||
return;
|
||||
}
|
||||
mController->ContentReceivedTouch(aInputBlockId, false);
|
||||
mController->ContentReceivedInputBlock(aInputBlockId, false);
|
||||
}
|
||||
|
||||
bool
|
||||
|
Loading…
x
Reference in New Issue
Block a user