Bug 912956 part.9 Rename nsMutationEvent.h to mozilla/MutationEvent.h r=smaug

--HG--
rename : content/events/public/nsMutationEvent.h => content/events/public/MutationEvent.h
This commit is contained in:
Masayuki Nakano 2013-09-24 19:04:16 +09:00
Родитель ed6389f9ff
Коммит 3254722540
21 изменённых файлов: 82 добавлений и 61 удалений

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

@ -10,6 +10,7 @@
#include "mozilla/dom/Attr.h"
#include "mozilla/dom/AttrBinding.h"
#include "mozilla/dom/Element.h"
#include "mozilla/MutationEvent.h"
#include "nsContentCreatorFunctions.h"
#include "nsINameSpaceManager.h"
#include "nsError.h"
@ -25,7 +26,6 @@
#include "nsEventListenerManager.h"
#include "nsTextNode.h"
#include "mozAutoDocUpdate.h"
#include "nsMutationEvent.h"
#include "nsAsyncDOMEvent.h"
#include "nsWrapperCacheInlines.h"

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

@ -48,7 +48,7 @@
#include "nsDOMString.h"
#include "nsIScriptSecurityManager.h"
#include "nsIDOMMutationEvent.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsNodeUtils.h"
#include "mozilla/dom/DirectionalityUtils.h"
#include "nsDocument.h"

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

@ -51,7 +51,7 @@
#include "nsDOMString.h"
#include "nsIScriptSecurityManager.h"
#include "nsIDOMMutationEvent.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsNodeUtils.h"
#include "nsDocument.h"
#include "nsAttrValueOrString.h"

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

@ -38,6 +38,7 @@
#include "mozilla/dom/HTMLTemplateElement.h"
#include "mozilla/dom/TextDecoder.h"
#include "mozilla/Likely.h"
#include "mozilla/MutationEvent.h"
#include "mozilla/Preferences.h"
#include "mozilla/Selection.h"
#include "mozilla/Util.h"
@ -144,7 +145,6 @@
#include "nsIXPConnect.h"
#include "nsJSUtils.h"
#include "nsLWBrkCIID.h"
#include "nsMutationEvent.h"
#include "nsNetCID.h"
#include "nsNetUtil.h"
#include "nsNodeInfoManager.h"

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

@ -120,7 +120,7 @@
#include "nsDateTimeFormatCID.h"
#include "nsIDateTimeFormat.h"
#include "nsEventDispatcher.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsDOMCID.h"
#include "jsapi.h"

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

@ -17,7 +17,7 @@
#include "nsEventListenerManager.h"
#include "nsIDOMDocument.h"
#include "nsReadableUtils.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsINameSpaceManager.h"
#include "nsIURI.h"
#include "nsIDOMEvent.h"

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

@ -16,6 +16,7 @@
#include "mozilla/CORSMode.h"
#include "mozilla/Likely.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/MutationEvent.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Util.h"
#include "nsAsyncDOMEvent.h"
@ -76,7 +77,6 @@
#include "nsIWebNavigation.h"
#include "nsIWidget.h"
#include "nsLayoutUtils.h"
#include "nsMutationEvent.h"
#include "nsNetUtil.h"
#include "nsNodeInfoManager.h"
#include "nsNodeUtils.h"

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

@ -9,7 +9,7 @@
#include "nsAttrValue.h"
#include "nsAttrValueInlines.h"
#include "mozilla/dom/Element.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsDOMCSSDeclaration.h"
#include "nsDOMCSSAttrDeclaration.h"
#include "nsServiceManagerUtils.h"

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

