2015-05-03 19:32:37 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2010-08-24 07:05:56 +00:00
|
|
|
|
|
|
|
#ifndef nsIMutationObserver_h
|
|
|
|
#define nsIMutationObserver_h
|
2006-07-02 07:23:10 +00:00
|
|
|
|
|
|
|
#include "nsISupports.h"
|
|
|
|
|
2019-10-23 08:22:36 +00:00
|
|
|
#include "mozilla/Assertions.h"
|
|
|
|
|
2015-07-25 06:01:19 +00:00
|
|
|
class nsAttrValue;
|
2017-10-02 22:05:19 +00:00
|
|
|
class nsAtom;
|
2006-07-02 07:23:10 +00:00
|
|
|
class nsIContent;
|
|
|
|
class nsINode;
|
|
|
|
|
2010-08-24 07:05:56 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class Element;
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2006-07-02 07:23:10 +00:00
|
|
|
#define NS_IMUTATION_OBSERVER_IID \
|
2018-11-30 10:46:48 +00:00
|
|
|
{ \
|
2015-09-24 15:23:32 +00:00
|
|
|
0x6d674c17, 0x0fbc, 0x4633, { \
|
|
|
|
0x8f, 0x46, 0x73, 0x4e, 0x87, 0xeb, 0xf0, 0xc7 \
|
|
|
|
} \
|
|
|
|
}
|
2015-07-25 06:05:19 +00:00
|
|
|
|
2006-11-03 21:51:01 +00:00
|
|
|
/**
|
2008-07-21 18:11:06 +00:00
|
|
|
* Information details about a characterdata change. Basically, we
|
|
|
|
* view all changes as replacements of a length of text at some offset
|
|
|
|
* with some other text (of possibly some other length).
|
2006-11-03 21:51:01 +00:00
|
|
|
*/
|
|
|
|
struct CharacterDataChangeInfo {
|
2008-07-21 18:11:06 +00:00
|
|
|
/**
|
|
|
|
* True if this character data change is just an append.
|
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mAppend;
|
2008-07-21 18:11:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The offset in the text where the change occurred.
|
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mChangeStart;
|
2008-07-21 18:11:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The offset such that mChangeEnd - mChangeStart is equal to the length of
|
2019-10-28 08:45:33 +00:00
|
|
|
* the text we removed. If this was a pure insert, append or a result of
|
|
|
|
* `splitText()` this is equal to mChangeStart.
|
2008-07-21 18:11:06 +00:00
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mChangeEnd;
|
2008-07-21 18:11:06 +00:00
|
|
|
|
2019-10-23 08:22:36 +00:00
|
|
|
uint32_t LengthOfRemovedText() const {
|
|
|
|
MOZ_ASSERT(mChangeStart <= mChangeEnd);
|
|
|
|
|
|
|
|
return mChangeEnd - mChangeStart;
|
|
|
|
}
|
|
|
|
|
2008-07-21 18:11:06 +00:00
|
|
|
/**
|
|
|
|
* The length of the text that was inserted in place of the removed text. If
|
|
|
|
* this was a pure text removal, this is 0.
|
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mReplaceLength;
|
2008-07-21 18:11:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The net result is that mChangeStart characters at the beginning of the
|
|
|
|
* text remained as they were. The next mChangeEnd - mChangeStart characters
|
|
|
|
* were removed, and mReplaceLength characters were inserted in their place.
|
|
|
|
* The text that used to begin at mChangeEnd now begins at
|
|
|
|
* mChangeStart + mReplaceLength.
|
|
|
|
*/
|
2011-08-16 00:55:20 +00:00
|
|
|
|
2015-07-03 13:55:00 +00:00
|
|
|
struct MOZ_STACK_CLASS Details {
|
2011-08-16 00:55:20 +00:00
|
|
|
enum {
|
|
|
|
eMerge, // two text nodes are merged as a result of normalize()
|
|
|
|
eSplit // a text node is split as a result of splitText()
|
|
|
|
} mType;
|
|
|
|
/**
|
|
|
|
* For eMerge it's the text node that will be removed, for eSplit it's the
|
|
|
|
* new text node.
|
|
|
|
*/
|
2015-07-03 13:55:00 +00:00
|
|
|
nsIContent* MOZ_NON_OWNING_REF mNextSibling;
|
2011-08-16 00:55:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for splitText() and normalize(), otherwise null.
|
|
|
|
*/
|
|
|
|
Details* mDetails;
|
2006-11-03 21:51:01 +00:00
|
|
|
};
|
|
|
|
|
2007-03-10 13:49:43 +00:00
|
|
|
/**
|
|
|
|
* Mutation observer interface
|
|
|
|
*
|
2008-10-11 01:38:16 +00:00
|
|
|
* See nsINode::AddMutationObserver, nsINode::RemoveMutationObserver for how to
|
|
|
|
* attach or remove your observers.
|
|
|
|
*
|
2007-03-10 13:49:43 +00:00
|
|
|
* WARNING: During these notifications, you are not allowed to perform
|
|
|
|
* any mutations to the current or any other document, or start a
|
|
|
|
* network load. If you need to perform such operations do that
|
|
|
|
* during the _last_ nsIDocumentObserver::EndUpdate notification. The
|
2020-04-07 17:00:54 +00:00
|
|
|
* exception for this is ParentChainChanged, where mutations should be
|
2007-03-10 13:49:43 +00:00
|
|
|
* done from an async event, as the notification might not be
|
|
|
|
* surrounded by BeginUpdate/EndUpdate calls.
|
|
|
|
*/
|
2006-07-02 07:23:10 +00:00
|
|
|
class nsIMutationObserver : public nsISupports {
|
|
|
|
public:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMUTATION_OBSERVER_IID)
|
|
|
|
|
2007-09-05 08:22:17 +00:00
|
|
|
/**
|
|
|
|
* Notification that the node value of a data node (text, cdata, pi, comment)
|
|
|
|
* will be changed.
|
|
|
|
*
|
|
|
|
* This notification is not sent when a piece of content is
|
|
|
|
* added/removed from the document (the other notifications are used
|
|
|
|
* for that).
|
|
|
|
*
|
|
|
|
* @param aContent The piece of content that changed. Is never null.
|
|
|
|
* @param aInfo The structure with information details about the change.
|
2010-07-21 15:33:32 +00:00
|
|
|
*
|
|
|
|
* @note Callers of this method might not hold a strong reference to the
|
|
|
|
* observer. The observer is responsible for making sure it stays
|
|
|
|
* alive for the duration of the call as needed. The observer may
|
|
|
|
* assume that this call will happen when there are script blockers on
|
|
|
|
* the stack.
|
2007-09-05 08:22:17 +00:00
|
|
|
*/
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void CharacterDataWillChange(nsIContent* aContent,
|
2018-02-27 14:30:27 +00:00
|
|
|
const CharacterDataChangeInfo&) = 0;
|
2007-09-05 08:22:17 +00:00
|
|
|
|
2006-07-02 07:23:10 +00:00
|
|
|
/**
|
|
|
|
* Notification that the node value of a data node (text, cdata, pi, comment)
|
|
|
|
* has changed.
|
|
|
|
*
|
|
|
|
* This notification is not sent when a piece of content is
|
|
|
|
* added/removed from the document (the other notifications are used
|
|
|
|
* for that).
|
|
|
|
*
|
|
|
|
* @param aContent The piece of content that changed. Is never null.
|
2007-09-05 08:22:17 +00:00
|
|
|
* @param aInfo The structure with information details about the change.
|
2010-07-21 15:33:32 +00:00
|
|
|
*
|
|
|
|
* @note Callers of this method might not hold a strong reference to the
|
|
|
|
* observer. The observer is responsible for making sure it stays
|
|
|
|
* alive for the duration of the call as needed. The observer may
|
|
|
|
* assume that this call will happen when there are script blockers on
|
|
|
|
* the stack.
|
2006-07-02 07:23:10 +00:00
|
|
|
*/
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void CharacterDataChanged(nsIContent* aContent,
|
2018-02-27 14:30:27 +00:00
|
|
|
const CharacterDataChangeInfo&) = 0;
|
2006-07-02 07:23:10 +00:00
|
|
|
|
2009-06-29 18:36:25 +00:00
|
|
|
/**
|
2010-02-24 04:37:47 +00:00
|
|
|
* Notification that an attribute of an element will change. This
|
|
|
|
* can happen before the BeginUpdate for the change and may not
|
|
|
|
* always be followed by an AttributeChanged (in particular, if the
|
|
|
|
* attribute doesn't actually change there will be no corresponding
|
|
|
|
* AttributeChanged).
|
2009-06-29 18:36:25 +00:00
|
|
|
*
|
|
|
|
* @param aContent The element whose attribute will change
|
|
|
|
* @param aNameSpaceID The namespace id of the changing attribute
|
|
|
|
* @param aAttribute The name of the changing attribute
|
|
|
|
* @param aModType Whether or not the attribute will be added, changed, or
|
|
|
|
* removed. The constants are defined in
|
2018-02-09 16:17:10 +00:00
|
|
|
* MutationEvent.webidl.
|
2015-07-25 06:05:19 +00:00
|
|
|
* @param aNewValue The new value, IF it has been preparsed by
|
|
|
|
* BeforeSetAttr, otherwise null.
|
2010-07-21 15:33:32 +00:00
|
|
|
*
|
|
|
|
* @note Callers of this method might not hold a strong reference to the
|
|
|
|
* observer. The observer is responsible for making sure it stays
|
|
|
|
* alive for the duration of the call as needed. The observer may
|
|
|
|
* assume that this call will happen when there are script blockers on
|
|
|
|
* the stack.
|
2009-06-29 18:36:25 +00:00
|
|
|
*/
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void AttributeWillChange(mozilla::dom::Element* aElement,
|
|
|
|
int32_t aNameSpaceID, nsAtom* aAttribute,
|
2019-01-29 15:27:02 +00:00
|
|
|
int32_t aModType) = 0;
|
2009-06-29 18:36:25 +00:00
|
|
|
|
2006-07-02 07:23:10 +00:00
|
|
|
/**
|
|
|
|
* Notification that an attribute of an element has changed.
|
|
|
|
*
|
2010-08-24 07:05:56 +00:00
|
|
|
* @param aElement The element whose attribute changed
|
2006-07-02 07:23:10 +00:00
|
|
|
* @param aNameSpaceID The namespace id of the changed attribute
|
|
|
|
* @param aAttribute The name of the changed attribute
|
|
|
|
* @param aModType Whether or not the attribute was added, changed, or
|
|
|
|
* removed. The constants are defined in
|
2018-02-09 16:17:10 +00:00
|
|
|
* MutationEvent.webidl.
|
2015-07-25 06:01:19 +00:00
|
|
|
* @param aOldValue The old value, if either the old value or the new
|
|
|
|
* value are StoresOwnData() (or absent); null otherwise.
|
2010-07-21 15:33:32 +00:00
|
|
|
*
|
|
|
|
* @note Callers of this method might not hold a strong reference to the
|
|
|
|
* observer. The observer is responsible for making sure it stays
|
|
|
|
* alive for the duration of the call as needed. The observer may
|
|
|
|
* assume that this call will happen when there are script blockers on
|
|
|
|
* the stack.
|
2006-07-02 07:23:10 +00:00
|
|
|
*/
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void AttributeChanged(mozilla::dom::Element* aElement,
|
|
|
|
int32_t aNameSpaceID, nsAtom* aAttribute,
|
|
|
|
int32_t aModType,
|
2015-07-25 06:01:19 +00:00
|
|
|
const nsAttrValue* aOldValue) = 0;
|
2006-07-02 07:23:10 +00:00
|
|
|
|
2015-09-24 15:23:32 +00:00
|
|
|
/**
|
|
|
|
* Notification that the root of a native anonymous has been added
|
|
|
|
* or removed.
|
|
|
|
*
|
|
|
|
* @param aContent Anonymous node that's been added or removed
|
|
|
|
* @param aIsRemove True if it's a removal, false if an addition
|
|
|
|
*/
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void NativeAnonymousChildListChange(nsIContent* aContent,
|
2015-09-24 15:23:32 +00:00
|
|
|
bool aIsRemove) {}
|
|
|
|
|
2012-08-15 10:06:01 +00:00
|
|
|
/**
|
|
|
|
* Notification that an attribute of an element has been
|
|
|
|
* set to the value it already had.
|
|
|
|
*
|
|
|
|
* @param aElement The element whose attribute changed
|
|
|
|
* @param aNameSpaceID The namespace id of the changed attribute
|
|
|
|
* @param aAttribute The name of the changed attribute
|
|
|
|
*/
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void AttributeSetToCurrentValue(mozilla::dom::Element* aElement,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aNameSpaceID,
|
2017-10-02 22:05:19 +00:00
|
|
|
nsAtom* aAttribute) {}
|
2012-08-15 10:06:01 +00:00
|
|
|
|
2006-07-02 07:23:10 +00:00
|
|
|
/**
|
|
|
|
* Notification that one or more content nodes have been appended to the
|
|
|
|
* child list of another node in the tree.
|
|
|
|
*
|
2018-03-01 11:36:58 +00:00
|
|
|
* @param aFirstNewContent the first node appended.
|
2010-07-21 15:33:32 +00:00
|
|
|
*
|
|
|
|
* @note Callers of this method might not hold a strong reference to the
|
|
|
|
* observer. The observer is responsible for making sure it stays
|
|
|
|
* alive for the duration of the call as needed. The observer may
|
|
|
|
* assume that this call will happen when there are script blockers on
|
|
|
|
* the stack.
|
2006-07-02 07:23:10 +00:00
|
|
|
*/
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void ContentAppended(nsIContent* aFirstNewContent) = 0;
|
2006-07-02 07:23:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Notification that a content node has been inserted as child to another
|
|
|
|
* node in the tree.
|
|
|
|
*
|
2018-03-01 11:36:58 +00:00
|
|
|
* @param aChild The newly inserted child.
|
2010-07-21 15:33:32 +00:00
|
|
|
*
|
|
|
|
* @note Callers of this method might not hold a strong reference to the
|
|
|
|
* observer. The observer is responsible for making sure it stays
|
|
|
|
* alive for the duration of the call as needed. The observer may
|
|
|
|
* assume that this call will happen when there are script blockers on
|
|
|
|
* the stack.
|
2006-07-02 07:23:10 +00:00
|
|
|
*/
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void ContentInserted(nsIContent* aChild) = 0;
|
2006-07-02 07:23:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Notification that a content node has been removed from the child list of
|
|
|
|
* another node in the tree.
|
|
|
|
*
|
|
|
|
* @param aChild The child that was removed.
|
2010-07-21 22:05:17 +00:00
|
|
|
* @param aPreviousSibling The previous sibling to the child that was removed.
|
|
|
|
* Can be null if there was no previous sibling.
|
2010-07-21 15:37:41 +00:00
|
|
|
*
|
|
|
|
* @note Callers of this method might not hold a strong reference to the
|
|
|
|
* observer. The observer is responsible for making sure it stays
|
|
|
|
* alive for the duration of the call as needed. The observer may
|
|
|
|
* assume that this call will happen when there are script blockers on
|
|
|
|
* the stack.
|
2006-07-02 07:23:10 +00:00
|
|
|
*/
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void ContentRemoved(nsIContent* aChild,
|
2010-07-21 22:05:17 +00:00
|
|
|
nsIContent* aPreviousSibling) = 0;
|
2006-07-02 07:23:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The node is in the process of being destroyed. Calling QI on the node is
|
|
|
|
* not supported, however it is possible to get children and flags through
|
2017-10-25 15:19:11 +00:00
|
|
|
* nsINode as well as calling IsContent and casting to nsIContent to get
|
|
|
|
* attributes.
|
2006-07-02 07:23:10 +00:00
|
|
|
*
|
|
|
|
* NOTE: This notification is only called on observers registered directly
|
|
|
|
* on the node. This is because when the node is destroyed it can not have
|
|
|
|
* any ancestors. If you want to know when a descendant node is being
|
|
|
|
* removed from the observed node, use the ContentRemoved notification.
|
2017-07-06 12:00:35 +00:00
|
|
|
*
|
2006-07-02 07:23:10 +00:00
|
|
|
* @param aNode The node being destroyed.
|
2010-07-21 15:33:32 +00:00
|
|
|
*
|
|
|
|
* @note Callers of this method might not hold a strong reference to
|
|
|
|
* the observer. The observer is responsible for making sure it
|
|
|
|
* stays alive for the duration of the call as needed.
|
2006-07-02 07:23:10 +00:00
|
|
|
*/
|
|
|
|
virtual void NodeWillBeDestroyed(const nsINode* aNode) = 0;
|
2007-03-10 13:49:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Notification that the node's parent chain has changed. This
|
|
|
|
* happens when either the node or one of its ancestors is inserted
|
|
|
|
* or removed as a child of another node.
|
|
|
|
*
|
|
|
|
* Note that when a node is inserted this notification is sent to
|
|
|
|
* all descendants of that node, since all such nodes have their
|
|
|
|
* parent chain changed.
|
|
|
|
*
|
|
|
|
* @param aContent The piece of content that had its parent changed.
|
2010-07-21 15:33:31 +00:00
|
|
|
*
|
|
|
|
* @note Callers of this method might not hold a strong reference to
|
|
|
|
* the observer. The observer is responsible for making sure it
|
|
|
|
* stays alive for the duration of the call as needed.
|
2007-03-10 13:49:43 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
virtual void ParentChainChanged(nsIContent* aContent) = 0;
|
2006-07-02 07:23:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsIMutationObserver, NS_IMUTATION_OBSERVER_IID)
|
|
|
|
|
2007-09-05 08:22:17 +00:00
|
|
|
#define NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATAWILLCHANGE \
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void CharacterDataWillChange( \
|
2018-02-27 14:30:27 +00:00
|
|
|
nsIContent* aContent, const CharacterDataChangeInfo& aInfo) override;
|
2007-09-05 08:22:17 +00:00
|
|
|
|
2007-03-10 13:49:43 +00:00
|
|
|
#define NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED \
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void CharacterDataChanged( \
|
2018-02-27 14:30:27 +00:00
|
|
|
nsIContent* aContent, const CharacterDataChangeInfo& aInfo) override;
|
2007-03-10 13:49:43 +00:00
|
|
|
|
2009-06-29 18:36:25 +00:00
|
|
|
#define NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTEWILLCHANGE \
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void AttributeWillChange(mozilla::dom::Element* aElement, \
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aNameSpaceID, nsAtom* aAttribute, \
|
2019-01-29 15:27:02 +00:00
|
|
|
int32_t aModType) override;
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2015-09-24 15:23:32 +00:00
|
|
|
#define NS_DECL_NSIMUTATIONOBSERVER_NATIVEANONYMOUSCHILDLISTCHANGE \
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void NativeAnonymousChildListChange(nsIContent* aContent, \
|
2015-09-24 15:23:32 +00:00
|
|
|
bool aIsRemove) override;
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2007-03-10 13:49:43 +00:00
|
|
|
#define NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED \
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void AttributeChanged(mozilla::dom::Element* aElement, \
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aNameSpaceID, nsAtom* aAttribute, \
|
2015-07-25 06:01:19 +00:00
|
|
|
int32_t aModType, \
|
|
|
|
const nsAttrValue* aOldValue) override;
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2007-03-10 13:49:43 +00:00
|
|
|
#define NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED \
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void ContentAppended(nsIContent* aFirstNewContent) override;
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2007-03-10 13:49:43 +00:00
|
|
|
#define NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED \
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void ContentInserted(nsIContent* aChild) override;
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2007-03-10 13:49:43 +00:00
|
|
|
#define NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED \
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void ContentRemoved(nsIContent* aChild, \
|
2007-03-10 13:49:43 +00:00
|
|
|
nsIContent* aPreviousSibling) override;
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2007-03-10 13:49:43 +00:00
|
|
|
#define NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED \
|
2018-03-01 11:36:58 +00:00
|
|
|
virtual void NodeWillBeDestroyed(const nsINode* aNode) override;
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2018-03-01 11:36:58 +00:00
|
|
|
#define NS_DECL_NSIMUTATIONOBSERVER_PARENTCHAINCHANGED \
|
2006-07-02 07:23:10 +00:00
|
|
|
virtual void ParentChainChanged(nsIContent* aContent) override;
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2006-07-02 07:23:10 +00:00
|
|
|
#define NS_DECL_NSIMUTATIONOBSERVER \
|
2018-03-01 11:36:58 +00:00
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATAWILLCHANGE \
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED \
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTEWILLCHANGE \
|
2012-08-22 15:56:38 +00:00
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_NATIVEANONYMOUSCHILDLISTCHANGE \
|
2017-10-02 22:05:19 +00:00
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED \
|
2015-07-25 06:05:19 +00:00
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED \
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED \
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED \
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED \
|
2007-03-10 13:49:43 +00:00
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_PARENTCHAINCHANGED
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2015-07-25 06:05:19 +00:00
|
|
|
#define NS_IMPL_NSIMUTATIONOBSERVER_CORE_STUB(_class) \
|
|
|
|
void _class::NodeWillBeDestroyed(const nsINode* aNode) {}
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2006-07-02 07:23:10 +00:00
|
|
|
#define NS_IMPL_NSIMUTATIONOBSERVER_CONTENT(_class) \
|
2018-03-01 11:36:58 +00:00
|
|
|
void _class::CharacterDataWillChange( \
|
2015-07-25 06:05:19 +00:00
|
|
|
nsIContent* aContent, const CharacterDataChangeInfo& aInfo) {} \
|
2018-03-01 11:36:58 +00:00
|
|
|
void _class::CharacterDataChanged(nsIContent* aContent, \
|
2015-09-24 15:23:32 +00:00
|
|
|
const CharacterDataChangeInfo& aInfo) {} \
|
2019-01-29 15:27:02 +00:00
|
|
|
void _class::AttributeWillChange(mozilla::dom::Element* aElement, \
|
|
|
|
int32_t aNameSpaceID, nsAtom* aAttribute, \
|
|
|
|
int32_t aModType) {} \
|
2006-07-02 07:23:10 +00:00
|
|
|
void _class::NativeAnonymousChildListChange(nsIContent* aContent, \
|
2015-09-24 15:23:32 +00:00
|
|
|
bool aIsRemove) {} \
|
2018-03-01 11:36:58 +00:00
|
|
|
void _class::AttributeChanged( \
|
|
|
|
mozilla::dom::Element* aElement, int32_t aNameSpaceID, \
|
2015-07-25 06:01:19 +00:00
|
|
|
nsAtom* aAttribute, int32_t aModType, const nsAttrValue* aOldValue) {} \
|
2018-03-01 11:36:58 +00:00
|
|
|
void _class::ContentAppended(nsIContent* aFirstNewContent) {} \
|
|
|
|
void _class::ContentInserted(nsIContent* aChild) {} \
|
|
|
|
void _class::ContentRemoved(nsIContent* aChild, \
|
|
|
|
nsIContent* aPreviousSibling) {} \
|
2007-03-10 13:49:43 +00:00
|
|
|
void _class::ParentChainChanged(nsIContent* aContent) {}
|
|
|
|
|
2010-08-24 07:05:56 +00:00
|
|
|
#endif /* nsIMutationObserver_h */
|