Bug 920425 part.22 Use mozilla::WidgetEvent::AsSelectionEvent() r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 18 Oct 2013 15:10:25 +0900
changeset 151206 3f95a3a1873cac44f954fd9a2a8f0d7579d7615c
parent 151205 fc070ecf1a0ddfbdc7aa1b8743cca2380c2aa691
child 151207 c607e72bfe0ce6533727c8b3e694ddc327265ce8
push id35111
push usermasayuki@d-toybox.com
push dateFri, 18 Oct 2013 06:10:43 +0000
treeherdermozilla-inbound@bc72b42bcf76 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs920425
milestone27.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 920425 part.22 Use mozilla::WidgetEvent::AsSelectionEvent() r=smaug
content/events/src/nsEventStateManager.cpp
widget/xpwidgets/PuppetWidget.cpp
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -1265,26 +1265,25 @@ nsEventStateManager::PreHandleEvent(nsPr
     {
       // XXX remote event
       nsContentEventHandler handler(mPresContext);
       handler.OnQueryDOMWidgetHittest(aEvent->AsQueryContentEvent());
     }
     break;
   case NS_SELECTION_SET:
     {
-      WidgetSelectionEvent *selectionEvent =
-          static_cast<WidgetSelectionEvent*>(aEvent);
+      WidgetSelectionEvent* selectionEvent = aEvent->AsSelectionEvent();
       if (IsTargetCrossProcess(selectionEvent)) {
         // Will not be handled locally, remote the event
         if (GetCrossProcessTarget()->SendSelectionEvent(*selectionEvent))
           selectionEvent->mSucceeded = true;
         break;
       }
       nsContentEventHandler handler(mPresContext);
-      handler.OnSelectionEvent(static_cast<WidgetSelectionEvent*>(aEvent));
+      handler.OnSelectionEvent(selectionEvent);
     }
     break;
   case NS_CONTENT_COMMAND_CUT:
   case NS_CONTENT_COMMAND_COPY:
   case NS_CONTENT_COMMAND_PASTE:
   case NS_CONTENT_COMMAND_DELETE:
   case NS_CONTENT_COMMAND_UNDO:
   case NS_CONTENT_COMMAND_REDO:
--- a/widget/xpwidgets/PuppetWidget.cpp
+++ b/widget/xpwidgets/PuppetWidget.cpp
@@ -280,17 +280,17 @@ PuppetWidget::DispatchEvent(WidgetGUIEve
       return NS_OK;
     break;
   case NS_TEXT_EVENT:
     mIMELastReceivedSeqno = event->AsTextEvent()->seqno;
     if (mIMELastReceivedSeqno < mIMELastBlurSeqno)
       return NS_OK;
     break;
   case NS_SELECTION_EVENT:
-    mIMELastReceivedSeqno = static_cast<WidgetSelectionEvent*>(event)->seqno;
+    mIMELastReceivedSeqno = event->AsSelectionEvent()->seqno;
     if (mIMELastReceivedSeqno < mIMELastBlurSeqno)
       return NS_OK;
     break;
   default:
     break;
   }
 
   if (mAttachedWidgetListener) {