mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 719320 part.8-8 widget should be able to speicify the scroll type r=smaug
This commit is contained in:
parent
3cdce54608
commit
737ff36abf
@ -755,6 +755,7 @@ nsDOMEvent::DuplicatePrivateData()
|
||||
wheelEvent->isPixelOnlyDevice = oldWheelEvent->isPixelOnlyDevice;
|
||||
wheelEvent->lineOrPageDeltaX = oldWheelEvent->lineOrPageDeltaX;
|
||||
wheelEvent->lineOrPageDeltaY = oldWheelEvent->lineOrPageDeltaY;
|
||||
wheelEvent->scrollType = oldWheelEvent->scrollType;
|
||||
wheelEvent->overflowDeltaX = oldWheelEvent->overflowDeltaX;
|
||||
wheelEvent->overflowDeltaY = oldWheelEvent->overflowDeltaY;
|
||||
newEvent = wheelEvent;
|
||||
|
@ -2901,8 +2901,28 @@ nsEventStateManager::DoScrollText(nsIScrollableFrame* aScrollableFrame,
|
||||
-devPixelPageSize.height;
|
||||
}
|
||||
|
||||
nsIScrollableFrame::ScrollMode mode =
|
||||
isDeltaModePixel ? nsIScrollableFrame::NORMAL : nsIScrollableFrame::SMOOTH;
|
||||
nsIScrollableFrame::ScrollMode mode;
|
||||
switch (aEvent->scrollType) {
|
||||
case widget::WheelEvent::SCROLL_DEFAULT:
|
||||
if (isDeltaModePixel) {
|
||||
mode = nsIScrollableFrame::NORMAL;
|
||||
} else {
|
||||
mode = nsIScrollableFrame::SMOOTH;
|
||||
}
|
||||
break;
|
||||
case widget::WheelEvent::SCROLL_SYNCHRONOUSLY:
|
||||
mode = nsIScrollableFrame::INSTANT;
|
||||
break;
|
||||
case widget::WheelEvent::SCROLL_ASYNCHRONOUSELY:
|
||||
mode = nsIScrollableFrame::NORMAL;
|
||||
break;
|
||||
case widget::WheelEvent::SCROLL_SMOOTHLY:
|
||||
mode = nsIScrollableFrame::SMOOTH;
|
||||
break;
|
||||
default:
|
||||
MOZ_NOT_REACHED("Invalid scrollType value comes");
|
||||
return;
|
||||
}
|
||||
|
||||
nsIntPoint overflow;
|
||||
aScrollableFrame->ScrollBy(actualDevPixelScrollAmount,
|
||||
|
@ -1409,7 +1409,7 @@ public:
|
||||
deltaX(0.0), deltaY(0.0), deltaZ(0.0),
|
||||
deltaMode(nsIDOMWheelEvent::DOM_DELTA_PIXEL),
|
||||
customizedByUserPrefs(false), isMomentum(false), isPixelOnlyDevice(false),
|
||||
lineOrPageDeltaX(0), lineOrPageDeltaY(0),
|
||||
lineOrPageDeltaX(0), lineOrPageDeltaY(0), scrollType(SCROLL_DEFAULT),
|
||||
overflowDeltaX(0.0), overflowDeltaY(0.0)
|
||||
{
|
||||
}
|
||||
@ -1463,6 +1463,17 @@ public:
|
||||
lineOrPageDeltaX : lineOrPageDeltaY;
|
||||
}
|
||||
|
||||
// Scroll type
|
||||
// The default value is SCROLL_DEFAULT, which means nsEventStateManager will
|
||||
// select preferred scroll type automatically.
|
||||
enum ScrollType {
|
||||
SCROLL_DEFAULT,
|
||||
SCROLL_SYNCHRONOUSLY,
|
||||
SCROLL_ASYNCHRONOUSELY,
|
||||
SCROLL_SMOOTHLY
|
||||
};
|
||||
ScrollType scrollType;
|
||||
|
||||
// overflowed delta values, these values are the result of dispatching this
|
||||
// event.
|
||||
double overflowDeltaX;
|
||||
|
@ -134,24 +134,31 @@ struct ParamTraits<mozilla::widget::WheelEvent>
|
||||
WriteParam(aMsg, aParam.isPixelOnlyDevice);
|
||||
WriteParam(aMsg, aParam.lineOrPageDeltaX);
|
||||
WriteParam(aMsg, aParam.lineOrPageDeltaY);
|
||||
WriteParam(aMsg, static_cast<PRInt32>(aParam.scrollType));
|
||||
WriteParam(aMsg, aParam.overflowDeltaX);
|
||||
WriteParam(aMsg, aParam.overflowDeltaY);
|
||||
}
|
||||
|
||||
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
||||
{
|
||||
return ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) &&
|
||||
ReadParam(aMsg, aIter, &aResult->deltaX) &&
|
||||
ReadParam(aMsg, aIter, &aResult->deltaY) &&
|
||||
ReadParam(aMsg, aIter, &aResult->deltaZ) &&
|
||||
ReadParam(aMsg, aIter, &aResult->deltaMode) &&
|
||||
ReadParam(aMsg, aIter, &aResult->customizedByUserPrefs) &&
|
||||
ReadParam(aMsg, aIter, &aResult->isMomentum) &&
|
||||
ReadParam(aMsg, aIter, &aResult->isPixelOnlyDevice) &&
|
||||
ReadParam(aMsg, aIter, &aResult->lineOrPageDeltaX) &&
|
||||
ReadParam(aMsg, aIter, &aResult->lineOrPageDeltaY) &&
|
||||
ReadParam(aMsg, aIter, &aResult->overflowDeltaX) &&
|
||||
ReadParam(aMsg, aIter, &aResult->overflowDeltaY);
|
||||
PRInt32 scrollType;
|
||||
bool rv =
|
||||
ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) &&
|
||||
ReadParam(aMsg, aIter, &aResult->deltaX) &&
|
||||
ReadParam(aMsg, aIter, &aResult->deltaY) &&
|
||||
ReadParam(aMsg, aIter, &aResult->deltaZ) &&
|
||||
ReadParam(aMsg, aIter, &aResult->deltaMode) &&
|
||||
ReadParam(aMsg, aIter, &aResult->customizedByUserPrefs) &&
|
||||
ReadParam(aMsg, aIter, &aResult->isMomentum) &&
|
||||
ReadParam(aMsg, aIter, &aResult->isPixelOnlyDevice) &&
|
||||
ReadParam(aMsg, aIter, &aResult->lineOrPageDeltaX) &&
|
||||
ReadParam(aMsg, aIter, &aResult->lineOrPageDeltaY) &&
|
||||
ReadParam(aMsg, aIter, &scrollType) &&
|
||||
ReadParam(aMsg, aIter, &aResult->overflowDeltaX) &&
|
||||
ReadParam(aMsg, aIter, &aResult->overflowDeltaY);
|
||||
aResult->scrollType =
|
||||
static_cast<mozilla::widget::WheelEvent::ScrollType>(scrollType);
|
||||
return rv;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user