mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 920377 part.11 Get rid of nsScrollPortEvent r=roc
This commit is contained in:
parent
323a652628
commit
a8c4022dfb
@ -619,10 +619,10 @@ nsDOMEvent::DuplicatePrivateData()
|
||||
}
|
||||
case NS_SCROLLPORT_EVENT:
|
||||
{
|
||||
nsScrollPortEvent* oldScrollPortEvent =
|
||||
static_cast<nsScrollPortEvent*>(mEvent);
|
||||
nsScrollPortEvent* scrollPortEvent =
|
||||
new nsScrollPortEvent(false, msg, nullptr);
|
||||
InternalScrollPortEvent* oldScrollPortEvent =
|
||||
static_cast<InternalScrollPortEvent*>(mEvent);
|
||||
InternalScrollPortEvent* scrollPortEvent =
|
||||
new InternalScrollPortEvent(false, msg, nullptr);
|
||||
scrollPortEvent->AssignScrollPortEventData(*oldScrollPortEvent, true);
|
||||
newEvent = scrollPortEvent;
|
||||
break;
|
||||
|
@ -52,7 +52,8 @@ nsDOMUIEvent::nsDOMUIEvent(mozilla::dom::EventTarget* aOwner,
|
||||
|
||||
case NS_SCROLLPORT_EVENT:
|
||||
{
|
||||
nsScrollPortEvent* scrollEvent = static_cast<nsScrollPortEvent*>(mEvent);
|
||||
InternalScrollPortEvent* scrollEvent =
|
||||
static_cast<InternalScrollPortEvent*>(mEvent);
|
||||
mDetail = (int32_t)scrollEvent->orient;
|
||||
break;
|
||||
}
|
||||
|
@ -2753,14 +2753,14 @@ nsGfxScrollFrameInner::FireScrollPortEvent()
|
||||
// DOM event.
|
||||
bool both = vertChanged && horizChanged &&
|
||||
newVerticalOverflow == newHorizontalOverflow;
|
||||
nsScrollPortEvent::orientType orient;
|
||||
InternalScrollPortEvent::orientType orient;
|
||||
if (both) {
|
||||
orient = nsScrollPortEvent::both;
|
||||
orient = InternalScrollPortEvent::both;
|
||||
mHorizontalOverflow = newHorizontalOverflow;
|
||||
mVerticalOverflow = newVerticalOverflow;
|
||||
}
|
||||
else if (vertChanged) {
|
||||
orient = nsScrollPortEvent::vertical;
|
||||
orient = InternalScrollPortEvent::vertical;
|
||||
mVerticalOverflow = newVerticalOverflow;
|
||||
if (horizChanged) {
|
||||
// We need to dispatch a separate horizontal DOM event. Do that the next
|
||||
@ -2770,15 +2770,14 @@ nsGfxScrollFrameInner::FireScrollPortEvent()
|
||||
}
|
||||
}
|
||||
else {
|
||||
orient = nsScrollPortEvent::horizontal;
|
||||
orient = InternalScrollPortEvent::horizontal;
|
||||
mHorizontalOverflow = newHorizontalOverflow;
|
||||
}
|
||||
|
||||
nsScrollPortEvent event(true,
|
||||
(orient == nsScrollPortEvent::horizontal ?
|
||||
mHorizontalOverflow : mVerticalOverflow) ?
|
||||
NS_SCROLLPORT_OVERFLOW : NS_SCROLLPORT_UNDERFLOW,
|
||||
nullptr);
|
||||
InternalScrollPortEvent event(true,
|
||||
(orient == InternalScrollPortEvent::horizontal ? mHorizontalOverflow :
|
||||
mVerticalOverflow) ?
|
||||
NS_SCROLLPORT_OVERFLOW : NS_SCROLLPORT_UNDERFLOW, nullptr);
|
||||
event.orient = orient;
|
||||
return nsEventDispatcher::Dispatch(mOuter->GetContent(),
|
||||
mOuter->PresContext(), &event);
|
||||
|
@ -926,17 +926,18 @@ nsTreeBodyFrame::CheckOverflow(const ScrollParts& aParts)
|
||||
nsCOMPtr<nsIContent> content = mContent;
|
||||
|
||||
if (verticalOverflowChanged) {
|
||||
nsScrollPortEvent event(true, mVerticalOverflow ? NS_SCROLLPORT_OVERFLOW
|
||||
: NS_SCROLLPORT_UNDERFLOW, nullptr);
|
||||
event.orient = nsScrollPortEvent::vertical;
|
||||
InternalScrollPortEvent event(true,
|
||||
mVerticalOverflow ? NS_SCROLLPORT_OVERFLOW : NS_SCROLLPORT_UNDERFLOW,
|
||||
nullptr);
|
||||
event.orient = InternalScrollPortEvent::vertical;
|
||||
nsEventDispatcher::Dispatch(content, presContext, &event);
|
||||
}
|
||||
|
||||
if (horizontalOverflowChanged) {
|
||||
nsScrollPortEvent event(true,
|
||||
mHorizontalOverflow ? NS_SCROLLPORT_OVERFLOW
|
||||
: NS_SCROLLPORT_UNDERFLOW, nullptr);
|
||||
event.orient = nsScrollPortEvent::horizontal;
|
||||
InternalScrollPortEvent event(true,
|
||||
mHorizontalOverflow ? NS_SCROLLPORT_OVERFLOW : NS_SCROLLPORT_UNDERFLOW,
|
||||
nullptr);
|
||||
event.orient = InternalScrollPortEvent::horizontal;
|
||||
nsEventDispatcher::Dispatch(content, presContext, &event);
|
||||
}
|
||||
|
||||
|
@ -249,6 +249,5 @@ public:
|
||||
|
||||
// TODO: Remove following typedefs
|
||||
typedef mozilla::InternalScriptErrorEvent nsScriptErrorEvent;
|
||||
typedef mozilla::InternalScrollPortEvent nsScrollPortEvent;
|
||||
|
||||
#endif // mozilla_ContentEvents_h__
|
||||
|
@ -129,6 +129,5 @@ typedef mozilla::WidgetGestureNotifyEvent nsGestureNotifyEvent;
|
||||
typedef mozilla::WidgetSimpleGestureEvent nsSimpleGestureEvent;
|
||||
typedef mozilla::WidgetTouchEvent nsTouchEvent;
|
||||
typedef mozilla::InternalScriptErrorEvent nsScriptErrorEvent;
|
||||
typedef mozilla::InternalScrollPortEvent nsScrollPortEvent;
|
||||
|
||||
#endif // mozilla_EventForwards_h__
|
||||
|
Loading…
Reference in New Issue
Block a user