From 87c78a5bfb0ec85b9e41dd64bdc0fcef4c170c16 Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Wed, 8 Feb 2017 19:47:05 +0900 Subject: [PATCH] Bug 1337718 part.2 Make EditorEventListener::ShouldHandleNativeKeyBindings() take WidgetKeyboardEvent* instead of nsIDOMKeyEvent* r=m_kato MozReview-Commit-ID: 4JS2yJ6iXgY --HG-- extra : rebase_source : 30cbcab74da7731e446329a3263dd82cd16fdfab --- editor/libeditor/EditorEventListener.cpp | 8 ++++---- editor/libeditor/EditorEventListener.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/editor/libeditor/EditorEventListener.cpp b/editor/libeditor/EditorEventListener.cpp index d813c0b8b534..d3fcba9d87f1 100644 --- a/editor/libeditor/EditorEventListener.cpp +++ b/editor/libeditor/EditorEventListener.cpp @@ -621,7 +621,7 @@ EditorEventListener::KeyPress(nsIDOMKeyEvent* aKeyEvent) return NS_OK; } - if (!ShouldHandleNativeKeyBindings(aKeyEvent)) { + if (!ShouldHandleNativeKeyBindings(keypressEvent)) { return NS_OK; } @@ -1238,7 +1238,8 @@ EditorEventListener::IsFileControlTextBox() } bool -EditorEventListener::ShouldHandleNativeKeyBindings(nsIDOMKeyEvent* aKeyEvent) +EditorEventListener::ShouldHandleNativeKeyBindings( + WidgetKeyboardEvent* aKeyboardEvent) { MOZ_ASSERT(!DetachedFromEditor()); @@ -1250,8 +1251,7 @@ EditorEventListener::ShouldHandleNativeKeyBindings(nsIDOMKeyEvent* aKeyEvent) // unnecessary. IsAcceptableInputEvent currently makes a similar check for // mouse events. - nsCOMPtr target; - aKeyEvent->AsEvent()->GetTarget(getter_AddRefs(target)); + nsCOMPtr target = aKeyboardEvent->GetDOMEventTarget(); nsCOMPtr targetContent = do_QueryInterface(target); if (!targetContent) { return false; diff --git a/editor/libeditor/EditorEventListener.h b/editor/libeditor/EditorEventListener.h index 7244ebea4b3c..a1905abb7f38 100644 --- a/editor/libeditor/EditorEventListener.h +++ b/editor/libeditor/EditorEventListener.h @@ -83,7 +83,7 @@ protected: bool NotifyIMEOfMouseButtonEvent(nsIDOMMouseEvent* aMouseEvent); bool EditorHasFocus(); bool IsFileControlTextBox(); - bool ShouldHandleNativeKeyBindings(nsIDOMKeyEvent* aKeyEvent); + bool ShouldHandleNativeKeyBindings(WidgetKeyboardEvent* aKeyboardEvent); nsresult HandleMiddleClickPaste(nsIDOMMouseEvent* aMouseEvent); /**