diff --git a/dom/events/EventDispatcher.cpp b/dom/events/EventDispatcher.cpp index 873c54246349..1388fa29bc9c 100644 --- a/dom/events/EventDispatcher.cpp +++ b/dom/events/EventDispatcher.cpp @@ -702,7 +702,6 @@ EventDispatcher::CreateEvent(EventTarget* aOwner, return NS_NewDOMKeyboardEvent(aDOMEvent, aOwner, aPresContext, aEvent->AsKeyboardEvent()); case eCompositionEventClass: - case eTextEventClass: return NS_NewDOMCompositionEvent(aDOMEvent, aOwner, aPresContext, aEvent->AsCompositionEvent()); case eMouseEventClass: diff --git a/dom/interfaces/events/nsIDOMEvent.idl b/dom/interfaces/events/nsIDOMEvent.idl index f808bc95b3a9..7904bfe42031 100644 --- a/dom/interfaces/events/nsIDOMEvent.idl +++ b/dom/interfaces/events/nsIDOMEvent.idl @@ -288,11 +288,6 @@ NS_NewDOMDeviceMotionEvent(nsIDOMEvent** aResult, nsPresContext* aPresContext, mozilla::WidgetEvent* aEvent); nsresult -NS_NewDOMTextEvent(nsIDOMEvent** aResult, - mozilla::dom::EventTarget* aOwner, - nsPresContext* aPresContext, - mozilla::WidgetTextEvent* aEvent); -nsresult NS_NewDOMBeforeUnloadEvent(nsIDOMEvent** aResult, mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext, diff --git a/widget/EventClassList.h b/widget/EventClassList.h index 3ed982479f90..e6a160fab86d 100644 --- a/widget/EventClassList.h +++ b/widget/EventClassList.h @@ -22,7 +22,6 @@ NS_EVENT_CLASS(Internal, UIEvent) // TextEvents.h NS_EVENT_CLASS(Widget, KeyboardEvent) -NS_EVENT_CLASS(Widget, TextEvent) NS_EVENT_CLASS(Widget, CompositionEvent) NS_EVENT_CLASS(Widget, QueryContentEvent) NS_EVENT_CLASS(Widget, SelectionEvent) diff --git a/widget/TextEvents.h b/widget/TextEvents.h index 81645e7aa1af..9d5bdc06238e 100644 --- a/widget/TextEvents.h +++ b/widget/TextEvents.h @@ -194,80 +194,6 @@ public: } }; -/****************************************************************************** - * mozilla::WidgetTextEvent - * - * XXX WidgetTextEvent is fired with compositionupdate event almost every time. - * This wastes performance and the cost of mantaining each platform's - * implementation. Therefore, we should merge WidgetTextEvent and - * WidgetCompositionEvent. Then, DOM compositionupdate should be fired - * from TextComposition automatically. - ******************************************************************************/ - -class WidgetTextEvent : public WidgetGUIEvent -{ -private: - friend class dom::PBrowserParent; - friend class dom::PBrowserChild; - friend class plugins::PPluginInstanceChild; - - WidgetTextEvent() - : mSeqno(kLatestSeqno) - { - } - -public: - uint32_t mSeqno; - -public: - virtual WidgetTextEvent* AsTextEvent() MOZ_OVERRIDE { return this; } - - WidgetTextEvent(bool aIsTrusted, uint32_t aMessage, nsIWidget* aWidget) - : WidgetGUIEvent(aIsTrusted, aMessage, aWidget, eTextEventClass) - , mSeqno(kLatestSeqno) - { - } - - virtual WidgetEvent* Duplicate() const MOZ_OVERRIDE - { - MOZ_ASSERT(mClass == eTextEventClass, - "Duplicate() must be overridden by sub class"); - // Not copying widget, it is a weak reference. - WidgetTextEvent* result = new WidgetTextEvent(false, message, nullptr); - result->AssignTextEventData(*this, true); - result->mFlags = mFlags; - return result; - } - - // The composition string or the commit string. - nsString mData; - - nsRefPtr mRanges; - - void AssignTextEventData(const WidgetTextEvent& aEvent, bool aCopyTargets) - { - AssignGUIEventData(aEvent, aCopyTargets); - - // Currently, we don't need to copy the other members because they are - // for internal use only (not available from JS). - } - - bool IsComposing() const - { - return mRanges && mRanges->IsComposing(); - } - - uint32_t TargetClauseOffset() const - { - return mRanges ? mRanges->TargetClauseOffset() : 0; - } - - uint32_t RangeCount() const - { - return mRanges ? mRanges->Length() : 0; - } -}; - /****************************************************************************** * mozilla::WidgetCompositionEvent ******************************************************************************/ diff --git a/widget/nsGUIEventIPC.h b/widget/nsGUIEventIPC.h index 5635f663ecac..cb639b526385 100644 --- a/widget/nsGUIEventIPC.h +++ b/widget/nsGUIEventIPC.h @@ -441,49 +441,6 @@ struct ParamTraits } }; -template<> -struct ParamTraits -{ - typedef mozilla::WidgetTextEvent paramType; - - static void Write(Message* aMsg, const paramType& aParam) - { - WriteParam(aMsg, static_cast(aParam)); - WriteParam(aMsg, aParam.mSeqno); - WriteParam(aMsg, aParam.mData); - bool hasRanges = !!aParam.mRanges; - WriteParam(aMsg, hasRanges); - if (hasRanges) { - WriteParam(aMsg, *aParam.mRanges.get()); - } - } - - static bool Read(const Message* aMsg, void** aIter, paramType* aResult) - { - bool hasRanges; - if (!ReadParam(aMsg, aIter, - static_cast(aResult)) || - !ReadParam(aMsg, aIter, &aResult->mSeqno) || - !ReadParam(aMsg, aIter, &aResult->mData) || - !ReadParam(aMsg, aIter, &hasRanges)) { - return false; - } - - if (!hasRanges) { - aResult->mRanges = nullptr; - } else { - aResult->mRanges = new mozilla::TextRangeArray(); - if (!aResult->mRanges) { - return false; - } - if (!ReadParam(aMsg, aIter, aResult->mRanges.get())) { - return false; - } - } - return true; - } -}; - template<> struct ParamTraits { diff --git a/widget/xpwidgets/PuppetWidget.cpp b/widget/xpwidgets/PuppetWidget.cpp index 371ba9efecc4..109380e32023 100644 --- a/widget/xpwidgets/PuppetWidget.cpp +++ b/widget/xpwidgets/PuppetWidget.cpp @@ -291,9 +291,6 @@ PuppetWidget::DispatchEvent(WidgetGUIEvent* event, nsEventStatus& aStatus) case eCompositionEventClass: seqno = event->AsCompositionEvent()->mSeqno; break; - case eTextEventClass: - seqno = event->AsTextEvent()->mSeqno; - break; case eSelectionEventClass: seqno = event->AsSelectionEvent()->mSeqno; break;