Bug 960871 part.3 Remove WidgetTextEvent::isChar since it's always false on all platforms r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 07 Oct 2014 19:01:47 +0900
changeset 233673 d2eebbc42474e590edc824c975ae5a6f3ec99111
parent 233672 3b622a7464cc84dbb5ad860fc01aff62311cd92d
child 233674 279373ac52ffac806b4bf3f4856e43888daf9b4d
push id611
push userraliiev@mozilla.com
push dateMon, 05 Jan 2015 23:23:16 +0000
treeherdermozilla-release@345cd3b9c445 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs960871
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 960871 part.3 Remove WidgetTextEvent::isChar since it's always false on all platforms r=smaug
dom/events/UIEvent.cpp
widget/TextEvents.h
widget/nsGUIEventIPC.h
--- a/dom/events/UIEvent.cpp
+++ b/dom/events/UIEvent.cpp
@@ -339,21 +339,17 @@ UIEvent::GetIsChar(bool* aIsChar)
   *aIsChar = IsChar();
   return NS_OK;
 }
 
 bool
 UIEvent::IsChar() const
 {
   WidgetKeyboardEvent* keyEvent = mEvent->AsKeyboardEvent();
-  if (keyEvent) {
-    return keyEvent->isChar;
-  }
-  WidgetTextEvent* textEvent = mEvent->AsTextEvent();
-  return textEvent ? textEvent->isChar : false;
+  return keyEvent ? keyEvent->isChar : false;
 }
 
 NS_IMETHODIMP
 UIEvent::DuplicatePrivateData()
 {
   mClientPoint =
     Event::GetClientCoords(mPresContext, mEvent, mEvent->refPoint,
                            mClientPoint);
--- a/widget/TextEvents.h
+++ b/widget/TextEvents.h
@@ -208,59 +208,51 @@ class WidgetTextEvent : public WidgetGUI
 {
 private:
   friend class dom::PBrowserParent;
   friend class dom::PBrowserChild;
   friend class plugins::PPluginInstanceChild;
 
   WidgetTextEvent()
     : mSeqno(kLatestSeqno)
-    , isChar(false)
   {
   }
 
 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)
-    , isChar(false)
   {
   }
 
   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;
-  // Indicates whether the event signifies printable text.
-  // XXX This is not a standard, and most platforms don't set this properly.
-  //     So, perhaps, we can get rid of this.
-  bool isChar;
 
   nsRefPtr<TextRangeArray> mRanges;
 
   void AssignTextEventData(const WidgetTextEvent& aEvent, bool aCopyTargets)
   {
     AssignGUIEventData(aEvent, aCopyTargets);
 
-    isChar = aEvent.isChar;
-
     // 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();
   }
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -446,32 +446,30 @@ struct ParamTraits<mozilla::WidgetTextEv
 {
   typedef mozilla::WidgetTextEvent paramType;
 
   static void Write(Message* aMsg, const paramType& aParam)
   {
     WriteParam(aMsg, static_cast<mozilla::WidgetGUIEvent>(aParam));
     WriteParam(aMsg, aParam.mSeqno);
     WriteParam(aMsg, aParam.mData);
-    WriteParam(aMsg, aParam.isChar);
     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<mozilla::WidgetGUIEvent*>(aResult)) ||
         !ReadParam(aMsg, aIter, &aResult->mSeqno) ||
         !ReadParam(aMsg, aIter, &aResult->mData) ||
-        !ReadParam(aMsg, aIter, &aResult->isChar) ||
         !ReadParam(aMsg, aIter, &hasRanges)) {
       return false;
     }
 
     if (!hasRanges) {
       aResult->mRanges = nullptr;
     } else {
       aResult->mRanges = new mozilla::TextRangeArray();