зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1674694 - Use ConvertAPZHandledResult nsEventStatus_eConsumeNoDefault case. r=botond,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D96332
This commit is contained in:
Родитель
7087f97a39
Коммит
f2932331df
|
@ -360,13 +360,9 @@ class NPZCSupport final
|
|||
WheelDeltaAdjustmentStrategy::eNone);
|
||||
|
||||
APZEventResult result = controller->InputBridge()->ReceiveInputEvent(input);
|
||||
int32_t ret =
|
||||
(result.mHandledResult == Some(APZHandledResult::HandledByRoot))
|
||||
? INPUT_RESULT_HANDLED
|
||||
: INPUT_RESULT_HANDLED_CONTENT;
|
||||
|
||||
if (result.mStatus == nsEventStatus_eConsumeNoDefault) {
|
||||
return ret;
|
||||
MOZ_ASSERT(result.mHandledResult, "Should have a valid APZHandledResult");
|
||||
return ConvertAPZHandledResult(result.mHandledResult.value());
|
||||
}
|
||||
|
||||
PostInputEvent([input, result](nsWindow* window) {
|
||||
|
@ -378,7 +374,9 @@ class NPZCSupport final
|
|||
case nsEventStatus_eIgnore:
|
||||
return INPUT_RESULT_UNHANDLED;
|
||||
case nsEventStatus_eConsumeDoDefault:
|
||||
return ret;
|
||||
return (result.mHandledResult == Some(APZHandledResult::HandledByRoot))
|
||||
? INPUT_RESULT_HANDLED
|
||||
: INPUT_RESULT_HANDLED_CONTENT;
|
||||
default:
|
||||
MOZ_ASSERT_UNREACHABLE("Unexpected nsEventStatus");
|
||||
return INPUT_RESULT_UNHANDLED;
|
||||
|
@ -503,13 +501,9 @@ class NPZCSupport final
|
|||
nsWindow::GetEventTimeStamp(aTime), nsWindow::GetModifiers(aMetaState));
|
||||
|
||||
APZEventResult result = controller->InputBridge()->ReceiveInputEvent(input);
|
||||
int32_t ret =
|
||||
(result.mHandledResult == Some(APZHandledResult::HandledByRoot))
|
||||
? INPUT_RESULT_HANDLED
|
||||
: INPUT_RESULT_HANDLED_CONTENT;
|
||||
|
||||
if (result.mStatus == nsEventStatus_eConsumeNoDefault) {
|
||||
return ret;
|
||||
MOZ_ASSERT(result.mHandledResult, "Should have a valid APZHandledResult");
|
||||
return ConvertAPZHandledResult(result.mHandledResult.value());
|
||||
}
|
||||
|
||||
PostInputEvent([input, result](nsWindow* window) {
|
||||
|
@ -521,7 +515,9 @@ class NPZCSupport final
|
|||
case nsEventStatus_eIgnore:
|
||||
return INPUT_RESULT_UNHANDLED;
|
||||
case nsEventStatus_eConsumeDoDefault:
|
||||
return ret;
|
||||
return (result.mHandledResult == Some(APZHandledResult::HandledByRoot))
|
||||
? INPUT_RESULT_HANDLED
|
||||
: INPUT_RESULT_HANDLED_CONTENT;
|
||||
default:
|
||||
MOZ_ASSERT_UNREACHABLE("Unexpected nsEventStatus");
|
||||
return INPUT_RESULT_UNHANDLED;
|
||||
|
@ -704,14 +700,12 @@ class NPZCSupport final
|
|||
}
|
||||
|
||||
APZEventResult result = controller->InputBridge()->ReceiveInputEvent(input);
|
||||
int32_t handled =
|
||||
(result.mHandledResult == Some(APZHandledResult::HandledByRoot))
|
||||
? INPUT_RESULT_HANDLED
|
||||
: INPUT_RESULT_HANDLED_CONTENT;
|
||||
|
||||
if (result.mStatus == nsEventStatus_eConsumeNoDefault) {
|
||||
if (returnResult) {
|
||||
returnResult->Complete(java::sdk::Integer::ValueOf(handled));
|
||||
MOZ_ASSERT(result.mHandledResult,
|
||||
"Should have a valid APZHandledResult");
|
||||
returnResult->Complete(java::sdk::Integer::ValueOf(
|
||||
ConvertAPZHandledResult(result.mHandledResult.value())));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -737,7 +731,10 @@ class NPZCSupport final
|
|||
java::sdk::Integer::ValueOf(INPUT_RESULT_UNHANDLED));
|
||||
break;
|
||||
case nsEventStatus_eConsumeDoDefault:
|
||||
returnResult->Complete(java::sdk::Integer::ValueOf(handled));
|
||||
returnResult->Complete(java::sdk::Integer::ValueOf(
|
||||
(result.mHandledResult == Some(APZHandledResult::HandledByRoot))
|
||||
? INPUT_RESULT_HANDLED
|
||||
: INPUT_RESULT_HANDLED_CONTENT));
|
||||
break;
|
||||
default:
|
||||
MOZ_ASSERT_UNREACHABLE("Unexpected nsEventStatus");
|
||||
|
|
Загрузка…
Ссылка в новой задаче