Bug 1259663 - Clean up WidgetMouseScrollEvent. r=masayuki

MozReview-Commit-ID: F98luwO9y1N

--HG--
extra : rebase_source : e798d10142104b99fa50763a2f4e42107d3c6976
This commit is contained in:
shundroid 2016-04-06 16:44:11 +09:00
Родитель 62f0c13d40
Коммит 0eca40da0c
3 изменённых файлов: 15 добавлений и 15 удалений

Просмотреть файл

@ -2303,8 +2303,8 @@ EventStateManager::SendLineScrollEvent(nsIFrame* aTargetFrame,
event.mTimeStamp = aEvent->mTimeStamp;
event.mModifiers = aEvent->mModifiers;
event.buttons = aEvent->buttons;
event.isHorizontal = (aDeltaDirection == DELTA_DIRECTION_X);
event.delta = aDelta;
event.mIsHorizontal = (aDeltaDirection == DELTA_DIRECTION_X);
event.mDelta = aDelta;
event.inputSource = aEvent->inputSource;
nsEventStatus status = nsEventStatus_eIgnore;
@ -2343,8 +2343,8 @@ EventStateManager::SendPixelScrollEvent(nsIFrame* aTargetFrame,
event.mTimeStamp = aEvent->mTimeStamp;
event.mModifiers = aEvent->mModifiers;
event.buttons = aEvent->buttons;
event.isHorizontal = (aDeltaDirection == DELTA_DIRECTION_X);
event.delta = aPixelDelta;
event.mIsHorizontal = (aDeltaDirection == DELTA_DIRECTION_X);
event.mDelta = aPixelDelta;
event.inputSource = aEvent->inputSource;
nsEventStatus status = nsEventStatus_eIgnore;

Просмотреть файл

@ -29,7 +29,7 @@ MouseScrollEvent::MouseScrollEvent(EventTarget* aOwner,
nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
}
mDetail = mEvent->AsMouseScrollEvent()->delta;
mDetail = mEvent->AsMouseScrollEvent()->mDelta;
}
NS_IMPL_ADDREF_INHERITED(MouseScrollEvent, MouseEvent)
@ -60,14 +60,14 @@ MouseScrollEvent::InitMouseScrollEvent(const nsAString& aType,
aScreenX, aScreenY, aClientX, aClientY,
aCtrlKey, aAltKey, aShiftKey, aMetaKey, aButton,
aRelatedTarget);
mEvent->AsMouseScrollEvent()->isHorizontal =
mEvent->AsMouseScrollEvent()->mIsHorizontal =
(aAxis == nsIDOMMouseScrollEvent::HORIZONTAL_AXIS);
}
int32_t
MouseScrollEvent::Axis()
{
return mEvent->AsMouseScrollEvent()->isHorizontal ?
return mEvent->AsMouseScrollEvent()->mIsHorizontal ?
static_cast<int32_t>(nsIDOMMouseScrollEvent::HORIZONTAL_AXIS) :
static_cast<int32_t>(nsIDOMMouseScrollEvent::VERTICAL_AXIS);
}

Просмотреть файл

@ -383,8 +383,8 @@ class WidgetMouseScrollEvent : public WidgetMouseEventBase
{
private:
WidgetMouseScrollEvent()
: delta(0)
, isHorizontal(false)
: mDelta(0)
, mIsHorizontal(false)
{
}
@ -398,8 +398,8 @@ public:
nsIWidget* aWidget)
: WidgetMouseEventBase(aIsTrusted, aMessage, aWidget,
eMouseScrollEventClass)
, delta(0)
, isHorizontal(false)
, mDelta(0)
, mIsHorizontal(false)
{
}
@ -421,19 +421,19 @@ public:
// nsIDOMUIEvent::SCROLL_PAGE_UP or nsIDOMUIEvent::SCROLL_PAGE_DOWN, the
// value inducates one page scroll. If the event message is
// eLegacyMousePixelScroll, the value indicates scroll amount in pixels.
int32_t delta;
int32_t mDelta;
// If this is true, it may cause to scroll horizontally.
// Otherwise, vertically.
bool isHorizontal;
bool mIsHorizontal;
void AssignMouseScrollEventData(const WidgetMouseScrollEvent& aEvent,
bool aCopyTargets)
{
AssignMouseEventBaseData(aEvent, aCopyTargets);
delta = aEvent.delta;
isHorizontal = aEvent.isHorizontal;
mDelta = aEvent.mDelta;
mIsHorizontal = aEvent.mIsHorizontal;
}
};