Bug 1340415 - Ensure main-thread and async autoscrolling do not happen at the same time. r=kats

The two happening at the same time can lead to the APZ autoscroll being
cancelled due to APZ receiving a main-thread scroll offset update.

To achieve this:

  - The content process assumes APZ is handling the autoscroll until
    told otherwise.

  - If the parent process knows APZ won't handle an autoscroll, it
    tells the content process via its response to the Autoscroll:Start
    message. This covers all cases where APZ doesn't handle the
    autoscroll, except the case where APZCTreeManager itself rejects
    the autoscroll and it lives in the compositor process rather than
    the parent process.

  - If APZCTreeManager rejects an autoscroll and it lives in the
    compositor process, it sends an 'autoscroll-rejected-by-apz' message
    to the content process.

MozReview-Commit-ID: L62v4COai6W
This commit is contained in:
Botond Ballo
2017-10-18 18:18:13 -04:00
parent 624d0b96d4
commit 473f8337a1
26 changed files with 102 additions and 69 deletions

View File

@@ -1930,13 +1930,13 @@ nsBaseWidget::StartAsyncScrollbarDrag(const AsyncDragMetrics& aDragMetrics)
aDragMetrics));
}
void
bool
nsBaseWidget::StartAsyncAutoscroll(const ScreenPoint& aAnchorLocation,
const ScrollableLayerGuid& aGuid)
{
MOZ_ASSERT(XRE_IsParentProcess() && AsyncPanZoomEnabled());
mAPZC->StartAutoscroll(aGuid, aAnchorLocation);
return mAPZC->StartAutoscroll(aGuid, aAnchorLocation);
}
void