@ -3,19 +3,22 @@
* 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 nsMutationEvent_h__
#define nsMutationEvent_h__
#ifndef mozilla_MutationEvent_h__
#define mozilla_MutationEvent_h__
#include "nsGUIEvent.h"
#include "nsIDOMNode.h"
#include "mozilla/BasicEvents.h"
#include "nsCOMPtr.h"
#include "nsIAtom.h"
#include "nsIDOMNode.h"
class nsMutationEvent : public nsEvent
namespace mozilla {
class InternalMutationEvent : public WidgetEvent
{
public:
nsMutationEvent(bool isTrusted, uint32_t msg)
: nsEvent(isTrusted, msg, NS_MUTATION_EVENT),
mAttrChange(0)
InternalMutationEvent(bool aIsTrusted, uint32_t aMessage) :
WidgetEvent(aIsTrusted, aMessage, NS_MUTATION_EVENT),
mAttrChange(0)
{
mFlags.mCancelable = false;
}
@ -26,7 +29,8 @@ public:
nsCOMPtr<nsIAtom> mNewAttrValue;
unsigned short mAttrChange;
void AssignMutationEventData(const nsMutationEvent& aEvent, bool aCopyTargets)
void AssignMutationEventData(const InternalMutationEvent& aEvent,
bool aCopyTargets)
{
AssignEventData(aEvent, aCopyTargets);
@ -38,16 +42,6 @@ public:
}
};
#define NS_MUTATION_START 1800
#define NS_MUTATION_SUBTREEMODIFIED (NS_MUTATION_START)
#define NS_MUTATION_NODEINSERTED (NS_MUTATION_START+1)
#define NS_MUTATION_NODEREMOVED (NS_MUTATION_START+2)
#define NS_MUTATION_NODEREMOVEDFROMDOCUMENT (NS_MUTATION_START+3)
#define NS_MUTATION_NODEINSERTEDINTODOCUMENT (NS_MUTATION_START+4)
#define NS_MUTATION_ATTRMODIFIED (NS_MUTATION_START+5)
#define NS_MUTATION_CHARACTERDATAMODIFIED (NS_MUTATION_START+6)
#define NS_MUTATION_END (NS_MUTATION_START+6)
// Bits are actually checked to optimize mutation event firing.
// That's why I don't number from 0x00. The first event should
// always be 0x01.
@ -59,4 +53,9 @@ public:
#define NS_EVENT_BITS_MUTATION_ATTRMODIFIED 0x20
#define NS_EVENT_BITS_MUTATION_CHARACTERDATAMODIFIED 0x40
#endif // nsMutationEvent_h__
} // namespace mozilla
// TODO: Remove following typedef
typedef mozilla::InternalMutationEvent nsMutationEvent;
#endif // mozilla_MutationEvent_h__

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

@ -20,10 +20,13 @@ EXPORTS += [
'nsEventStates.h',
'nsIPrivateTextEvent.h',
'nsIPrivateTextRange.h',
'nsMutationEvent.h',
'nsVKList.h',
]
EXPORTS.mozilla += [
'MutationEvent.h',
]
EXPORTS.mozilla.dom += [
'EventTarget.h',
]

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

@ -14,7 +14,7 @@
#include "nsIContent.h"
#include "nsIPresShell.h"
#include "nsIDocument.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsContentUtils.h"
#include "nsJSEnvironment.h"
#include "mozilla/Preferences.h"

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

