зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1455052 part 4. Stop using nsIDOMEvent in xpidl interfaces. r=masayuki
MozReview-Commit-ID: GIs8DVfduKe
This commit is contained in:
Родитель
0ba5797320
Коммит
79bd05835f
|
@ -18,6 +18,7 @@
|
|||
#include "nsPIDOMWindow.h"
|
||||
#include "nsPresContext.h"
|
||||
|
||||
using mozilla::dom::Event;
|
||||
using mozilla::dom::KeyboardEvent;
|
||||
using namespace mozilla::widget;
|
||||
|
||||
|
@ -603,7 +604,7 @@ TextInputProcessor::PrepareKeyboardEventForComposition(
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TextInputProcessor::StartComposition(nsIDOMEvent* aDOMKeyEvent,
|
||||
TextInputProcessor::StartComposition(Event* aDOMKeyEvent,
|
||||
uint32_t aKeyFlags,
|
||||
uint8_t aOptionalArgc,
|
||||
bool* aSucceeded)
|
||||
|
@ -614,7 +615,7 @@ TextInputProcessor::StartComposition(nsIDOMEvent* aDOMKeyEvent,
|
|||
|
||||
RefPtr<KeyboardEvent> keyEvent;
|
||||
if (aDOMKeyEvent) {
|
||||
keyEvent = aDOMKeyEvent->InternalDOMEvent()->AsKeyboardEvent();
|
||||
keyEvent = aDOMKeyEvent->AsKeyboardEvent();
|
||||
if (NS_WARN_IF(!keyEvent)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
@ -701,7 +702,7 @@ TextInputProcessor::SetCaretInPendingComposition(uint32_t aOffset)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TextInputProcessor::FlushPendingComposition(nsIDOMEvent* aDOMKeyEvent,
|
||||
TextInputProcessor::FlushPendingComposition(Event* aDOMKeyEvent,
|
||||
uint32_t aKeyFlags,
|
||||
uint8_t aOptionalArgc,
|
||||
bool* aSucceeded)
|
||||
|
@ -719,7 +720,7 @@ TextInputProcessor::FlushPendingComposition(nsIDOMEvent* aDOMKeyEvent,
|
|||
|
||||
RefPtr<KeyboardEvent> keyEvent;
|
||||
if (aDOMKeyEvent) {
|
||||
keyEvent = aDOMKeyEvent->InternalDOMEvent()->AsKeyboardEvent();
|
||||
keyEvent = aDOMKeyEvent->AsKeyboardEvent();
|
||||
if (NS_WARN_IF(!keyEvent)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
@ -761,7 +762,7 @@ TextInputProcessor::FlushPendingComposition(nsIDOMEvent* aDOMKeyEvent,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TextInputProcessor::CommitComposition(nsIDOMEvent* aDOMKeyEvent,
|
||||
TextInputProcessor::CommitComposition(Event* aDOMKeyEvent,
|
||||
uint32_t aKeyFlags,
|
||||
uint8_t aOptionalArgc)
|
||||
{
|
||||
|
@ -769,7 +770,7 @@ TextInputProcessor::CommitComposition(nsIDOMEvent* aDOMKeyEvent,
|
|||
|
||||
RefPtr<KeyboardEvent> keyEvent;
|
||||
if (aDOMKeyEvent) {
|
||||
keyEvent = aDOMKeyEvent->InternalDOMEvent()->AsKeyboardEvent();
|
||||
keyEvent = aDOMKeyEvent->AsKeyboardEvent();
|
||||
if (NS_WARN_IF(!keyEvent)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
@ -788,7 +789,7 @@ TextInputProcessor::CommitComposition(nsIDOMEvent* aDOMKeyEvent,
|
|||
|
||||
NS_IMETHODIMP
|
||||
TextInputProcessor::CommitCompositionWith(const nsAString& aCommitString,
|
||||
nsIDOMEvent* aDOMKeyEvent,
|
||||
Event* aDOMKeyEvent,
|
||||
uint32_t aKeyFlags,
|
||||
uint8_t aOptionalArgc,
|
||||
bool* aSucceeded)
|
||||
|
@ -798,7 +799,7 @@ TextInputProcessor::CommitCompositionWith(const nsAString& aCommitString,
|
|||
|
||||
RefPtr<KeyboardEvent> keyEvent;
|
||||
if (aDOMKeyEvent) {
|
||||
keyEvent = aDOMKeyEvent->InternalDOMEvent()->AsKeyboardEvent();
|
||||
keyEvent = aDOMKeyEvent->AsKeyboardEvent();
|
||||
if (NS_WARN_IF(!keyEvent)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
@ -860,7 +861,7 @@ TextInputProcessor::CommitCompositionInternal(
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TextInputProcessor::CancelComposition(nsIDOMEvent* aDOMKeyEvent,
|
||||
TextInputProcessor::CancelComposition(Event* aDOMKeyEvent,
|
||||
uint32_t aKeyFlags,
|
||||
uint8_t aOptionalArgc)
|
||||
{
|
||||
|
@ -868,7 +869,7 @@ TextInputProcessor::CancelComposition(nsIDOMEvent* aDOMKeyEvent,
|
|||
|
||||
RefPtr<KeyboardEvent> keyEvent;
|
||||
if (aDOMKeyEvent) {
|
||||
keyEvent = aDOMKeyEvent->InternalDOMEvent()->AsKeyboardEvent();
|
||||
keyEvent = aDOMKeyEvent->AsKeyboardEvent();
|
||||
if (NS_WARN_IF(!keyEvent)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
@ -1076,7 +1077,7 @@ TextInputProcessor::PrepareKeyboardEventToDispatch(
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TextInputProcessor::Keydown(nsIDOMEvent* aDOMKeyEvent,
|
||||
TextInputProcessor::Keydown(Event* aDOMKeyEvent,
|
||||
uint32_t aKeyFlags,
|
||||
uint8_t aOptionalArgc,
|
||||
uint32_t* aConsumedFlags)
|
||||
|
@ -1090,7 +1091,7 @@ TextInputProcessor::Keydown(nsIDOMEvent* aDOMKeyEvent,
|
|||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
WidgetKeyboardEvent* originalKeyEvent =
|
||||
aDOMKeyEvent->InternalDOMEvent()->WidgetEventPtr()->AsKeyboardEvent();
|
||||
aDOMKeyEvent->WidgetEventPtr()->AsKeyboardEvent();
|
||||
if (NS_WARN_IF(!originalKeyEvent)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
@ -1169,7 +1170,7 @@ TextInputProcessor::KeydownInternal(const WidgetKeyboardEvent& aKeyboardEvent,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TextInputProcessor::Keyup(nsIDOMEvent* aDOMKeyEvent,
|
||||
TextInputProcessor::Keyup(Event* aDOMKeyEvent,
|
||||
uint32_t aKeyFlags,
|
||||
uint8_t aOptionalArgc,
|
||||
bool* aDoDefault)
|
||||
|
@ -1183,7 +1184,7 @@ TextInputProcessor::Keyup(nsIDOMEvent* aDOMKeyEvent,
|
|||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
WidgetKeyboardEvent* originalKeyEvent =
|
||||
aDOMKeyEvent->InternalDOMEvent()->WidgetEventPtr()->AsKeyboardEvent();
|
||||
aDOMKeyEvent->WidgetEventPtr()->AsKeyboardEvent();
|
||||
if (NS_WARN_IF(!originalKeyEvent)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "mozilla/layers/LayerTransactionChild.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsError.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsQueryContentEventResult.h"
|
||||
#include "nsGlobalWindow.h"
|
||||
#include "nsIDocument.h"
|
||||
|
@ -19,6 +18,7 @@
|
|||
#include "nsRefreshDriver.h"
|
||||
#include "mozilla/dom/BindingDeclarations.h"
|
||||
#include "mozilla/dom/BlobBinding.h"
|
||||
#include "mozilla/dom/Event.h"
|
||||
#include "mozilla/dom/Touch.h"
|
||||
#include "mozilla/PendingAnimationTracker.h"
|
||||
#include "nsIObjectLoadingContent.h"
|
||||
|
@ -1851,7 +1851,7 @@ nsDOMWindowUtils::GetFullZoom(float* aFullZoom)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::DispatchDOMEventViaPresShell(nsIDOMNode* aTarget,
|
||||
nsIDOMEvent* aEvent,
|
||||
Event* aEvent,
|
||||
bool aTrusted,
|
||||
bool* aRetVal)
|
||||
{
|
||||
|
@ -3706,14 +3706,14 @@ nsDOMWindowUtils::GetPaintFlashing(bool* aRetVal)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::DispatchEventToChromeOnly(EventTarget* aTarget,
|
||||
nsIDOMEvent* aEvent,
|
||||
Event* aEvent,
|
||||
bool* aRetVal)
|
||||
{
|
||||
*aRetVal = false;
|
||||
NS_ENSURE_STATE(aTarget && aEvent);
|
||||
aEvent->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
|
||||
*aRetVal = aTarget->
|
||||
DispatchEvent(*aEvent->InternalDOMEvent(), CallerType::System, IgnoreErrors());
|
||||
DispatchEvent(*aEvent, CallerType::System, IgnoreErrors());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@ interface nsICycleCollectorListener;
|
|||
interface nsIDOMNode;
|
||||
interface nsIDOMNodeList;
|
||||
interface nsIDOMElement;
|
||||
interface nsIDOMEvent;
|
||||
interface nsIPreloadedStyleSheet;
|
||||
interface nsITransferable;
|
||||
interface nsIQueryContentEventResult;
|
||||
|
@ -50,6 +49,7 @@ interface nsIDOMStorage;
|
|||
|
||||
webidl DOMRect;
|
||||
webidl EventTarget;
|
||||
webidl Event;
|
||||
|
||||
[scriptable, uuid(4d6732ca-9da7-4176-b8a1-8dde15cd0bf9)]
|
||||
interface nsIDOMWindowUtils : nsISupports {
|
||||
|
@ -318,7 +318,7 @@ interface nsIDOMWindowUtils : nsISupports {
|
|||
* @param aPressure touch input pressure: 0.0 -> 1.0
|
||||
* @param aInputSourceArg input source, see MouseEvent for values,
|
||||
* defaults to mouse input.
|
||||
* @param aIsDOMEventSynthesized controls nsIDOMEvent.isSynthesized value
|
||||
* @param aIsDOMEventSynthesized controls Event.isSynthesized value
|
||||
* that helps identifying test related events,
|
||||
* defaults to true
|
||||
* @param aIsWidgetEventSynthesized controls WidgetMouseEvent.mReason value
|
||||
|
@ -937,7 +937,7 @@ interface nsIDOMWindowUtils : nsISupports {
|
|||
* Also, aEvent should not be reused.
|
||||
*/
|
||||
boolean dispatchDOMEventViaPresShell(in nsIDOMNode aTarget,
|
||||
in nsIDOMEvent aEvent,
|
||||
in Event aEvent,
|
||||
in boolean aTrusted);
|
||||
|
||||
/**
|
||||
|
@ -947,7 +947,7 @@ interface nsIDOMWindowUtils : nsISupports {
|
|||
* Returns the same value as what EventTarget.dispatchEvent does.
|
||||
*/
|
||||
boolean dispatchEventToChromeOnly(in EventTarget aTarget,
|
||||
in nsIDOMEvent aEvent);
|
||||
in Event aEvent);
|
||||
|
||||
/**
|
||||
* Returns the real classname (possibly of the mostly-transparent security
|
||||
|
|
|
@ -5,10 +5,11 @@
|
|||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMEvent;
|
||||
interface mozIDOMWindow;
|
||||
interface nsITextInputProcessorCallback;
|
||||
|
||||
webidl Event;
|
||||
|
||||
/**
|
||||
* An nsITextInputProcessor instance is associated with a top level widget which
|
||||
* handles native IME. It's associated by calling beginInputTransaction() or
|
||||
|
@ -315,7 +316,7 @@ interface nsITextInputProcessor : nsISupports
|
|||
* canceled by the web application.
|
||||
*/
|
||||
[optional_argc]
|
||||
boolean startComposition([optional] in nsIDOMEvent aKeyboardEvent,
|
||||
boolean startComposition([optional] in Event aKeyboardEvent,
|
||||
[optional] in unsigned long aKeyFlags);
|
||||
|
||||
/**
|
||||
|
@ -410,7 +411,7 @@ interface nsITextInputProcessor : nsISupports
|
|||
*/
|
||||
[optional_argc]
|
||||
boolean flushPendingComposition(
|
||||
[optional] in nsIDOMEvent aKeyboardEvent,
|
||||
[optional] in Event aKeyboardEvent,
|
||||
[optional] in unsigned long aKeyFlags);
|
||||
|
||||
/**
|
||||
|
@ -428,7 +429,7 @@ interface nsITextInputProcessor : nsISupports
|
|||
* @param aKeyFlags See KEY_* constants.
|
||||
*/
|
||||
[optional_argc]
|
||||
void commitComposition([optional] in nsIDOMEvent aKeyboardEvent,
|
||||
void commitComposition([optional] in Event aKeyboardEvent,
|
||||
[optional] in unsigned long aKeyFlags);
|
||||
|
||||
/**
|
||||
|
@ -454,7 +455,7 @@ interface nsITextInputProcessor : nsISupports
|
|||
*/
|
||||
[optional_argc]
|
||||
boolean commitCompositionWith(in DOMString aCommitString,
|
||||
[optional] in nsIDOMEvent aKeyboardEvent,
|
||||
[optional] in Event aKeyboardEvent,
|
||||
[optional] in unsigned long aKeyFlags);
|
||||
|
||||
/**
|
||||
|
@ -477,7 +478,7 @@ interface nsITextInputProcessor : nsISupports
|
|||
* @param aKeyFlags See KEY_* constants.
|
||||
*/
|
||||
[optional_argc]
|
||||
void cancelComposition([optional] in nsIDOMEvent aKeyboardEvent,
|
||||
void cancelComposition([optional] in Event aKeyboardEvent,
|
||||
[optional] in unsigned long aKeyFlags);
|
||||
|
||||
// Specifying KEY_DEFAULT_PREVENTED can dispatch key events whose
|
||||
|
@ -573,14 +574,14 @@ interface nsITextInputProcessor : nsISupports
|
|||
* default action has been taken).
|
||||
*/
|
||||
[optional_argc]
|
||||
unsigned long keydown(in nsIDOMEvent aKeyboardEvent,
|
||||
unsigned long keydown(in Event aKeyboardEvent,
|
||||
[optional] in unsigned long aKeyFlags);
|
||||
|
||||
/**
|
||||
* Similar to keydown(), but this dispatches only a keyup event.
|
||||
*/
|
||||
[optional_argc]
|
||||
boolean keyup(in nsIDOMEvent aKeyboardEvent,
|
||||
boolean keyup(in Event aKeyboardEvent,
|
||||
[optional] in unsigned long aKeyFlags);
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "mozilla/ModuleUtils.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/dom/KeyboardEventBinding.h"
|
||||
#include "mozilla/dom/Event.h"
|
||||
|
||||
static const char *kAutoCompleteSearchCID = "@mozilla.org/autocomplete/search;1?name=";
|
||||
|
||||
|
@ -299,7 +300,7 @@ nsAutoCompleteController::HandleText(bool *_retval)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsAutoCompleteController::HandleEnter(bool aIsPopupSelection,
|
||||
nsIDOMEvent *aEvent,
|
||||
dom::Event* aEvent,
|
||||
bool *_retval)
|
||||
{
|
||||
*_retval = false;
|
||||
|
@ -1183,7 +1184,7 @@ nsAutoCompleteController::ClearSearchTimer()
|
|||
|
||||
nsresult
|
||||
nsAutoCompleteController::EnterMatch(bool aIsPopupSelection,
|
||||
nsIDOMEvent *aEvent)
|
||||
dom::Event* aEvent)
|
||||
{
|
||||
nsCOMPtr<nsIAutoCompleteInput> input(mInput);
|
||||
nsCOMPtr<nsIAutoCompletePopup> popup;
|
||||
|
|
|
@ -68,7 +68,7 @@ protected:
|
|||
nsresult PostSearchCleanup();
|
||||
|
||||
nsresult EnterMatch(bool aIsPopupSelection,
|
||||
nsIDOMEvent *aEvent);
|
||||
mozilla::dom::Event* aEvent);
|
||||
nsresult RevertTextValue();
|
||||
|
||||
nsresult CompleteDefaultIndex(int32_t aResultIndex);
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIAutoCompleteInput;
|
||||
interface nsIDOMEvent;
|
||||
|
||||
webidl Event;
|
||||
|
||||
[scriptable, uuid(ff9f8465-204a-47a6-b3c9-0628b3856684)]
|
||||
interface nsIAutoCompleteController : nsISupports
|
||||
|
@ -76,7 +77,7 @@ interface nsIAutoCompleteController : nsISupports
|
|||
* default event.
|
||||
*/
|
||||
boolean handleEnter(in boolean aIsPopupSelection,
|
||||
[optional] in nsIDOMEvent aEvent);
|
||||
[optional] in Event aEvent);
|
||||
|
||||
/*
|
||||
* Notify the controller that the user wishes to revert autocomplete
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
interface nsIAutoCompletePopup;
|
||||
|
||||
webidl Event;
|
||||
|
||||
[scriptable, uuid(B068E70F-F82C-4C12-AD87-82E271C5C180)]
|
||||
interface nsIAutoCompleteInput : nsISupports
|
||||
{
|
||||
|
@ -135,7 +137,7 @@ interface nsIAutoCompleteInput : nsISupports
|
|||
* The event that triggered the enter.
|
||||
* @return True if the user wishes to prevent the enter
|
||||
*/
|
||||
boolean onTextEntered([optional] in nsIDOMEvent aEvent);
|
||||
boolean onTextEntered([optional] in Event aEvent);
|
||||
|
||||
/*
|
||||
* Notification that the user cancelled the autocomplete session
|
||||
|
|
|
@ -644,7 +644,7 @@ nsFormFillController::OnSearchComplete()
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFormFillController::OnTextEntered(nsIDOMEvent* aEvent,
|
||||
nsFormFillController::OnTextEntered(Event* aEvent,
|
||||
bool* aPrevent)
|
||||
{
|
||||
NS_ENSURE_ARG(aPrevent);
|
||||
|
|
Загрузка…
Ссылка в новой задаче