зеркало из https://github.com/mozilla/gecko-dev.git
Bug 975688 part.6 Rename nsDOMCompositionEvent to mozilla::dom::CompositionEvent r=smaug
--HG-- rename : dom/events/nsDOMCompositionEvent.cpp => dom/events/CompositionEvent.cpp rename : dom/events/nsDOMCompositionEvent.h => dom/events/CompositionEvent.h
This commit is contained in:
Родитель
07efb07672
Коммит
5408070eb3
|
@ -242,7 +242,7 @@ DOMInterfaces = {
|
|||
},
|
||||
|
||||
'CompositionEvent': {
|
||||
'nativeType': 'nsDOMCompositionEvent',
|
||||
'nativeType': 'mozilla::dom::CompositionEvent',
|
||||
},
|
||||
|
||||
'ConvolverNode': {
|
||||
|
|
|
@ -4,15 +4,16 @@
|
|||
* 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 "nsDOMCompositionEvent.h"
|
||||
#include "prtime.h"
|
||||
#include "mozilla/dom/CompositionEvent.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
#include "prtime.h"
|
||||
|
||||
using namespace mozilla;
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
nsDOMCompositionEvent::nsDOMCompositionEvent(mozilla::dom::EventTarget* aOwner,
|
||||
nsPresContext* aPresContext,
|
||||
WidgetCompositionEvent* aEvent)
|
||||
CompositionEvent::CompositionEvent(EventTarget* aOwner,
|
||||
nsPresContext* aPresContext,
|
||||
WidgetCompositionEvent* aEvent)
|
||||
: nsDOMUIEvent(aOwner, aPresContext, aEvent ? aEvent :
|
||||
new WidgetCompositionEvent(false, 0, nullptr))
|
||||
{
|
||||
|
@ -35,34 +36,34 @@ nsDOMCompositionEvent::nsDOMCompositionEvent(mozilla::dom::EventTarget* aOwner,
|
|||
// TODO: Native event should have locale information.
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsDOMCompositionEvent, nsDOMUIEvent)
|
||||
NS_IMPL_RELEASE_INHERITED(nsDOMCompositionEvent, nsDOMUIEvent)
|
||||
NS_IMPL_ADDREF_INHERITED(CompositionEvent, nsDOMUIEvent)
|
||||
NS_IMPL_RELEASE_INHERITED(CompositionEvent, nsDOMUIEvent)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsDOMCompositionEvent)
|
||||
NS_INTERFACE_MAP_BEGIN(CompositionEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMCompositionEvent)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMCompositionEvent::GetData(nsAString& aData)
|
||||
CompositionEvent::GetData(nsAString& aData)
|
||||
{
|
||||
aData = mData;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMCompositionEvent::GetLocale(nsAString& aLocale)
|
||||
CompositionEvent::GetLocale(nsAString& aLocale)
|
||||
{
|
||||
aLocale = mLocale;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMCompositionEvent::InitCompositionEvent(const nsAString& aType,
|
||||
bool aCanBubble,
|
||||
bool aCancelable,
|
||||
nsIDOMWindow* aView,
|
||||
const nsAString& aData,
|
||||
const nsAString& aLocale)
|
||||
CompositionEvent::InitCompositionEvent(const nsAString& aType,
|
||||
bool aCanBubble,
|
||||
bool aCancelable,
|
||||
nsIDOMWindow* aView,
|
||||
const nsAString& aData,
|
||||
const nsAString& aLocale)
|
||||
{
|
||||
nsresult rv =
|
||||
nsDOMUIEvent::InitUIEvent(aType, aCanBubble, aCancelable, aView, 0);
|
||||
|
@ -73,13 +74,18 @@ nsDOMCompositionEvent::InitCompositionEvent(const nsAString& aType,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
nsresult
|
||||
NS_NewDOMCompositionEvent(nsIDOMEvent** aInstancePtrResult,
|
||||
mozilla::dom::EventTarget* aOwner,
|
||||
EventTarget* aOwner,
|
||||
nsPresContext* aPresContext,
|
||||
WidgetCompositionEvent* aEvent)
|
||||
{
|
||||
nsDOMCompositionEvent* event =
|
||||
new nsDOMCompositionEvent(aOwner, aPresContext, aEvent);
|
||||
CompositionEvent* event = new CompositionEvent(aOwner, aPresContext, aEvent);
|
||||
return CallQueryInterface(event, aInstancePtrResult);
|
||||
}
|
|
@ -4,21 +4,24 @@
|
|||
* 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/. */
|
||||
|
||||
#ifndef nsDOMCompositionEvent_h__
|
||||
#define nsDOMCompositionEvent_h__
|
||||
#ifndef mozilla_dom_CompositionEvent_h_
|
||||
#define mozilla_dom_CompositionEvent_h_
|
||||
|
||||
#include "nsDOMUIEvent.h"
|
||||
#include "nsIDOMCompositionEvent.h"
|
||||
#include "mozilla/dom/CompositionEventBinding.h"
|
||||
#include "mozilla/EventForwards.h"
|
||||
|
||||
class nsDOMCompositionEvent : public nsDOMUIEvent,
|
||||
public nsIDOMCompositionEvent
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class CompositionEvent : public nsDOMUIEvent,
|
||||
public nsIDOMCompositionEvent
|
||||
{
|
||||
public:
|
||||
nsDOMCompositionEvent(mozilla::dom::EventTarget* aOwner,
|
||||
nsPresContext* aPresContext,
|
||||
mozilla::WidgetCompositionEvent* aEvent);
|
||||
CompositionEvent(EventTarget* aOwner,
|
||||
nsPresContext* aPresContext,
|
||||
WidgetCompositionEvent* aEvent);
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_FORWARD_TO_NSDOMUIEVENT
|
||||
|
@ -27,17 +30,16 @@ public:
|
|||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
|
||||
{
|
||||
return mozilla::dom::CompositionEventBinding::Wrap(aCx, aScope, this);
|
||||
return CompositionEventBinding::Wrap(aCx, aScope, this);
|
||||
}
|
||||
|
||||
void
|
||||
InitCompositionEvent(const nsAString& aType,
|
||||
bool aCanBubble,
|
||||
bool aCancelable,
|
||||
nsIDOMWindow* aView,
|
||||
const nsAString& aData,
|
||||
const nsAString& aLocale,
|
||||
mozilla::ErrorResult& aRv)
|
||||
void InitCompositionEvent(const nsAString& aType,
|
||||
bool aCanBubble,
|
||||
bool aCancelable,
|
||||
nsIDOMWindow* aView,
|
||||
const nsAString& aData,
|
||||
const nsAString& aLocale,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
aRv = InitCompositionEvent(aType, aCanBubble, aCancelable, aView,
|
||||
aData, aLocale);
|
||||
|
@ -48,4 +50,7 @@ protected:
|
|||
nsString mLocale;
|
||||
};
|
||||
|
||||
#endif // nsDOMCompositionEvent_h__
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_CompositionEvent_h_
|
|
@ -40,6 +40,7 @@ EXPORTS.mozilla.dom += [
|
|||
'BeforeUnloadEvent.h',
|
||||
'ClipboardEvent.h',
|
||||
'CommandEvent.h',
|
||||
'CompositionEvent.h',
|
||||
'EventTarget.h',
|
||||
'PointerEvent.h',
|
||||
'Touch.h',
|
||||
|
@ -54,10 +55,10 @@ UNIFIED_SOURCES += [
|
|||
'BeforeUnloadEvent.cpp',
|
||||
'ClipboardEvent.cpp',
|
||||
'CommandEvent.cpp',
|
||||
'CompositionEvent.cpp',
|
||||
'EventTarget.cpp',
|
||||
'nsAsyncDOMEvent.cpp',
|
||||
'nsContentEventHandler.cpp',
|
||||
'nsDOMCompositionEvent.cpp',
|
||||
'nsDOMDataContainerEvent.cpp',
|
||||
'nsDOMDataTransfer.cpp',
|
||||
'nsDOMDeviceMotionEvent.cpp',
|
||||
|
|
Загрузка…
Ссылка в новой задаче