Bug 1211506 - Respect the APZ lock ordering in AsyncPanZoomController::OnScrollWheel(). r=mstange

--HG--
extra : source : af0360acd0fa65d7bd526339212a909884afa40c
This commit is contained in:
Botond Ballo 2015-10-16 16:33:41 -04:00
parent f948623c75
commit e235e119a9

View File

@ -1667,12 +1667,9 @@ nsEventStatus AsyncPanZoomController::OnScrollWheel(const ScrollWheelInput& aEve
switch (aEvent.mScrollMode) {
case ScrollWheelInput::SCROLLMODE_INSTANT: {
// Call ToScreenCoordinates outside the lock because it grabs the tree lock.
ScreenPoint distance = ToScreenCoordinates(
ParentLayerPoint(fabs(delta.x), fabs(delta.y)), aEvent.mLocalOrigin);
ReentrantMonitorAutoEnter lock(mMonitor);
CancelAnimation();
SetState(WHEEL_SCROLL);
@ -1685,6 +1682,10 @@ nsEventStatus AsyncPanZoomController::OnScrollWheel(const ScrollWheelInput& aEve
CallDispatchScroll(startPoint, endPoint, handoffState);
SetState(NOTHING);
// The calls above handle their own locking; moreover,
// ToScreenCoordinates() and CallDispatchScroll() can grab the tree lock.
ReentrantMonitorAutoEnter lock(mMonitor);
RequestContentRepaint();
break;