зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1042103 - Don't ignore events during overscroll. r=botond
This commit is contained in:
Родитель
d34d823d05
Коммит
1460000399
|
@ -649,9 +649,6 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (hitResult == HitOverscrolledApzc) {
|
||||
result = nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -772,9 +769,6 @@ APZCTreeManager::ProcessTouchInput(MultiTouchInput& aInput,
|
|||
outTransform, touchData.mScreenPoint);
|
||||
}
|
||||
}
|
||||
if (mHitResultForInputBlock == HitOverscrolledApzc) {
|
||||
result = nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
|
||||
if (aInput.mType == MultiTouchInput::MULTITOUCH_END) {
|
||||
if (mTouchCount >= aInput.mTouches.Length()) {
|
||||
|
@ -834,9 +828,6 @@ APZCTreeManager::ProcessEvent(WidgetInputEvent& aEvent,
|
|||
Matrix4x4 outTransform = transformToApzc * transformToGecko;
|
||||
aEvent.refPoint = TransformTo<LayoutDevicePixel>(outTransform, aEvent.refPoint);
|
||||
}
|
||||
if (hitResult == HitOverscrolledApzc) {
|
||||
result = nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1195,8 +1186,6 @@ APZCTreeManager::GetTargetAPZC(const ScreenPoint& aPoint, HitTestResult* aOutHit
|
|||
PixelCastJustification::ScreenIsParentLayerForRoot);
|
||||
nsRefPtr<AsyncPanZoomController> target = GetAPZCAtPoint(mRootNode, point, &hitResult);
|
||||
|
||||
// If we are in an overscrolled APZC, we should be returning nullptr.
|
||||
MOZ_ASSERT(!(target && (hitResult == HitOverscrolledApzc)));
|
||||
if (aOutHitResult) {
|
||||
*aOutHitResult = hitResult;
|
||||
}
|
||||
|
@ -1322,8 +1311,6 @@ APZCTreeManager::GetAPZCAtPoint(HitTestingTreeNode* aNode,
|
|||
// This walks the tree in depth-first, reverse order, so that it encounters
|
||||
// APZCs front-to-back on the screen.
|
||||
for (HitTestingTreeNode* node = aNode; node; node = node->GetPrevSibling()) {
|
||||
AsyncPanZoomController* apzc = node->GetApzc();
|
||||
|
||||
if (node->IsOutsideClip(aHitTestPoint)) {
|
||||
// If the point being tested is outside the clip region for this node
|
||||
// then we don't need to test against this node or any of its children.
|
||||
|
@ -1342,10 +1329,6 @@ APZCTreeManager::GetAPZCAtPoint(HitTestingTreeNode* aNode,
|
|||
ParentLayerPoint childPoint = ViewAs<ParentLayerPixel>(hitTestPointForChildLayers.ref(),
|
||||
PixelCastJustification::MovingDownToChildren);
|
||||
result = GetAPZCAtPoint(node->GetLastChild(), childPoint, aOutHitResult);
|
||||
if (*aOutHitResult == HitOverscrolledApzc) {
|
||||
// We matched an overscrolled APZC, abort.
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// If we didn't match anything in the subtree, check |node|.
|
||||
|
@ -1365,15 +1348,6 @@ APZCTreeManager::GetAPZCAtPoint(HitTestingTreeNode* aNode,
|
|||
}
|
||||
}
|
||||
|
||||
// If we are overscrolled, and the point matches us or one of our children,
|
||||
// the result is inside an overscrolled APZC, inform our caller of this
|
||||
// (callers typically ignore events targeted at overscrolled APZCs).
|
||||
if (*aOutHitResult != HitNothing && apzc && apzc->IsOverscrolled()) {
|
||||
APZCTM_LOG("Result is inside overscrolled APZC %p\n", apzc);
|
||||
*aOutHitResult = HitOverscrolledApzc;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (*aOutHitResult != HitNothing) {
|
||||
if (result && !gfxPrefs::LayoutEventRegionsEnabled()) {
|
||||
// When event-regions are disabled, we treat scrollinfo layers as
|
||||
|
|
|
@ -14,7 +14,6 @@ enum HitTestResult {
|
|||
HitNothing,
|
||||
HitLayer,
|
||||
HitDispatchToContentRegion,
|
||||
HitOverscrolledApzc,
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -1146,6 +1146,7 @@ nsEventStatus AsyncPanZoomController::OnTouchStart(const MultiTouchInput& aEvent
|
|||
case FLING:
|
||||
case ANIMATING_ZOOM:
|
||||
case SMOOTH_SCROLL:
|
||||
case OVERSCROLL_ANIMATION:
|
||||
CurrentTouchBlock()->GetOverscrollHandoffChain()->CancelAnimations();
|
||||
// Fall through.
|
||||
case NOTHING: {
|
||||
|
@ -1226,8 +1227,8 @@ nsEventStatus AsyncPanZoomController::OnTouchMove(const MultiTouchInput& aEvent)
|
|||
|
||||
case OVERSCROLL_ANIMATION:
|
||||
// Should not receive a touch-move in the OVERSCROLL_ANIMATION state
|
||||
// as touch blocks that begin in an overscrolled state
|
||||
// are ignored.
|
||||
// as touch blocks that begin in an overscrolled state cancel the
|
||||
// animation.
|
||||
NS_WARNING("Received impossible touch in OnTouchMove");
|
||||
break;
|
||||
}
|
||||
|
@ -1310,9 +1311,9 @@ nsEventStatus AsyncPanZoomController::OnTouchEnd(const MultiTouchInput& aEvent)
|
|||
return nsEventStatus_eIgnore;
|
||||
|
||||
case OVERSCROLL_ANIMATION:
|
||||
// Should not receive a touch-move in the OVERSCROLL_ANIMATION state
|
||||
// as touch blocks that begin in an overscrolled state
|
||||
// are ignored.
|
||||
// Should not receive a touch-end in the OVERSCROLL_ANIMATION state
|
||||
// as touch blocks that begin in an overscrolled state cancel the
|
||||
// animation.
|
||||
NS_WARNING("Received impossible touch in OnTouchEnd");
|
||||
break;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче