void OverscrollHandoffChain::SnapBackOverscrolledApzc(const AsyncPanZoomController* aStart) const { uint32_t i = IndexOf(aStart); for (; i < Length(); ++i) { AsyncPanZoomController* apzc = mChain[i]; if (!apzc->IsDestroyed()) { apzc->SnapBackIfOverscrolled(); } } }
void OverscrollHandoffChain::SnapBackOverscrolledApzc() const { for (uint32_t i = 0; i < Length(); ++i) { AsyncPanZoomController* apzc = mChain[i]; if (!apzc->IsDestroyed() && apzc->SnapBackIfOverscrolled()) { // At most one APZC along the hand-off chain can be overscrolled. break; } } }
void OverscrollHandoffChain::SnapBackOverscrolledApzc() const { uint32_t i = 0; for (i = 0; i < Length(); ++i) { AsyncPanZoomController* apzc = mChain[i]; if (!apzc->IsDestroyed() && apzc->SnapBackIfOverscrolled()) { // At most one APZC along the hand-off chain can be overscrolled. break; } } // In debug builds, verify our assumption that only one APZC is overscrolled. #ifdef DEBUG ++i; for (; i < Length(); ++i) { AsyncPanZoomController* apzc = mChain[i]; if (!apzc->IsDestroyed()) { MOZ_ASSERT(!apzc->IsOverscrolled()); } } #endif }
void OverscrollHandoffChain::SnapBackOverscrolledApzc(const AsyncPanZoomController* aStart) const { uint32_t i = IndexOf(aStart); for (; i < Length(); ++i) { AsyncPanZoomController* apzc = mChain[i]; if (!apzc->IsDestroyed() && apzc->SnapBackIfOverscrolled()) { // At most one APZC from |aStart| onwards can be overscrolled. break; } } // In debug builds, verify our assumption that only one APZC from |aStart| // onwards is overscrolled. #ifdef DEBUG ++i; for (; i < Length(); ++i) { AsyncPanZoomController* apzc = mChain[i]; if (!apzc->IsDestroyed()) { MOZ_ASSERT(!apzc->IsOverscrolled()); } } #endif }
void OverscrollHandoffChain::RequestSnapOnLock(Layer::ScrollDirection aAxis) const { for (uint32_t i = 0; i < Length(); ++i) { AsyncPanZoomController* apzc = mChain[i]; if (!apzc->IsDestroyed()) { switch (aAxis) { case Layer::HORIZONTAL: if (!apzc->CanScroll(Layer::VERTICAL)) { apzc->RequestSnap(); } break; case Layer::VERTICAL: if (!apzc->CanScroll(Layer::HORIZONTAL)) { apzc->RequestSnap(); } break; default: MOZ_ASSERT(false); break; } } } }