Skip to content

Commit ff56284

Browse files
Bug 920377 part.1 Get rid of nsMutationEvent r=roc
1 parent 9665368 commit ff56284

File tree

12 files changed

+18
-19
lines changed

12 files changed

+18
-19
lines changed

content/base/src/Element.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,7 @@ Element::SetAttrAndNotify(int32_t aNamespaceID,
17301730
}
17311731

17321732
if (aFireMutation) {
1733-
nsMutationEvent mutation(true, NS_MUTATION_ATTRMODIFIED);
1733+
InternalMutationEvent mutation(true, NS_MUTATION_ATTRMODIFIED);
17341734

17351735
nsAutoString ns;
17361736
nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNamespaceID, ns);
@@ -1911,7 +1911,7 @@ Element::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aName,
19111911
}
19121912

19131913
if (hasMutationListeners) {
1914-
nsMutationEvent mutation(true, NS_MUTATION_ATTRMODIFIED);
1914+
InternalMutationEvent mutation(true, NS_MUTATION_ATTRMODIFIED);
19151915

19161916
mutation.mRelatedNode = attrNode;
19171917
mutation.mAttrName = aName;

content/base/src/FragmentOrElement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ FragmentOrElement::FireNodeInserted(nsIDocument* aDoc,
10211021

10221022
if (nsContentUtils::HasMutationListeners(childContent,
10231023
NS_EVENT_BITS_MUTATION_NODEINSERTED, aParent)) {
1024-
nsMutationEvent mutation(true, NS_MUTATION_NODEINSERTED);
1024+
InternalMutationEvent mutation(true, NS_MUTATION_NODEINSERTED);
10251025
mutation.mRelatedNode = do_QueryInterface(aParent);
10261026

10271027
mozAutoSubtreeModified subtree(aDoc, aParent);

content/base/src/nsContentUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3708,7 +3708,7 @@ nsContentUtils::MaybeFireNodeRemoved(nsINode* aChild, nsINode* aParent,
37083708

37093709
if (HasMutationListeners(aChild,
37103710
NS_EVENT_BITS_MUTATION_NODEREMOVED, aParent)) {
3711-
nsMutationEvent mutation(true, NS_MUTATION_NODEREMOVED);
3711+
InternalMutationEvent mutation(true, NS_MUTATION_NODEREMOVED);
37123712
mutation.mRelatedNode = do_QueryInterface(aParent);
37133713

37143714
mozAutoSubtreeModified subtree(aOwnerDoc, aParent);

content/base/src/nsDocument.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8194,7 +8194,7 @@ nsDocument::MutationEventDispatched(nsINode* aTarget)
81948194

81958195
int32_t realTargetCount = realTargets.Count();
81968196
for (int32_t k = 0; k < realTargetCount; ++k) {
8197-
nsMutationEvent mutation(true, NS_MUTATION_SUBTREEMODIFIED);
8197+
InternalMutationEvent mutation(true, NS_MUTATION_SUBTREEMODIFIED);
81988198
(new nsAsyncDOMEvent(realTargets[k], mutation))->RunDOMEventWhenSafe();
81998199
}
82008200
}

content/base/src/nsGenericDOMDataNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ nsGenericDOMDataNode::SetTextInternal(uint32_t aOffset, uint32_t aCount,
363363
nsNodeUtils::CharacterDataChanged(this, &info);
364364

365365
if (haveMutationListeners) {
366-
nsMutationEvent mutation(true, NS_MUTATION_CHARACTERDATAMODIFIED);
366+
InternalMutationEvent mutation(true, NS_MUTATION_CHARACTERDATAMODIFIED);
367367

368368
mutation.mPrevAttrValue = oldValue;
369369
if (aLength > 0) {

content/base/src/nsINode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,7 @@ nsINode::doInsertChildAt(nsIContent* aKid, uint32_t aIndex,
14051405

14061406
if (nsContentUtils::HasMutationListeners(aKid,
14071407
NS_EVENT_BITS_MUTATION_NODEINSERTED, this)) {
1408-
nsMutationEvent mutation(true, NS_MUTATION_NODEINSERTED);
1408+
InternalMutationEvent mutation(true, NS_MUTATION_NODEINSERTED);
14091409
mutation.mRelatedNode = do_QueryInterface(this);
14101410

14111411
mozAutoSubtreeModified subtree(OwnerDoc(), this);

content/events/public/MutationEvent.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,4 @@ class InternalMutationEvent : public WidgetEvent
5555

5656
} // namespace mozilla
5757

58-
// TODO: Remove following typedef
59-
typedef mozilla::InternalMutationEvent nsMutationEvent;
60-
6158
#endif // mozilla_MutationEvent_h__

content/events/src/nsDOMEvent.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMEvent)
153153
static_cast<nsClipboardEvent*>(tmp->mEvent)->clipboardData = nullptr;
154154
break;
155155
case NS_MUTATION_EVENT:
156-
static_cast<nsMutationEvent*>(tmp->mEvent)->mRelatedNode = nullptr;
156+
static_cast<InternalMutationEvent*>(tmp->mEvent)->mRelatedNode =
157+
nullptr;
157158
break;
158159
case NS_FOCUS_EVENT:
159160
static_cast<nsFocusEvent*>(tmp->mEvent)->relatedTarget = nullptr;
@@ -198,7 +199,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMEvent)
198199
case NS_MUTATION_EVENT:
199200
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->mRelatedNode");
200201
cb.NoteXPCOMChild(
201-
static_cast<nsMutationEvent*>(tmp->mEvent)->mRelatedNode);
202+
static_cast<InternalMutationEvent*>(tmp->mEvent)->mRelatedNode);
202203
break;
203204
case NS_FOCUS_EVENT:
204205
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->relatedTarget");
@@ -635,9 +636,10 @@ nsDOMEvent::DuplicatePrivateData()
635636
}
636637
case NS_MUTATION_EVENT:
637638
{
638-
nsMutationEvent* mutationEvent = new nsMutationEvent(false, msg);
639-
nsMutationEvent* oldMutationEvent =
640-
static_cast<nsMutationEvent*>(mEvent);
639+
InternalMutationEvent* mutationEvent =
640+
new InternalMutationEvent(false, msg);
641+
InternalMutationEvent* oldMutationEvent =
642+
static_cast<InternalMutationEvent*>(mEvent);
641643
mutationEvent->AssignMutationEventData(*oldMutationEvent, true);
642644
newEvent = mutationEvent;
643645
break;

content/events/src/nsDOMMutationEvent.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class nsDOMMutationEvent : public nsDOMEvent,
1717
{
1818
public:
1919
nsDOMMutationEvent(mozilla::dom::EventTarget* aOwner,
20-
nsPresContext* aPresContext, nsMutationEvent* aEvent);
20+
nsPresContext* aPresContext,
21+
mozilla::InternalMutationEvent* aEvent);
2122

2223
virtual ~nsDOMMutationEvent();
2324

content/events/src/nsEventDispatcher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ nsEventDispatcher::CreateEvent(mozilla::dom::EventTarget* aOwner,
690690
switch(aEvent->eventStructType) {
691691
case NS_MUTATION_EVENT:
692692
return NS_NewDOMMutationEvent(aDOMEvent, aOwner, aPresContext,
693-
static_cast<nsMutationEvent*>(aEvent));
693+
static_cast<InternalMutationEvent*>(aEvent));
694694
case NS_GUI_EVENT:
695695
case NS_SCROLLPORT_EVENT:
696696
case NS_UI_EVENT:

0 commit comments

Comments
 (0)