mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1235830 - Renaming GetInternalNSEvent to WidgetEvent, in nsIDOMEvent r=smaug
MozReview-Commit-ID: Hm8Owq17KXn --HG-- extra : transplant_source : 2%82%D5%89%19%94%7C%E7%CA1%99%B5%24%1F5%E1%C0%1F%DE%07
This commit is contained in:
parent
fa7da9c935
commit
6863090c8a
@ -159,7 +159,7 @@ PostMessageEvent::Run()
|
||||
presContext = shell->GetPresContext();
|
||||
|
||||
event->SetTrusted(mTrustedCaller);
|
||||
WidgetEvent* internalEvent = event->GetInternalNSEvent();
|
||||
WidgetEvent* internalEvent = event->WidgetEventPtr();
|
||||
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
EventDispatcher::Dispatch(window,
|
||||
|
@ -344,7 +344,7 @@ TextInputProcessor::PrepareKeyboardEventForComposition(
|
||||
|
||||
aKeyboardEvent =
|
||||
aOptionalArgc && aDOMKeyEvent ?
|
||||
aDOMKeyEvent->AsEvent()->GetInternalNSEvent()->AsKeyboardEvent() : nullptr;
|
||||
aDOMKeyEvent->AsEvent()->WidgetEventPtr()->AsKeyboardEvent() : nullptr;
|
||||
if (!aKeyboardEvent || aOptionalArgc < 2) {
|
||||
aKeyFlags = 0;
|
||||
}
|
||||
@ -769,7 +769,7 @@ TextInputProcessor::Keydown(nsIDOMKeyEvent* aDOMKeyEvent,
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
WidgetKeyboardEvent* originalKeyEvent =
|
||||
aDOMKeyEvent->AsEvent()->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aDOMKeyEvent->AsEvent()->WidgetEventPtr()->AsKeyboardEvent();
|
||||
if (NS_WARN_IF(!originalKeyEvent)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
@ -875,7 +875,7 @@ TextInputProcessor::Keyup(nsIDOMKeyEvent* aDOMKeyEvent,
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
WidgetKeyboardEvent* originalKeyEvent =
|
||||
aDOMKeyEvent->AsEvent()->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aDOMKeyEvent->AsEvent()->WidgetEventPtr()->AsKeyboardEvent();
|
||||
if (NS_WARN_IF(!originalKeyEvent)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
@ -3783,7 +3783,7 @@ nsContentUtils::DispatchEvent(nsIDocument* aDoc, nsISupports* aTarget,
|
||||
aCancelable, aTrusted, getter_AddRefs(event),
|
||||
getter_AddRefs(target));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
event->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = aOnlyChromeDispatch;
|
||||
event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = aOnlyChromeDispatch;
|
||||
|
||||
bool dummy;
|
||||
return target->DispatchEvent(event, aDefaultAction ? aDefaultAction : &dummy);
|
||||
@ -4947,7 +4947,7 @@ nsContentUtils::GetAccelKeyCandidates(nsIDOMKeyEvent* aDOMKeyEvent,
|
||||
return;
|
||||
|
||||
WidgetKeyboardEvent* nativeKeyEvent =
|
||||
aDOMKeyEvent->AsEvent()->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aDOMKeyEvent->AsEvent()->WidgetEventPtr()->AsKeyboardEvent();
|
||||
if (nativeKeyEvent) {
|
||||
NS_ASSERTION(nativeKeyEvent->mClass == eKeyboardEventClass,
|
||||
"wrong type of native event");
|
||||
|
@ -1773,7 +1773,7 @@ nsDOMWindowUtils::DispatchDOMEventViaPresShell(nsIDOMNode* aTarget,
|
||||
{
|
||||
NS_ENSURE_STATE(aEvent);
|
||||
aEvent->SetTrusted(aTrusted);
|
||||
WidgetEvent* internalEvent = aEvent->GetInternalNSEvent();
|
||||
WidgetEvent* internalEvent = aEvent->WidgetEventPtr();
|
||||
NS_ENSURE_STATE(internalEvent);
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(aTarget);
|
||||
NS_ENSURE_STATE(content);
|
||||
@ -3456,7 +3456,7 @@ nsDOMWindowUtils::DispatchEventToChromeOnly(nsIDOMEventTarget* aTarget,
|
||||
{
|
||||
*aRetVal = false;
|
||||
NS_ENSURE_STATE(aTarget && aEvent);
|
||||
aEvent->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true;
|
||||
aEvent->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
|
||||
aTarget->DispatchEvent(aEvent, aRetVal);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -5095,7 +5095,7 @@ nsDocument::DispatchContentLoadedEvents()
|
||||
// the ancestor document if we used the normal event
|
||||
// dispatching code.
|
||||
|
||||
WidgetEvent* innerEvent = event->GetInternalNSEvent();
|
||||
WidgetEvent* innerEvent = event->WidgetEventPtr();
|
||||
if (innerEvent) {
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
|
||||
@ -8113,7 +8113,7 @@ nsIDocument::CreateEvent(const nsAString& aEventType, ErrorResult& rv) const
|
||||
rv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
WidgetEvent* e = ev->GetInternalNSEvent();
|
||||
WidgetEvent* e = ev->WidgetEventPtr();
|
||||
e->mFlags.mBubbles = false;
|
||||
e->mFlags.mCancelable = false;
|
||||
return ev.forget();
|
||||
@ -9200,7 +9200,7 @@ DispatchCustomEventWithFlush(nsINode* aTarget, const nsAString& aEventType,
|
||||
event->InitEvent(aEventType, aBubbles, false);
|
||||
event->SetTrusted(true);
|
||||
if (aOnlyChromeDispatch) {
|
||||
event->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true;
|
||||
event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
|
||||
}
|
||||
if (nsIPresShell* shell = aTarget->OwnerDoc()->GetShell()) {
|
||||
shell->GetPresContext()->
|
||||
|
@ -5701,7 +5701,7 @@ nsGlobalWindow::DispatchResizeEvent(const CSSIntSize& aSize)
|
||||
}
|
||||
|
||||
domEvent->SetTrusted(true);
|
||||
domEvent->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true;
|
||||
domEvent->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
|
||||
|
||||
nsCOMPtr<EventTarget> target = do_QueryInterface(GetOuterWindow());
|
||||
domEvent->SetTarget(target);
|
||||
@ -8496,7 +8496,7 @@ nsGlobalWindow::LeaveModalState()
|
||||
RefPtr<Event> event = NS_NewDOMEvent(inner, nullptr, nullptr);
|
||||
event->InitEvent(NS_LITERAL_STRING("endmodalstate"), true, false);
|
||||
event->SetTrusted(true);
|
||||
event->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true;
|
||||
event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
|
||||
bool dummy;
|
||||
topWin->DispatchEvent(event, &dummy);
|
||||
}
|
||||
@ -11110,7 +11110,7 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
newEvent->SetTrusted(true);
|
||||
|
||||
if (fireMozStorageChanged) {
|
||||
WidgetEvent* internalEvent = newEvent->GetInternalNSEvent();
|
||||
WidgetEvent* internalEvent = newEvent->WidgetEventPtr();
|
||||
internalEvent->mFlags.mOnlyChromeDispatch = true;
|
||||
}
|
||||
|
||||
@ -13243,7 +13243,7 @@ nsGlobalWindow::BeginWindowMove(Event& aMouseDownEvent, Element* aPanel,
|
||||
}
|
||||
|
||||
WidgetMouseEvent* mouseEvent =
|
||||
aMouseDownEvent.GetInternalNSEvent()->AsMouseEvent();
|
||||
aMouseDownEvent.WidgetEventPtr()->AsMouseEvent();
|
||||
if (!mouseEvent || mouseEvent->mClass != eMouseEventClass) {
|
||||
aError.Throw(NS_ERROR_FAILURE);
|
||||
return;
|
||||
|
@ -353,7 +353,7 @@ nsPluginCrashedEvent::Run()
|
||||
PluginCrashedEvent::Constructor(doc, NS_LITERAL_STRING("PluginCrashed"), init);
|
||||
|
||||
event->SetTrusted(true);
|
||||
event->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true;
|
||||
event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
|
||||
|
||||
EventDispatcher::DispatchDOMEvent(mContent, nullptr, event, nullptr, nullptr);
|
||||
return NS_OK;
|
||||
|
@ -45,7 +45,7 @@ AsyncEventDispatcher::Run()
|
||||
}
|
||||
if (mOnlyChromeDispatch) {
|
||||
MOZ_ASSERT(event->IsTrusted());
|
||||
event->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true;
|
||||
event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
|
||||
}
|
||||
bool dummy;
|
||||
mTarget->DispatchEvent(event, &dummy);
|
||||
|
@ -629,7 +629,7 @@ Event::IsDispatchStopped()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(WidgetEvent*)
|
||||
Event::GetInternalNSEvent()
|
||||
Event::WidgetEventPtr()
|
||||
{
|
||||
return mEvent;
|
||||
}
|
||||
|
@ -359,7 +359,7 @@ private:
|
||||
NS_IMETHOD GetIsTrusted(bool* aIsTrusted) override { return _to GetIsTrusted(aIsTrusted); } \
|
||||
NS_IMETHOD SetTarget(nsIDOMEventTarget* aTarget) override { return _to SetTarget(aTarget); } \
|
||||
NS_IMETHOD_(bool) IsDispatchStopped(void) override { return _to IsDispatchStopped(); } \
|
||||
NS_IMETHOD_(WidgetEvent*) GetInternalNSEvent(void) override { return _to GetInternalNSEvent(); } \
|
||||
NS_IMETHOD_(WidgetEvent*) WidgetEventPtr(void) override { return _to WidgetEventPtr(); } \
|
||||
NS_IMETHOD_(void) SetTrusted(bool aTrusted) override { _to SetTrusted(aTrusted); } \
|
||||
NS_IMETHOD_(void) SetOwner(EventTarget* aOwner) override { _to SetOwner(aOwner); } \
|
||||
NS_IMETHOD_(Event*) InternalDOMEvent() override { return _to InternalDOMEvent(); }
|
||||
|
@ -509,7 +509,7 @@ EventDispatcher::Dispatch(nsISupports* aTarget,
|
||||
}
|
||||
|
||||
if (aDOMEvent) {
|
||||
WidgetEvent* innerEvent = aDOMEvent->GetInternalNSEvent();
|
||||
WidgetEvent* innerEvent = aDOMEvent->WidgetEventPtr();
|
||||
NS_ASSERTION(innerEvent == aEvent,
|
||||
"The inner event of aDOMEvent is not the same as aEvent!");
|
||||
}
|
||||
@ -698,7 +698,7 @@ EventDispatcher::DispatchDOMEvent(nsISupports* aTarget,
|
||||
nsEventStatus* aEventStatus)
|
||||
{
|
||||
if (aDOMEvent) {
|
||||
WidgetEvent* innerEvent = aDOMEvent->GetInternalNSEvent();
|
||||
WidgetEvent* innerEvent = aDOMEvent->WidgetEventPtr();
|
||||
NS_ENSURE_TRUE(innerEvent, NS_ERROR_ILLEGAL_VALUE);
|
||||
|
||||
bool dontResetTrusted = false;
|
||||
|
@ -584,7 +584,7 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext,
|
||||
}
|
||||
|
||||
WidgetMouseEvent* internalEvent =
|
||||
aMouseEvent->AsEvent()->GetInternalNSEvent()->AsMouseEvent();
|
||||
aMouseEvent->AsEvent()->WidgetEventPtr()->AsMouseEvent();
|
||||
if (NS_WARN_IF(!internalEvent)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
|
||||
|
@ -872,7 +872,7 @@ nsTextInputListener::HandleEvent(nsIDOMEvent* aEvent)
|
||||
}
|
||||
|
||||
WidgetKeyboardEvent* keyEvent =
|
||||
aEvent->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aEvent->WidgetEventPtr()->AsKeyboardEvent();
|
||||
if (!keyEvent) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
@ -743,7 +743,7 @@ DispatchErrorEvent(IDBRequest* aRequest,
|
||||
MOZ_ASSERT(!transaction || transaction->IsOpen() || transaction->IsAborted());
|
||||
|
||||
if (transaction && transaction->IsOpen()) {
|
||||
WidgetEvent* internalEvent = aEvent->GetInternalNSEvent();
|
||||
WidgetEvent* internalEvent = aEvent->WidgetEventPtr();
|
||||
MOZ_ASSERT(internalEvent);
|
||||
|
||||
if (internalEvent->mFlags.mExceptionHasBeenRisen) {
|
||||
@ -816,7 +816,7 @@ DispatchSuccessEvent(ResultHelper* aResultHelper,
|
||||
MOZ_ASSERT_IF(transaction,
|
||||
transaction->IsOpen() || transaction->IsAborted());
|
||||
|
||||
WidgetEvent* internalEvent = aEvent->GetInternalNSEvent();
|
||||
WidgetEvent* internalEvent = aEvent->WidgetEventPtr();
|
||||
MOZ_ASSERT(internalEvent);
|
||||
|
||||
if (transaction &&
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
interface nsIDOMEventTarget;
|
||||
|
||||
[ptr] native WidgetEventPtr(mozilla::WidgetEvent);
|
||||
[ptr] native WidgetEvent(mozilla::WidgetEvent);
|
||||
[ptr] native DOMEventPtr(mozilla::dom::Event);
|
||||
[ptr] native IPCMessagePtr(IPC::Message);
|
||||
[ptr] native ConstIPCMessagePtr(const IPC::Message);
|
||||
@ -207,7 +207,7 @@ interface nsIDOMEvent : nsISupports
|
||||
[noscript] void duplicatePrivateData();
|
||||
[noscript] void setTarget(in nsIDOMEventTarget aTarget);
|
||||
[notxpcom] boolean IsDispatchStopped();
|
||||
[notxpcom] WidgetEventPtr GetInternalNSEvent();
|
||||
[notxpcom] WidgetEvent WidgetEventPtr();
|
||||
[noscript,notxpcom] void SetTrusted(in boolean aTrusted);
|
||||
[notxpcom] void Serialize(in IPCMessagePtr aMsg,
|
||||
in boolean aSerializeInterfaceType);
|
||||
|
@ -3101,7 +3101,7 @@ TabParent::LayerTreeUpdate(bool aActive)
|
||||
event->InitEvent(NS_LITERAL_STRING("MozLayerTreeCleared"), true, false);
|
||||
}
|
||||
event->SetTrusted(true);
|
||||
event->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true;
|
||||
event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
|
||||
bool dummy;
|
||||
mFrameElement->DispatchEvent(event, &dummy);
|
||||
return true;
|
||||
@ -3136,7 +3136,7 @@ TabParent::RecvRemotePaintIsReady()
|
||||
RefPtr<Event> event = NS_NewDOMEvent(mFrameElement, nullptr, nullptr);
|
||||
event->InitEvent(NS_LITERAL_STRING("MozAfterRemotePaint"), false, false);
|
||||
event->SetTrusted(true);
|
||||
event->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true;
|
||||
event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
|
||||
bool dummy;
|
||||
mFrameElement->DispatchEvent(event, &dummy);
|
||||
return true;
|
||||
|
@ -205,7 +205,7 @@ GeckoMediaPluginService::GMPCrashCallback::Run(const nsACString& aPluginName)
|
||||
RefPtr<dom::PluginCrashedEvent> event =
|
||||
dom::PluginCrashedEvent::Constructor(document, NS_LITERAL_STRING("PluginCrashed"), init);
|
||||
event->SetTrusted(true);
|
||||
event->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true;
|
||||
event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
|
||||
|
||||
EventDispatcher::DispatchDOMEvent(parentWindow, nullptr, event, nullptr, nullptr);
|
||||
}
|
||||
|
@ -1665,7 +1665,7 @@ nsresult nsPluginInstanceOwner::DispatchFocusToPlugin(nsIDOMEvent* aFocusEvent)
|
||||
}
|
||||
#endif
|
||||
|
||||
WidgetEvent* theEvent = aFocusEvent->GetInternalNSEvent();
|
||||
WidgetEvent* theEvent = aFocusEvent->WidgetEventPtr();
|
||||
if (theEvent) {
|
||||
WidgetGUIEvent focusEvent(theEvent->mFlags.mIsTrusted, theEvent->mMessage,
|
||||
nullptr);
|
||||
@ -1707,7 +1707,7 @@ nsresult nsPluginInstanceOwner::DispatchKeyToPlugin(nsIDOMEvent* aKeyEvent)
|
||||
|
||||
if (mInstance) {
|
||||
WidgetKeyboardEvent* keyEvent =
|
||||
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aKeyEvent->WidgetEventPtr()->AsKeyboardEvent();
|
||||
if (keyEvent && keyEvent->mClass == eKeyboardEventClass) {
|
||||
nsEventStatus rv = ProcessEvent(*keyEvent);
|
||||
if (nsEventStatus_eConsumeNoDefault == rv) {
|
||||
@ -1742,7 +1742,7 @@ nsPluginInstanceOwner::ProcessMouseDown(nsIDOMEvent* aMouseEvent)
|
||||
}
|
||||
|
||||
WidgetMouseEvent* mouseEvent =
|
||||
aMouseEvent->GetInternalNSEvent()->AsMouseEvent();
|
||||
aMouseEvent->WidgetEventPtr()->AsMouseEvent();
|
||||
if (mouseEvent && mouseEvent->mClass == eMouseEventClass) {
|
||||
mLastMouseDownButtonType = mouseEvent->button;
|
||||
nsEventStatus rv = ProcessEvent(*mouseEvent);
|
||||
@ -1767,7 +1767,7 @@ nsresult nsPluginInstanceOwner::DispatchMouseToPlugin(nsIDOMEvent* aMouseEvent,
|
||||
return NS_OK;
|
||||
|
||||
WidgetMouseEvent* mouseEvent =
|
||||
aMouseEvent->GetInternalNSEvent()->AsMouseEvent();
|
||||
aMouseEvent->WidgetEventPtr()->AsMouseEvent();
|
||||
if (mouseEvent && mouseEvent->mClass == eMouseEventClass) {
|
||||
nsEventStatus rv = ProcessEvent(*mouseEvent);
|
||||
if (nsEventStatus_eConsumeNoDefault == rv) {
|
||||
@ -1882,7 +1882,7 @@ nsPluginInstanceOwner::DispatchCompositionToPlugin(nsIDOMEvent* aEvent)
|
||||
return NS_OK;
|
||||
}
|
||||
WidgetCompositionEvent* compositionEvent =
|
||||
aEvent->GetInternalNSEvent()->AsCompositionEvent();
|
||||
aEvent->WidgetEventPtr()->AsCompositionEvent();
|
||||
if (NS_WARN_IF(!compositionEvent)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
@ -2025,7 +2025,7 @@ nsPluginInstanceOwner::HandleEvent(nsIDOMEvent* aEvent)
|
||||
|
||||
nsCOMPtr<nsIDOMDragEvent> dragEvent(do_QueryInterface(aEvent));
|
||||
if (dragEvent && mInstance) {
|
||||
WidgetEvent* ievent = aEvent->GetInternalNSEvent();
|
||||
WidgetEvent* ievent = aEvent->WidgetEventPtr();
|
||||
if (ievent && ievent->mFlags.mIsTrusted &&
|
||||
ievent->mMessage != eDragEnter && ievent->mMessage != eDragOver) {
|
||||
aEvent->PreventDefault();
|
||||
|
@ -264,7 +264,7 @@ public:
|
||||
MOZ_ASSERT(aWorkerScope);
|
||||
MOZ_ASSERT(aEvent);
|
||||
nsCOMPtr<nsIGlobalObject> sgo = aWorkerScope;
|
||||
WidgetEvent* internalEvent = aEvent->GetInternalNSEvent();
|
||||
WidgetEvent* internalEvent = aEvent->WidgetEventPtr();
|
||||
|
||||
ErrorResult result;
|
||||
result = aWorkerScope->DispatchDOMEvent(nullptr, aEvent, nullptr, nullptr);
|
||||
@ -1223,7 +1223,7 @@ private:
|
||||
nsCOMPtr<nsIRunnable> runnable;
|
||||
if (event->DefaultPrevented(aCx)) {
|
||||
event->ReportCanceled();
|
||||
} else if (event->GetInternalNSEvent()->mFlags.mExceptionHasBeenRisen) {
|
||||
} else if (event->WidgetEventPtr()->mFlags.mExceptionHasBeenRisen) {
|
||||
// Exception logged via the WorkerPrivate ErrorReporter
|
||||
} else {
|
||||
runnable = new ResumeRequest(mInterceptedChannel);
|
||||
|
@ -90,7 +90,7 @@ nsXBLKeyEventHandler::ExecuteMatchedHandlers(
|
||||
uint32_t aCharCode,
|
||||
const IgnoreModifierState& aIgnoreModifierState)
|
||||
{
|
||||
WidgetEvent* event = aKeyEvent->AsEvent()->GetInternalNSEvent();
|
||||
WidgetEvent* event = aKeyEvent->AsEvent()->WidgetEventPtr();
|
||||
nsCOMPtr<EventTarget> target = aKeyEvent->AsEvent()->InternalDOMEvent()->GetCurrentTarget();
|
||||
|
||||
bool executed = false;
|
||||
|
@ -905,7 +905,7 @@ nsXBLPrototypeHandler::ModifiersMatchMask(
|
||||
nsIDOMUIEvent* aEvent,
|
||||
const IgnoreModifierState& aIgnoreModifierState)
|
||||
{
|
||||
WidgetInputEvent* inputEvent = aEvent->AsEvent()->GetInternalNSEvent()->AsInputEvent();
|
||||
WidgetInputEvent* inputEvent = aEvent->AsEvent()->WidgetEventPtr()->AsInputEvent();
|
||||
NS_ENSURE_TRUE(inputEvent, false);
|
||||
|
||||
if (mKeyMask & cMetaMask) {
|
||||
|
@ -322,14 +322,14 @@ void
|
||||
nsXBLWindowKeyHandler::HandleEventOnCapture(nsIDOMKeyEvent* aEvent)
|
||||
{
|
||||
WidgetKeyboardEvent* widgetEvent =
|
||||
aEvent->AsEvent()->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aEvent->AsEvent()->WidgetEventPtr()->AsKeyboardEvent();
|
||||
|
||||
if (widgetEvent->mFlags.mNoCrossProcessBoundaryForwarding) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<mozilla::dom::Element> originalTarget =
|
||||
do_QueryInterface(aEvent->AsEvent()->GetInternalNSEvent()->originalTarget);
|
||||
do_QueryInterface(aEvent->AsEvent()->WidgetEventPtr()->originalTarget);
|
||||
if (!EventStateManager::IsRemoteTarget(originalTarget)) {
|
||||
return;
|
||||
}
|
||||
@ -565,7 +565,7 @@ nsXBLWindowKeyHandler::WalkHandlersAndExecute(
|
||||
// retry to look for a shortcut key without the Windows-Logo key press.
|
||||
if (!aIgnoreModifierState.mOS) {
|
||||
WidgetKeyboardEvent* keyEvent =
|
||||
aKeyEvent->AsEvent()->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aKeyEvent->AsEvent()->WidgetEventPtr()->AsKeyboardEvent();
|
||||
if (keyEvent && keyEvent->IsOS()) {
|
||||
IgnoreModifierState ignoreModifierState(aIgnoreModifierState);
|
||||
ignoreModifierState.mOS = true;
|
||||
|
@ -4616,7 +4616,7 @@ nsEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
|
||||
// HandleKeyPressEvent()'s switch statement.
|
||||
|
||||
WidgetKeyboardEvent* nativeKeyEvent =
|
||||
aKeyEvent->AsEvent()->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aKeyEvent->AsEvent()->WidgetEventPtr()->AsKeyboardEvent();
|
||||
NS_ENSURE_TRUE(nativeKeyEvent, NS_ERROR_UNEXPECTED);
|
||||
NS_ASSERTION(nativeKeyEvent->mMessage == eKeyPress,
|
||||
"HandleKeyPressEvent gets non-keypress event");
|
||||
@ -5053,7 +5053,7 @@ nsEditor::IsAcceptableInputEvent(nsIDOMEvent* aEvent)
|
||||
// If the event is trusted, the event should always cause input.
|
||||
NS_ENSURE_TRUE(aEvent, false);
|
||||
|
||||
WidgetEvent* widgetEvent = aEvent->GetInternalNSEvent();
|
||||
WidgetEvent* widgetEvent = aEvent->WidgetEventPtr();
|
||||
if (NS_WARN_IF(!widgetEvent)) {
|
||||
return false;
|
||||
}
|
||||
@ -5086,7 +5086,7 @@ nsEditor::IsAcceptableInputEvent(nsIDOMEvent* aEvent)
|
||||
case eCompositionCommitAsIs:
|
||||
// Don't allow composition events whose internal event are not
|
||||
// WidgetCompositionEvent.
|
||||
widgetGUIEvent = aEvent->GetInternalNSEvent()->AsCompositionEvent();
|
||||
widgetGUIEvent = aEvent->WidgetEventPtr()->AsCompositionEvent();
|
||||
needsWidget = true;
|
||||
break;
|
||||
default:
|
||||
|
@ -357,7 +357,7 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent)
|
||||
|
||||
nsCOMPtr<nsIEditor> kungFuDeathGrip = mEditor;
|
||||
|
||||
WidgetEvent* internalEvent = aEvent->GetInternalNSEvent();
|
||||
WidgetEvent* internalEvent = aEvent->WidgetEventPtr();
|
||||
|
||||
// Let's handle each event with the message of the internal event of the
|
||||
// coming event. If the DOM event was created with improper interface,
|
||||
@ -641,7 +641,7 @@ nsEditorEventListener::KeyPress(nsIDOMKeyEvent* aKeyEvent)
|
||||
|
||||
// Now, ask the native key bindings to handle the event.
|
||||
WidgetKeyboardEvent* keyEvent =
|
||||
aKeyEvent->AsEvent()->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aKeyEvent->AsEvent()->WidgetEventPtr()->AsKeyboardEvent();
|
||||
MOZ_ASSERT(keyEvent,
|
||||
"DOM key event's internal event must be WidgetKeyboardEvent");
|
||||
nsIWidget* widget = keyEvent->widget;
|
||||
@ -1047,7 +1047,7 @@ nsEditorEventListener::HandleStartComposition(nsIDOMEvent* aCompositionEvent)
|
||||
return NS_OK;
|
||||
}
|
||||
WidgetCompositionEvent* compositionStart =
|
||||
aCompositionEvent->GetInternalNSEvent()->AsCompositionEvent();
|
||||
aCompositionEvent->WidgetEventPtr()->AsCompositionEvent();
|
||||
return mEditor->BeginIMEComposition(compositionStart);
|
||||
}
|
||||
|
||||
|
@ -617,7 +617,7 @@ nsHTMLEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
|
||||
}
|
||||
|
||||
WidgetKeyboardEvent* nativeKeyEvent =
|
||||
aKeyEvent->AsEvent()->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aKeyEvent->AsEvent()->WidgetEventPtr()->AsKeyboardEvent();
|
||||
NS_ENSURE_TRUE(nativeKeyEvent, NS_ERROR_UNEXPECTED);
|
||||
NS_ASSERTION(nativeKeyEvent->mMessage == eKeyPress,
|
||||
"HandleKeyPressEvent gets non-keypress event");
|
||||
@ -5182,7 +5182,7 @@ nsHTMLEditor::IsAcceptableInputEvent(nsIDOMEvent* aEvent)
|
||||
// While there is composition, all composition events in its top level window
|
||||
// are always fired on the composing editor. Therefore, if this editor has
|
||||
// composition, the composition events should be handled in this editor.
|
||||
if (mComposition && aEvent->GetInternalNSEvent()->AsCompositionEvent()) {
|
||||
if (mComposition && aEvent->WidgetEventPtr()->AsCompositionEvent()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ nsresult nsPlaintextEditor::InsertFromDrop(nsIDOMEvent* aDropEvent)
|
||||
}
|
||||
|
||||
if (nsContentUtils::CheckForSubFrameDrop(dragSession,
|
||||
aDropEvent->GetInternalNSEvent()->AsDragEvent())) {
|
||||
aDropEvent->WidgetEventPtr()->AsDragEvent())) {
|
||||
// Don't allow drags from subframe documents with different origins than
|
||||
// the drop destination.
|
||||
if (srcdomdoc && !IsSafeToInsertData(srcdomdoc))
|
||||
|
@ -362,7 +362,7 @@ nsPlaintextEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
|
||||
}
|
||||
|
||||
WidgetKeyboardEvent* nativeKeyEvent =
|
||||
aKeyEvent->AsEvent()->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aKeyEvent->AsEvent()->WidgetEventPtr()->AsKeyboardEvent();
|
||||
NS_ENSURE_TRUE(nativeKeyEvent, NS_ERROR_UNEXPECTED);
|
||||
NS_ASSERTION(nativeKeyEvent->mMessage == eKeyPress,
|
||||
"HandleKeyPressEvent gets non-keypress event");
|
||||
@ -848,7 +848,7 @@ nsPlaintextEditor::UpdateIMEComposition(nsIDOMEvent* aDOMTextEvent)
|
||||
MOZ_ASSERT(aDOMTextEvent, "aDOMTextEvent must not be nullptr");
|
||||
|
||||
WidgetCompositionEvent* compositionChangeEvent =
|
||||
aDOMTextEvent->GetInternalNSEvent()->AsCompositionEvent();
|
||||
aDOMTextEvent->WidgetEventPtr()->AsCompositionEvent();
|
||||
NS_ENSURE_TRUE(compositionChangeEvent, NS_ERROR_INVALID_ARG);
|
||||
MOZ_ASSERT(compositionChangeEvent->mMessage == eCompositionChange,
|
||||
"The internal event should be eCompositionChange");
|
||||
|
@ -63,7 +63,7 @@ nsAutoWindowStateHelper::DispatchEventToChrome(const char* aEventName)
|
||||
}
|
||||
event->InitEvent(NS_ConvertASCIItoUTF16(aEventName), true, true);
|
||||
event->SetTrusted(true);
|
||||
event->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true;
|
||||
event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
|
||||
|
||||
nsCOMPtr<EventTarget> target = do_QueryInterface(mWindow);
|
||||
bool defaultActionEnabled;
|
||||
|
@ -1209,7 +1209,7 @@ AccessibleCaretManager::DispatchCaretStateChangedEvent(CaretChangedReason aReaso
|
||||
CaretStateChangedEvent::Constructor(doc, NS_LITERAL_STRING("mozcaretstatechanged"), init);
|
||||
|
||||
event->SetTrusted(true);
|
||||
event->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true;
|
||||
event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
|
||||
|
||||
AC_LOG("%s: reason %d, collapsed %d, caretVisible %d", __FUNCTION__,
|
||||
init.mReason, init.mCollapsed, init.mCaretVisible);
|
||||
|
@ -1141,7 +1141,7 @@ nsDocumentViewer::PermitUnloadInternal(bool *aShouldPrompt,
|
||||
// the event being dispatched.
|
||||
if (!sIsBeforeUnloadDisabled && *aShouldPrompt && dialogsAreEnabled && mDocument &&
|
||||
(!sBeforeUnloadRequiresInteraction || mDocument->UserHasInteracted()) &&
|
||||
(event->GetInternalNSEvent()->mFlags.mDefaultPrevented ||
|
||||
(event->WidgetEventPtr()->mFlags.mDefaultPrevented ||
|
||||
!text.IsEmpty())) {
|
||||
// Ask the user if it's ok to unload the current page
|
||||
|
||||
|
@ -2054,7 +2054,7 @@ nsLayoutUtils::GetDOMEventCoordinatesRelativeTo(nsIDOMEvent* aDOMEvent, nsIFrame
|
||||
{
|
||||
if (!aDOMEvent)
|
||||
return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
|
||||
WidgetEvent* event = aDOMEvent->GetInternalNSEvent();
|
||||
WidgetEvent* event = aDOMEvent->WidgetEventPtr();
|
||||
if (!event)
|
||||
return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
|
||||
return GetEventCoordinatesRelativeTo(event, aFrame);
|
||||
|
@ -1643,7 +1643,7 @@ nsListControlFrame::MouseUp(nsIDOMEvent* aMouseEvent)
|
||||
// So we cheat here by either setting or unsetting the clcikCount in the native event
|
||||
// so the right thing happens for the onclick event
|
||||
WidgetMouseEvent* mouseEvent =
|
||||
aMouseEvent->GetInternalNSEvent()->AsMouseEvent();
|
||||
aMouseEvent->WidgetEventPtr()->AsMouseEvent();
|
||||
|
||||
int32_t selectedIndex;
|
||||
if (NS_SUCCEEDED(GetIndexFromDOMEvent(aMouseEvent, selectedIndex))) {
|
||||
@ -2097,7 +2097,7 @@ nsListControlFrame::KeyDown(nsIDOMEvent* aKeyEvent)
|
||||
// XXXmats in onkeydown. That seems sub-optimal though.
|
||||
|
||||
const WidgetKeyboardEvent* keyEvent =
|
||||
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aKeyEvent->WidgetEventPtr()->AsKeyboardEvent();
|
||||
MOZ_ASSERT(keyEvent,
|
||||
"DOM event must have WidgetKeyboardEvent for its internal event");
|
||||
|
||||
@ -2250,7 +2250,7 @@ nsListControlFrame::KeyPress(nsIDOMEvent* aKeyEvent)
|
||||
AutoIncrementalSearchResetter incrementalSearchResetter;
|
||||
|
||||
const WidgetKeyboardEvent* keyEvent =
|
||||
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aKeyEvent->WidgetEventPtr()->AsKeyboardEvent();
|
||||
MOZ_ASSERT(keyEvent,
|
||||
"DOM event must have WidgetKeyboardEvent for its internal event");
|
||||
|
||||
|
@ -112,7 +112,7 @@ static eEventAction
|
||||
GetActionForEvent(nsIDOMEvent* aEvent)
|
||||
{
|
||||
WidgetKeyboardEvent* keyEvent =
|
||||
aEvent->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aEvent->WidgetEventPtr()->AsKeyboardEvent();
|
||||
if (!keyEvent) {
|
||||
return eEventAction_Suppress;
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ nsMenuBarFrame::FindMenuWithShortcut(nsIDOMKeyEvent* aKeyEvent)
|
||||
|
||||
AutoTArray<uint32_t, 10> accessKeys;
|
||||
WidgetKeyboardEvent* nativeKeyEvent =
|
||||
aKeyEvent->AsEvent()->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aKeyEvent->AsEvent()->WidgetEventPtr()->AsKeyboardEvent();
|
||||
if (nativeKeyEvent)
|
||||
nsContentUtils::GetAccessKeyCandidates(nativeKeyEvent, accessKeys);
|
||||
if (accessKeys.IsEmpty() && charCode)
|
||||
|
@ -219,7 +219,7 @@ nsMenuBarListener::KeyPress(nsIDOMEvent* aKeyEvent)
|
||||
bool hasAccessKeyCandidates = charCode != 0;
|
||||
if (!hasAccessKeyCandidates) {
|
||||
WidgetKeyboardEvent* nativeKeyEvent =
|
||||
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
|
||||
aKeyEvent->WidgetEventPtr()->AsKeyboardEvent();
|
||||
if (nativeKeyEvent) {
|
||||
AutoTArray<uint32_t, 10> keys;
|
||||
nsContentUtils::GetAccessKeyCandidates(nativeKeyEvent, keys);
|
||||
@ -294,7 +294,7 @@ Modifiers
|
||||
nsMenuBarListener::GetModifiersForAccessKey(nsIDOMKeyEvent* aKeyEvent)
|
||||
{
|
||||
WidgetInputEvent* inputEvent =
|
||||
aKeyEvent->AsEvent()->GetInternalNSEvent()->AsInputEvent();
|
||||
aKeyEvent->AsEvent()->WidgetEventPtr()->AsInputEvent();
|
||||
MOZ_ASSERT(inputEvent);
|
||||
|
||||
static const Modifiers kPossibleModifiersForAccessKey =
|
||||
|
@ -966,7 +966,7 @@ nsSliderFrame::StartDrag(nsIDOMEvent* aEvent)
|
||||
nsGkAtoms::_true, eCaseMatters))
|
||||
return NS_OK;
|
||||
|
||||
WidgetGUIEvent* event = aEvent->GetInternalNSEvent()->AsGUIEvent();
|
||||
WidgetGUIEvent* event = aEvent->WidgetEventPtr()->AsGUIEvent();
|
||||
|
||||
if (!ShouldScrollForEvent(event)) {
|
||||
return NS_OK;
|
||||
|
@ -597,7 +597,7 @@ nsXULPopupManager::InitTriggerEvent(nsIDOMEvent* aEvent, nsIContent* aPopup,
|
||||
// get the event coordinates relative to the root frame of the document
|
||||
// containing the popup.
|
||||
NS_ASSERTION(aPopup, "Expected a popup node");
|
||||
WidgetEvent* event = aEvent->GetInternalNSEvent();
|
||||
WidgetEvent* event = aEvent->WidgetEventPtr();
|
||||
if (event) {
|
||||
WidgetInputEvent* inputEvent = event->AsInputEvent();
|
||||
if (inputEvent) {
|
||||
@ -2058,7 +2058,7 @@ nsXULPopupManager::HandleShortcutNavigation(nsIDOMKeyEvent* aKeyEvent,
|
||||
{
|
||||
// On Windows, don't check shortcuts when the accelerator key is down.
|
||||
#ifdef XP_WIN
|
||||
WidgetInputEvent* evt = aKeyEvent->AsEvent()->GetInternalNSEvent()->AsInputEvent();
|
||||
WidgetInputEvent* evt = aKeyEvent->AsEvent()->WidgetEventPtr()->AsInputEvent();
|
||||
if (evt && evt->IsAccel()) {
|
||||
return false;
|
||||
}
|
||||
@ -2074,7 +2074,7 @@ nsXULPopupManager::HandleShortcutNavigation(nsIDOMKeyEvent* aKeyEvent,
|
||||
if (result) {
|
||||
aFrame->ChangeMenuItem(result, false, true);
|
||||
if (action) {
|
||||
WidgetGUIEvent* evt = aKeyEvent->AsEvent()->GetInternalNSEvent()->AsGUIEvent();
|
||||
WidgetGUIEvent* evt = aKeyEvent->AsEvent()->WidgetEventPtr()->AsGUIEvent();
|
||||
nsMenuFrame* menuToOpen = result->Enter(evt);
|
||||
if (menuToOpen) {
|
||||
nsCOMPtr<nsIContent> content = menuToOpen->GetContent();
|
||||
@ -2321,7 +2321,7 @@ nsXULPopupManager::HandleKeyboardEventWithKeyCode(
|
||||
// Enter method will return a menu if one needs to be opened as a result.
|
||||
nsMenuFrame* menuToOpen = nullptr;
|
||||
WidgetGUIEvent* GUIEvent = aKeyEvent->AsEvent()->
|
||||
GetInternalNSEvent()->AsGUIEvent();
|
||||
WidgetEventPtr()->AsGUIEvent();
|
||||
|
||||
if (aTopVisibleMenuItem) {
|
||||
menuToOpen = aTopVisibleMenuItem->Frame()->Enter(GUIEvent);
|
||||
|
@ -2628,7 +2628,7 @@ PeerConnectionImpl::PluginCrash(uint32_t aPluginID,
|
||||
PluginCrashedEvent::Constructor(doc, NS_LITERAL_STRING("PluginCrashed"), init);
|
||||
|
||||
event->SetTrusted(true);
|
||||
event->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true;
|
||||
event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
|
||||
|
||||
EventDispatcher::DispatchDOMEvent(mWindow, nullptr, event, nullptr, nullptr);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user