@ -5,14 +5,17 @@
#include "nsCOMPtr.h"
#include "nsDOMMutationEvent.h"
#include "mozilla/MutationEvent.h"
using namespace mozilla;
class nsPresContext;
nsDOMMutationEvent::nsDOMMutationEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsMutationEvent* aEvent)
InternalMutationEvent* aEvent)
: nsDOMEvent(aOwner, aPresContext,
aEvent ? aEvent : new nsMutationEvent(false, 0))
aEvent ? aEvent : new InternalMutationEvent(false, 0))
{
mEventIsInternal = (aEvent == nullptr);
}
@ -20,7 +23,8 @@ nsDOMMutationEvent::nsDOMMutationEvent(mozilla::dom::EventTarget* aOwner,
nsDOMMutationEvent::~nsDOMMutationEvent()
{
if (mEventIsInternal) {
nsMutationEvent* mutation = static_cast<nsMutationEvent*>(mEvent);
InternalMutationEvent* mutation =
static_cast<InternalMutationEvent*>(mEvent);
delete mutation;
mEvent = nullptr;
}
@ -33,6 +37,14 @@ NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMMutationEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMMutationEvent, nsDOMEvent)
already_AddRefed<nsINode>
nsDOMMutationEvent::GetRelatedNode()
{
nsCOMPtr<nsINode> n = do_QueryInterface(
static_cast<InternalMutationEvent*>(mEvent)->mRelatedNode);
return n.forget();
}
NS_IMETHODIMP
nsDOMMutationEvent::GetRelatedNode(nsIDOMNode** aRelatedNode)
{
@ -45,7 +57,7 @@ nsDOMMutationEvent::GetRelatedNode(nsIDOMNode** aRelatedNode)
NS_IMETHODIMP
nsDOMMutationEvent::GetPrevValue(nsAString& aPrevValue)
{
nsMutationEvent* mutation = static_cast<nsMutationEvent*>(mEvent);
InternalMutationEvent* mutation = static_cast<InternalMutationEvent*>(mEvent);
if (mutation->mPrevAttrValue)
mutation->mPrevAttrValue->ToString(aPrevValue);
return NS_OK;
@ -54,7 +66,7 @@ nsDOMMutationEvent::GetPrevValue(nsAString& aPrevValue)
NS_IMETHODIMP
nsDOMMutationEvent::GetNewValue(nsAString& aNewValue)
{
nsMutationEvent* mutation = static_cast<nsMutationEvent*>(mEvent);
InternalMutationEvent* mutation = static_cast<InternalMutationEvent*>(mEvent);
if (mutation->mNewAttrValue)
mutation->mNewAttrValue->ToString(aNewValue);
return NS_OK;
@ -63,12 +75,18 @@ nsDOMMutationEvent::GetNewValue(nsAString& aNewValue)
NS_IMETHODIMP
nsDOMMutationEvent::GetAttrName(nsAString& aAttrName)
{
nsMutationEvent* mutation = static_cast<nsMutationEvent*>(mEvent);
InternalMutationEvent* mutation = static_cast<InternalMutationEvent*>(mEvent);
if (mutation->mAttrName)
mutation->mAttrName->ToString(aAttrName);
return NS_OK;
}
uint16_t
nsDOMMutationEvent::AttrChange()
{
return static_cast<InternalMutationEvent*>(mEvent)->mAttrChange;
}
NS_IMETHODIMP
nsDOMMutationEvent::GetAttrChange(uint16_t* aAttrChange)
{
@ -82,7 +100,7 @@ nsDOMMutationEvent::InitMutationEvent(const nsAString& aTypeArg, bool aCanBubble
nsresult rv = nsDOMEvent::InitEvent(aTypeArg, aCanBubbleArg, aCancelableArg);
NS_ENSURE_SUCCESS(rv, rv);
nsMutationEvent* mutation = static_cast<nsMutationEvent*>(mEvent);
InternalMutationEvent* mutation = static_cast<InternalMutationEvent*>(mEvent);
mutation->mRelatedNode = aRelatedNodeArg;
if (!aPrevValueArg.IsEmpty())
mutation->mPrevAttrValue = do_GetAtom(aPrevValueArg);
@ -99,7 +117,7 @@ nsDOMMutationEvent::InitMutationEvent(const nsAString& aTypeArg, bool aCanBubble
nsresult NS_NewDOMMutationEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsMutationEvent *aEvent)
InternalMutationEvent* aEvent)
{
nsDOMMutationEvent* it = new nsDOMMutationEvent(aOwner, aPresContext, aEvent);

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

@ -9,8 +9,8 @@
#include "nsIDOMMutationEvent.h"
#include "nsINode.h"
#include "nsDOMEvent.h"
#include "nsMutationEvent.h"
#include "mozilla/dom/MutationEventBinding.h"
#include "mozilla/EventForwards.h"
class nsDOMMutationEvent : public nsDOMEvent,
public nsIDOMMutationEvent
@ -39,17 +39,9 @@ public:
// GetNewValue(nsAString& aNewValue);
// GetAttrName(nsAString& aAttrName);
already_AddRefed<nsINode> GetRelatedNode()
{
nsCOMPtr<nsINode> n =
do_QueryInterface(static_cast<nsMutationEvent*>(mEvent)->mRelatedNode);
return n.forget();
}
already_AddRefed<nsINode> GetRelatedNode();
uint16_t AttrChange()
{
return static_cast<nsMutationEvent*>(mEvent)->mAttrChange;
}
uint16_t AttrChange();
void InitMutationEvent(const nsAString& aType,
bool& aCanBubble, bool& aCancelable,

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

@ -10,7 +10,6 @@
#include "nsContentUtils.h"
#include "nsCxPusher.h"
#include "nsError.h"
#include "nsMutationEvent.h"
#include <new>
#include "nsINode.h"
#include "nsPIDOMWindow.h"
@ -18,6 +17,7 @@
#include "GeckoProfiler.h"
#include "GeneratedEvents.h"
#include "mozilla/dom/EventTarget.h"
#include "mozilla/MutationEvent.h"
using namespace mozilla;
using namespace mozilla::dom;

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

@ -26,7 +26,7 @@
#include "nsCOMPtr.h"
#include "nsError.h"
#include "nsIDocument.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsIXPConnect.h"
#include "nsDOMCID.h"
#include "nsContentUtils.h"

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

@ -58,7 +58,7 @@
#include "nsLayoutUtils.h"
#include "nsIDOMMutationEvent.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsEventListenerManager.h"
#include "nsRuleData.h"

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

@ -67,7 +67,7 @@
#include "nsFocusManager.h"
#include "nsAttrValueOrString.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsDOMStringMap.h"
#include "nsIEditor.h"

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

@ -14,7 +14,7 @@
#include "nsICSSDeclaration.h"
#include "nsIDocument.h"
#include "nsIDOMMutationEvent.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsError.h"
#include "nsIPresShell.h"
#include "nsGkAtoms.h"

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

@ -73,7 +73,7 @@
#include "nsIListBoxObject.h"
#include "nsContentUtils.h"
#include "nsContentList.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsAsyncDOMEvent.h"
#include "nsIDOMMutationEvent.h"
#include "nsPIDOMWindow.h"

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

@ -62,8 +62,8 @@ enum nsEventStructType
NS_CONTENT_COMMAND_EVENT, // WidgetContentCommandEvent
NS_PLUGIN_EVENT, // WidgetPluginEvent
// DOM events
NS_MUTATION_EVENT, // nsMutationEvent
// MutationEvent.h (content/events/public)
NS_MUTATION_EVENT, // InternalMutationEvent
// Follwoing struct type values are ugly. They indicate other struct type
// actually. However, they are used for distinguishing which DOM event
@ -193,7 +193,15 @@ enum nsEventStructType
#define NS_SCROLLPORT_UNDERFLOW (NS_SCROLLPORT_START)
#define NS_SCROLLPORT_OVERFLOW (NS_SCROLLPORT_START+1)
// Mutation events defined elsewhere starting at 1800
#define NS_MUTATION_START 1800
#define NS_MUTATION_SUBTREEMODIFIED (NS_MUTATION_START)
#define NS_MUTATION_NODEINSERTED (NS_MUTATION_START+1)
#define NS_MUTATION_NODEREMOVED (NS_MUTATION_START+2)
#define NS_MUTATION_NODEREMOVEDFROMDOCUMENT (NS_MUTATION_START+3)
#define NS_MUTATION_NODEINSERTEDINTODOCUMENT (NS_MUTATION_START+4)
#define NS_MUTATION_ATTRMODIFIED (NS_MUTATION_START+5)
#define NS_MUTATION_CHARACTERDATAMODIFIED (NS_MUTATION_START+6)
#define NS_MUTATION_END (NS_MUTATION_START+6)
#define NS_USER_DEFINED_EVENT 2000

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

@ -97,10 +97,10 @@ class InternalAnimationEvent;
class WidgetCommandEvent;
class WidgetContentCommandEvent;
class WidgetPluginEvent;
} // namespace mozilla
// content/events/public/nsMutationEvent.h
class nsMutationEvent;
// MutationEvent.h (content/events/public)
class InternalMutationEvent;
} // namespace mozilla
// TODO: Remove following typedefs
typedef mozilla::WidgetEvent nsEvent;
@ -139,5 +139,6 @@ typedef mozilla::InternalAnimationEvent nsAnimationEvent;
typedef mozilla::WidgetContentCommandEvent nsContentCommandEvent;
typedef mozilla::WidgetCommandEvent nsCommandEvent;
typedef mozilla::WidgetPluginEvent nsPluginEvent;
typedef mozilla::InternalMutationEvent nsMutationEvent;
#endif // mozilla_EventForwards_h__