Bug 951793 - Obey overscroll-behavior for immediate scroll handoff. r=kats

MozReview-Commit-ID: JPJOK8A1PQ

--HG--
extra : rebase_source : 6603bb5e524bfb5cca5a9b4d23ebec2151d8bfb4
This commit is contained in:
Botond Ballo 2017-10-20 19:16:44 -04:00
Родитель 5d380ebb1c
Коммит d561386618
1 изменённых файлов: 18 добавлений и 1 удалений

Просмотреть файл

@ -2893,8 +2893,25 @@ void AsyncPanZoomController::CallDispatchScroll(ParentLayerPoint& aStartPoint,
if (!treeManagerLocal) {
return;
}
// Obey overscroll-behavior.
ParentLayerPoint endPoint = aEndPoint;
if (aOverscrollHandoffState.mChainIndex > 0) {
RecursiveMutexAutoLock lock(mRecursiveMutex);
if (!mX.OverscrollBehaviorAllowsHandoff()) {
endPoint.x = aStartPoint.x;
}
if (!mY.OverscrollBehaviorAllowsHandoff()) {
endPoint.y = aStartPoint.y;
}
if (aStartPoint == endPoint) {
// Handoff not allowed in either direction - don't even bother.
return;
}
}
treeManagerLocal->DispatchScroll(this,
aStartPoint, aEndPoint,
aStartPoint, endPoint,
aOverscrollHandoffState);
}