Bug 1436508 part 8. Remove unused nsIDOMKeyEvent members. r=masayuki

MozReview-Commit-ID: 57xpY8vNfW2
This commit is contained in:
Boris Zbarsky 2018-02-09 11:17:09 -05:00
Родитель d6140ab21c
Коммит 29c1a6e2e2
3 изменённых файлов: 11 добавлений и 124 удалений

Просмотреть файл

@ -53,14 +53,6 @@ KeyboardEvent::AltKey(CallerType aCallerType)
return GetSpoofedModifierStates(Modifier::MODIFIER_ALT, altState);
}
NS_IMETHODIMP
KeyboardEvent::GetAltKey(bool* aIsDown)
{
NS_ENSURE_ARG_POINTER(aIsDown);
*aIsDown = AltKey();
return NS_OK;
}
bool
KeyboardEvent::CtrlKey(CallerType aCallerType)
{
@ -75,14 +67,6 @@ KeyboardEvent::CtrlKey(CallerType aCallerType)
return GetSpoofedModifierStates(Modifier::MODIFIER_CONTROL, ctrlState);
}
NS_IMETHODIMP
KeyboardEvent::GetCtrlKey(bool* aIsDown)
{
NS_ENSURE_ARG_POINTER(aIsDown);
*aIsDown = CtrlKey();
return NS_OK;
}
bool
KeyboardEvent::ShiftKey(CallerType aCallerType)
{
@ -95,63 +79,28 @@ KeyboardEvent::ShiftKey(CallerType aCallerType)
return GetSpoofedModifierStates(Modifier::MODIFIER_SHIFT, shiftState);
}
NS_IMETHODIMP
KeyboardEvent::GetShiftKey(bool* aIsDown)
{
NS_ENSURE_ARG_POINTER(aIsDown);
*aIsDown = ShiftKey();
return NS_OK;
}
bool
KeyboardEvent::MetaKey()
{
return mEvent->AsKeyboardEvent()->IsMeta();
}
NS_IMETHODIMP
KeyboardEvent::GetMetaKey(bool* aIsDown)
{
NS_ENSURE_ARG_POINTER(aIsDown);
*aIsDown = MetaKey();
return NS_OK;
}
bool
KeyboardEvent::Repeat()
{
return mEvent->AsKeyboardEvent()->mIsRepeat;
}
NS_IMETHODIMP
KeyboardEvent::GetRepeat(bool* aIsRepeat)
{
NS_ENSURE_ARG_POINTER(aIsRepeat);
*aIsRepeat = Repeat();
return NS_OK;
}
bool
KeyboardEvent::IsComposing()
{
return mEvent->AsKeyboardEvent()->mIsComposing;
}
NS_IMETHODIMP
KeyboardEvent::GetModifierState(const nsAString& aKey,
bool* aState)
{
NS_ENSURE_ARG_POINTER(aState);
*aState = GetModifierState(aKey);
return NS_OK;
}
NS_IMETHODIMP
KeyboardEvent::GetKey(nsAString& aKeyName)
void
KeyboardEvent::GetKey(nsAString& aKeyName) const
{
mEvent->AsKeyboardEvent()->GetDOMKeyName(aKeyName);
return NS_OK;
}
void
@ -205,14 +154,6 @@ void KeyboardEvent::GetInitDict(KeyboardEventInit& aParam)
aParam.mCancelable = internalEvent->mFlags.mCancelable;
}
NS_IMETHODIMP
KeyboardEvent::GetCharCode(uint32_t* aCharCode)
{
NS_ENSURE_ARG_POINTER(aCharCode);
*aCharCode = CharCode();
return NS_OK;
}
uint32_t
KeyboardEvent::CharCode()
{
@ -236,14 +177,6 @@ KeyboardEvent::CharCode()
return 0;
}
NS_IMETHODIMP
KeyboardEvent::GetKeyCode(uint32_t* aKeyCode)
{
NS_ENSURE_ARG_POINTER(aKeyCode);
*aKeyCode = KeyCode();
return NS_OK;
}
uint32_t
KeyboardEvent::KeyCode(CallerType aCallerType)
{
@ -309,15 +242,6 @@ KeyboardEvent::Which()
return 0;
}
NS_IMETHODIMP
KeyboardEvent::GetLocation(uint32_t* aLocation)
{
NS_ENSURE_ARG_POINTER(aLocation);
*aLocation = Location();
return NS_OK;
}
uint32_t
KeyboardEvent::Location()
{
@ -371,19 +295,14 @@ KeyboardEvent::InitWithKeyboardEventInit(EventTarget* aOwner,
}
}
NS_IMETHODIMP
KeyboardEvent::InitKeyEvent(const nsAString& aType,
bool aCanBubble,
bool aCancelable,
mozIDOMWindow* aView,
bool aCtrlKey,
bool aAltKey,
bool aShiftKey,
bool aMetaKey,
uint32_t aKeyCode,
uint32_t aCharCode)
void
KeyboardEvent::InitKeyEvent(const nsAString& aType, bool aCanBubble,
bool aCancelable, nsGlobalWindowInner* aView,
bool aCtrlKey, bool aAltKey,
bool aShiftKey, bool aMetaKey,
uint32_t aKeyCode, uint32_t aCharCode)
{
NS_ENSURE_TRUE(!mEvent->mFlags.mIsBeingDispatched, NS_OK);
NS_ENSURE_TRUE_VOID(!mEvent->mFlags.mIsBeingDispatched);
UIEvent::InitUIEvent(aType, aCanBubble, aCancelable, aView, 0);
@ -391,8 +310,6 @@ KeyboardEvent::InitKeyEvent(const nsAString& aType,
keyEvent->InitBasicModifiers(aCtrlKey, aAltKey, aShiftKey, aMetaKey);
keyEvent->mKeyCode = aKeyCode;
keyEvent->mCharCode = aCharCode;
return NS_OK;
}
void

Просмотреть файл

@ -70,6 +70,7 @@ public:
bool Repeat();
bool IsComposing();
void GetKey(nsAString& aKey) const;
uint32_t CharCode();
uint32_t KeyCode(CallerType aCallerType = CallerType::System);
virtual uint32_t Which() override;
@ -81,12 +82,7 @@ public:
void InitKeyEvent(const nsAString& aType, bool aCanBubble, bool aCancelable,
nsGlobalWindowInner* aView, bool aCtrlKey, bool aAltKey,
bool aShiftKey, bool aMetaKey,
uint32_t aKeyCode, uint32_t aCharCode)
{
auto* view = aView ? aView->AsInner() : nullptr;
InitKeyEvent(aType, aCanBubble, aCancelable, view, aCtrlKey, aAltKey,
aShiftKey, aMetaKey, aKeyCode, aCharCode);
}
uint32_t aKeyCode, uint32_t aCharCode);
void InitKeyboardEvent(const nsAString& aType,
bool aCanBubble, bool aCancelable,

Просмотреть файл

@ -225,34 +225,8 @@ interface nsIDOMKeyEvent : nsIDOMUIEvent
// for compatibility with the other web browsers on Windows.
const unsigned long DOM_VK_WIN_OEM_CLEAR = 0xFE;
readonly attribute unsigned long charCode;
readonly attribute unsigned long keyCode;
readonly attribute boolean altKey;
readonly attribute boolean ctrlKey;
readonly attribute boolean shiftKey;
readonly attribute boolean metaKey;
void initKeyEvent(in DOMString typeArg,
in boolean canBubbleArg,
in boolean cancelableArg,
in mozIDOMWindow viewArg,
in boolean ctrlKeyArg,
in boolean altKeyArg,
in boolean shiftKeyArg,
in boolean metaKeyArg,
in unsigned long keyCodeArg,
in unsigned long charCodeArg);
bool getModifierState(in DOMString keyArg);
const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00;
const unsigned long DOM_KEY_LOCATION_LEFT = 0x01;
const unsigned long DOM_KEY_LOCATION_RIGHT = 0x02;
const unsigned long DOM_KEY_LOCATION_NUMPAD = 0x03;
readonly attribute unsigned long location;
readonly attribute boolean repeat;
readonly attribute DOMString key;
};