Bug 1259296 - Scroll snap in the compositor in response to wheel events. r=kats

MozReview-Commit-ID: 9fOlssstgvR
This commit is contained in:
Botond Ballo
2016-04-04 17:43:21 -04:00
parent bf62a882a2
commit 0b3df83425
3 changed files with 114 additions and 31 deletions

View File

@@ -6,8 +6,9 @@
#ifndef InputData_h__
#define InputData_h__
#include "nsIDOMWheelEvent.h"
#include "nsDebug.h"
#include "nsIDOMWheelEvent.h"
#include "nsIScrollableFrame.h"
#include "nsPoint.h"
#include "nsTArray.h"
#include "Units.h"
@@ -577,6 +578,22 @@ public:
return SCROLLDELTA_LINE;
}
static nsIScrollableFrame::ScrollUnit
ScrollUnitForDeltaType(ScrollDeltaType aDeltaType)
{
switch (aDeltaType) {
case SCROLLDELTA_LINE:
return nsIScrollableFrame::LINES;
case SCROLLDELTA_PAGE:
return nsIScrollableFrame::PAGES;
case SCROLLDELTA_PIXEL:
return nsIScrollableFrame::DEVICE_PIXELS;
default:
MOZ_CRASH();
}
return nsIScrollableFrame::LINES;
}
enum ScrollMode
{
SCROLLMODE_INSTANT,