Bug 1107606 - Ensure that setting a smooth scroll while APZ is enabled activates the layer. r=tn,kip

This commit is contained in:
Kartikaya Gupta 2014-12-05 00:04:39 -08:00
parent 5c63a162c6
commit f74d9fb16a

View File

@ -2096,6 +2096,16 @@ ScrollFrameHelper::ScrollToWithOrigin(nsPoint aScrollPosition,
mLastSmoothScrollOrigin = aOrigin;
mScrollGeneration = ++sScrollGenerationCounter;
if (!nsLayoutUtils::GetDisplayPort(mOuter->GetContent())) {
// If this frame doesn't have a displayport then there won't be an
// APZC instance for it and so there won't be anything to process
// this smooth scroll request. We should set a displayport on this
// frame to force an APZC which can handle the request.
nsLayoutUtils::CalculateAndSetDisplayPortMargins(
mOuter->GetScrollTargetFrame(),
nsLayoutUtils::RepaintMode::DoNotRepaint);
}
// Schedule a paint to ensure that the frame metrics get updated on
// the compositor thread.
mOuter->SchedulePaint();