diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp index 28cd2d73bea3..756deeba6b36 100644 --- a/content/events/src/nsEventStateManager.cpp +++ b/content/events/src/nsEventStateManager.cpp @@ -1270,8 +1270,7 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext, break; case NS_SELECTION_SET: { - WidgetSelectionEvent *selectionEvent = - static_cast(aEvent); + WidgetSelectionEvent* selectionEvent = aEvent->AsSelectionEvent(); if (IsTargetCrossProcess(selectionEvent)) { // Will not be handled locally, remote the event if (GetCrossProcessTarget()->SendSelectionEvent(*selectionEvent)) @@ -1279,7 +1278,7 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext, break; } nsContentEventHandler handler(mPresContext); - handler.OnSelectionEvent(static_cast(aEvent)); + handler.OnSelectionEvent(selectionEvent); } break; case NS_CONTENT_COMMAND_CUT: diff --git a/widget/xpwidgets/PuppetWidget.cpp b/widget/xpwidgets/PuppetWidget.cpp index 0fba3d319a43..fd283851cead 100644 --- a/widget/xpwidgets/PuppetWidget.cpp +++ b/widget/xpwidgets/PuppetWidget.cpp @@ -285,7 +285,7 @@ PuppetWidget::DispatchEvent(WidgetGUIEvent* event, nsEventStatus& aStatus) return NS_OK; break; case NS_SELECTION_EVENT: - mIMELastReceivedSeqno = static_cast(event)->seqno; + mIMELastReceivedSeqno = event->AsSelectionEvent()->seqno; if (mIMELastReceivedSeqno < mIMELastBlurSeqno) return NS_OK; break;