зеркало из https://github.com/mozilla/gecko-dev.git
Bug 920377 part.29 Get rid of nsMouseScrollEvent r=roc
This commit is contained in:
Родитель
cb376be26d
Коммит
c67563512e
|
@ -605,10 +605,10 @@ nsDOMEvent::DuplicatePrivateData()
|
|||
}
|
||||
case NS_MOUSE_SCROLL_EVENT:
|
||||
{
|
||||
nsMouseScrollEvent* oldMouseScrollEvent =
|
||||
static_cast<nsMouseScrollEvent*>(mEvent);
|
||||
nsMouseScrollEvent* mouseScrollEvent =
|
||||
new nsMouseScrollEvent(false, msg, nullptr);
|
||||
WidgetMouseScrollEvent* oldMouseScrollEvent =
|
||||
static_cast<WidgetMouseScrollEvent*>(mEvent);
|
||||
WidgetMouseScrollEvent* mouseScrollEvent =
|
||||
new WidgetMouseScrollEvent(false, msg, nullptr);
|
||||
mouseScrollEvent->AssignMouseScrollEventData(*oldMouseScrollEvent, true);
|
||||
newEvent = mouseScrollEvent;
|
||||
break;
|
||||
|
|
|
@ -18,7 +18,7 @@ nsDOMMouseEvent::nsDOMMouseEvent(mozilla::dom::EventTarget* aOwner,
|
|||
new nsMouseEvent(false, 0, nullptr,
|
||||
nsMouseEvent::eReal))
|
||||
{
|
||||
// There's no way to make this class' ctor allocate an nsMouseScrollEvent.
|
||||
// There's no way to make this class' ctor allocate an WidgetMouseScrollEvent.
|
||||
// It's not that important, though, since a scroll event is not a real
|
||||
// DOM event.
|
||||
|
||||
|
|
|
@ -13,7 +13,8 @@ nsDOMMouseScrollEvent::nsDOMMouseScrollEvent(mozilla::dom::EventTarget* aOwner,
|
|||
nsPresContext* aPresContext,
|
||||
WidgetInputEvent* aEvent)
|
||||
: nsDOMMouseEvent(aOwner, aPresContext,
|
||||
aEvent ? aEvent : new nsMouseScrollEvent(false, 0, nullptr))
|
||||
aEvent ? aEvent :
|
||||
new WidgetMouseScrollEvent(false, 0, nullptr))
|
||||
{
|
||||
if (aEvent) {
|
||||
mEventIsInternal = false;
|
||||
|
@ -25,7 +26,7 @@ nsDOMMouseScrollEvent::nsDOMMouseScrollEvent(mozilla::dom::EventTarget* aOwner,
|
|||
}
|
||||
|
||||
if(mEvent->eventStructType == NS_MOUSE_SCROLL_EVENT) {
|
||||
mDetail = static_cast<nsMouseScrollEvent*>(mEvent)->delta;
|
||||
mDetail = static_cast<WidgetMouseScrollEvent*>(mEvent)->delta;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +36,7 @@ nsDOMMouseScrollEvent::~nsDOMMouseScrollEvent()
|
|||
switch (mEvent->eventStructType)
|
||||
{
|
||||
case NS_MOUSE_SCROLL_EVENT:
|
||||
delete static_cast<nsMouseScrollEvent*>(mEvent);
|
||||
delete static_cast<WidgetMouseScrollEvent*>(mEvent);
|
||||
break;
|
||||
default:
|
||||
delete mEvent;
|
||||
|
@ -66,7 +67,7 @@ nsDOMMouseScrollEvent::InitMouseScrollEvent(const nsAString & aType, bool aCanBu
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (mEvent->eventStructType == NS_MOUSE_SCROLL_EVENT) {
|
||||
static_cast<nsMouseScrollEvent*>(mEvent)->isHorizontal =
|
||||
static_cast<WidgetMouseScrollEvent*>(mEvent)->isHorizontal =
|
||||
(aAxis == HORIZONTAL_AXIS);
|
||||
}
|
||||
|
||||
|
@ -86,7 +87,7 @@ int32_t
|
|||
nsDOMMouseScrollEvent::Axis()
|
||||
{
|
||||
if (mEvent->eventStructType == NS_MOUSE_SCROLL_EVENT) {
|
||||
return static_cast<nsMouseScrollEvent*>(mEvent)->isHorizontal ?
|
||||
return static_cast<WidgetMouseScrollEvent*>(mEvent)->isHorizontal ?
|
||||
static_cast<int32_t>(HORIZONTAL_AXIS) :
|
||||
static_cast<int32_t>(VERTICAL_AXIS);
|
||||
}
|
||||
|
|
|
@ -2478,8 +2478,8 @@ nsEventStateManager::SendLineScrollEvent(nsIFrame* aTargetFrame,
|
|||
targetContent = targetContent->GetParent();
|
||||
}
|
||||
|
||||
nsMouseScrollEvent event(aEvent->mFlags.mIsTrusted, NS_MOUSE_SCROLL,
|
||||
aEvent->widget);
|
||||
WidgetMouseScrollEvent event(aEvent->mFlags.mIsTrusted, NS_MOUSE_SCROLL,
|
||||
aEvent->widget);
|
||||
if (*aStatus == nsEventStatus_eConsumeNoDefault) {
|
||||
event.mFlags.mDefaultPrevented = true;
|
||||
}
|
||||
|
@ -2514,8 +2514,8 @@ nsEventStateManager::SendPixelScrollEvent(nsIFrame* aTargetFrame,
|
|||
targetContent = targetContent->GetParent();
|
||||
}
|
||||
|
||||
nsMouseScrollEvent event(aEvent->mFlags.mIsTrusted, NS_MOUSE_PIXEL_SCROLL,
|
||||
aEvent->widget);
|
||||
WidgetMouseScrollEvent event(aEvent->mFlags.mIsTrusted, NS_MOUSE_PIXEL_SCROLL,
|
||||
aEvent->widget);
|
||||
if (*aStatus == nsEventStatus_eConsumeNoDefault) {
|
||||
event.mFlags.mDefaultPrevented = true;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,6 @@ using nsIntRect;
|
|||
using nsIntSize;
|
||||
using mozilla::WidgetKeyboardEvent;
|
||||
using nsMouseEvent;
|
||||
using nsMouseScrollEvent;
|
||||
using mozilla::WheelEvent;
|
||||
using nsRect;
|
||||
using mozilla::WidgetSelectionEvent;
|
||||
|
|
|
@ -106,7 +106,6 @@ class InternalMutationEvent;
|
|||
typedef mozilla::WidgetEvent nsEvent;
|
||||
typedef mozilla::WidgetGUIEvent nsGUIEvent;
|
||||
typedef mozilla::WidgetMouseEvent nsMouseEvent;
|
||||
typedef mozilla::WidgetMouseScrollEvent nsMouseScrollEvent;
|
||||
|
||||
namespace mozilla {
|
||||
typedef WidgetWheelEvent WheelEvent;
|
||||
|
|
|
@ -425,6 +425,5 @@ typedef WidgetWheelEvent WheelEvent;
|
|||
|
||||
// TODO: Remove following typedefs
|
||||
typedef mozilla::WidgetMouseEvent nsMouseEvent;
|
||||
typedef mozilla::WidgetMouseScrollEvent nsMouseScrollEvent;
|
||||
|
||||
#endif // mozilla_MouseEvents_h__
|
||||
|
|
|
@ -4122,9 +4122,9 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
|||
|
||||
// Only initiate tracking if the user has tried to scroll past the edge of
|
||||
// the current page (as indicated by 'overflow' being non-zero). Gecko only
|
||||
// sets nsMouseScrollEvent.scrollOverflow when it's processing
|
||||
// sets WidgetMouseScrollEvent.scrollOverflow when it's processing
|
||||
// NS_MOUSE_PIXEL_SCROLL events (not NS_MOUSE_SCROLL events).
|
||||
// nsMouseScrollEvent.scrollOverflow only indicates left or right overflow
|
||||
// WidgetMouseScrollEvent.scrollOverflow only indicates left or right overflow
|
||||
// for horizontal NS_MOUSE_PIXEL_SCROLL events.
|
||||
if (!overflow) {
|
||||
return;
|
||||
|
|
Загрузка…
Ссылка в новой задаче