Bug 1436508 part 3. Remove nsIDOMCommandEvent. r=masayuki

We never use initCommandEvent anywhere on a CommandEvent, only on
XULCommandEvents.

MozReview-Commit-ID: 8QHYnlPdDvx
This commit is contained in:
Boris Zbarsky 2018-02-09 11:17:08 -05:00
Родитель d891ae6e2d
Коммит d22cfa08fe
6 изменённых файлов: 3 добавлений и 59 удалений

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

@ -27,13 +27,12 @@ CommandEvent::CommandEvent(EventTarget* aOwner,
}
NS_INTERFACE_MAP_BEGIN(CommandEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMCommandEvent)
NS_INTERFACE_MAP_END_INHERITING(Event)
NS_IMPL_ADDREF_INHERITED(CommandEvent, Event)
NS_IMPL_RELEASE_INHERITED(CommandEvent, Event)
NS_IMETHODIMP
void
CommandEvent::GetCommand(nsAString& aCommand)
{
nsAtom* command = mEvent->AsCommandEvent()->mCommand;
@ -42,21 +41,6 @@ CommandEvent::GetCommand(nsAString& aCommand)
} else {
aCommand.Truncate();
}
return NS_OK;
}
NS_IMETHODIMP
CommandEvent::InitCommandEvent(const nsAString& aTypeArg,
bool aCanBubbleArg,
bool aCancelableArg,
const nsAString& aCommand)
{
NS_ENSURE_TRUE(!mEvent->mFlags.mIsBeingDispatched, NS_OK);
Event::InitEvent(aTypeArg, aCanBubbleArg, aCancelableArg);
mEvent->AsCommandEvent()->mCommand = NS_Atomize(aCommand);
return NS_OK;
}
} // namespace dom

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

@ -10,13 +10,11 @@
#include "mozilla/EventForwards.h"
#include "mozilla/dom/CommandEventBinding.h"
#include "mozilla/dom/Event.h"
#include "nsIDOMCommandEvent.h"
namespace mozilla {
namespace dom {
class CommandEvent : public Event,
public nsIDOMCommandEvent
class CommandEvent : public Event
{
public:
CommandEvent(EventTarget* aOwner,
@ -25,24 +23,12 @@ public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMCOMMANDEVENT
// Forward to base class
NS_FORWARD_TO_EVENT
virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
{
return CommandEventBinding::Wrap(aCx, this, aGivenProto);
}
void InitCommandEvent(const nsAString& aType,
bool aCanBubble,
bool aCancelable,
const nsAString& aCommand,
ErrorResult& aRv)
{
aRv = InitCommandEvent(aType, aCanBubble, aCancelable, aCommand);
}
void GetCommand(nsAString& aCommand);
protected:
~CommandEvent() {}

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

@ -9,7 +9,6 @@ with Files("**"):
XPIDL_SOURCES += [
'nsIDOMClipboardEvent.idl',
'nsIDOMCommandEvent.idl',
'nsIDOMCustomEvent.idl',
'nsIDOMDataTransfer.idl',
'nsIDOMDragEvent.idl',

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

@ -1,17 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
[builtinclass, uuid(73a50e55-3eaa-4a38-a588-9b68a6d65032)]
interface nsIDOMCommandEvent : nsISupports
{
readonly attribute DOMString command;
void initCommandEvent(in DOMString typeArg,
in boolean canBubbleArg,
in boolean canCancelArg,
in DOMString command);
};

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

@ -7,9 +7,4 @@
[Func="IsChromeOrXBL"]
interface CommandEvent : Event {
readonly attribute DOMString? command;
void initCommandEvent(DOMString type,
optional boolean canBubble = false,
optional boolean cancelable = false,
optional DOMString? command = null);
};

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

@ -13,7 +13,6 @@
#include "nsIDOMClientRect.h"
#include "nsIDOMClientRectList.h"
#include "nsIDOMClipboardEvent.h"
#include "nsIDOMCommandEvent.h"
#include "nsIDOMComment.h"
#include "nsIDOMCustomEvent.h"
#ifdef MOZ_WEBRTC
@ -79,7 +78,6 @@
#include "mozilla/dom/DOMRectBinding.h"
#include "mozilla/dom/DOMRectListBinding.h"
#include "mozilla/dom/ClipboardEventBinding.h"
#include "mozilla/dom/CommandEventBinding.h"
#include "mozilla/dom/CommentBinding.h"
#include "mozilla/dom/ContainerBoxObjectBinding.h"
#include "mozilla/dom/CSSPrimitiveValueBinding.h"
@ -220,7 +218,6 @@ const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] =
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMClientRect, DOMRectReadOnly),
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMClientRectList, DOMRectList),
DEFINE_SHIM(ClipboardEvent),
DEFINE_SHIM(CommandEvent),
DEFINE_SHIM(Comment),
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIContainerBoxObject, ContainerBoxObject),
DEFINE_SHIM(CustomEvent),