Bug 974318 part.4 Remove nsDOMTextEvent r=smaug

This commit is contained in:
Masayuki Nakano 2014-03-04 22:48:27 +09:00
parent bd7230cba0
commit c5aac51f12
5 changed files with 4 additions and 80 deletions

View File

@ -87,7 +87,6 @@ UNIFIED_SOURCES += [
'nsContentEventHandler.cpp',
'nsDOMEvent.cpp',
'nsDOMEventTargetHelper.cpp',
'nsDOMTextEvent.cpp',
'nsEventDispatcher.cpp',
'nsEventListenerManager.cpp',
'nsEventListenerService.cpp',

View File

@ -1,45 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 sw=2 et tw=78: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDOMTextEvent.h"
#include "nsPrivateTextRange.h"
#include "prtime.h"
#include "mozilla/TextEvents.h"
using namespace mozilla;
using namespace mozilla::dom;
nsDOMTextEvent::nsDOMTextEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetTextEvent* aEvent)
: UIEvent(aOwner, aPresContext,
aEvent ? aEvent : new WidgetTextEvent(false, 0, nullptr))
{
NS_ASSERTION(mEvent->eventStructType == NS_TEXT_EVENT, "event type mismatch");
if (aEvent) {
mEventIsInternal = false;
}
else {
mEventIsInternal = true;
mEvent->time = PR_Now();
}
}
NS_IMPL_ADDREF_INHERITED(nsDOMTextEvent, UIEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMTextEvent, UIEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMTextEvent)
NS_INTERFACE_MAP_END_INHERITING(UIEvent)
nsresult NS_NewDOMTextEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetTextEvent* aEvent)
{
nsDOMTextEvent* it = new nsDOMTextEvent(aOwner, aPresContext, aEvent);
return CallQueryInterface(it, aInstancePtrResult);
}

View File

@ -1,30 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsDOMTextEvent_h__
#define nsDOMTextEvent_h__
#include "mozilla/dom/UIEvent.h"
#include "mozilla/Attributes.h"
#include "mozilla/EventForwards.h"
#include "nsIPrivateTextEvent.h"
#include "nsPrivateTextRange.h"
class nsDOMTextEvent : public mozilla::dom::UIEvent
{
typedef mozilla::dom::UIEvent UIEvent;
public:
nsDOMTextEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
mozilla::WidgetTextEvent* aEvent);
NS_DECL_ISUPPORTS_INHERITED
// Forward to base class
NS_FORWARD_TO_UIEVENT
};
#endif // nsDOMTextEvent_h__

View File

@ -708,8 +708,8 @@ nsEventDispatcher::CreateEvent(mozilla::dom::EventTarget* aOwner,
return NS_NewDOMDragEvent(aDOMEvent, aOwner, aPresContext,
aEvent->AsDragEvent());
case NS_TEXT_EVENT:
return NS_NewDOMTextEvent(aDOMEvent, aOwner, aPresContext,
aEvent->AsTextEvent());
return NS_NewDOMUIEvent(aDOMEvent, aOwner, aPresContext,
aEvent->AsTextEvent());
case NS_CLIPBOARD_EVENT:
return NS_NewDOMClipboardEvent(aDOMEvent, aOwner, aPresContext,
aEvent->AsClipboardEvent());
@ -764,7 +764,7 @@ nsEventDispatcher::CreateEvent(mozilla::dom::EventTarget* aOwner,
return NS_NewDOMMutationEvent(aDOMEvent, aOwner, aPresContext, nullptr);
if (aEventType.LowerCaseEqualsLiteral("textevent") ||
aEventType.LowerCaseEqualsLiteral("textevents"))
return NS_NewDOMTextEvent(aDOMEvent, aOwner, aPresContext, nullptr);
return NS_NewDOMUIEvent(aDOMEvent, aOwner, aPresContext, nullptr);
if (aEventType.LowerCaseEqualsLiteral("popupblockedevents"))
return NS_NewDOMPopupBlockedEvent(aDOMEvent, aOwner, aPresContext, nullptr);
if (aEventType.LowerCaseEqualsLiteral("deviceorientationevent"))

View File

@ -659,7 +659,7 @@ NON_IDL_EVENT(speakerforcedchange,
NON_IDL_EVENT(text,
NS_TEXT_TEXT,
EventNameType_XUL,
NS_EVENT)
NS_TEXT_EVENT)
NON_IDL_EVENT(compositionstart,
NS_COMPOSITION_START,
EventNameType_XUL,