/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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"mozilla/DoublyLinkedList.h" #include"nsIContent.h"// for use in inline function (NotifyParentChainChanged) #include"nsIMutationObserver.h"// for use in inline function (NotifyParentChainChanged) #include"nsINode.h"
class nsAtom; class nsAttrValue; struct BatchRemovalState;
namespace mozilla::dom { class Animation; class Element;
class MutationObservers { public: /** * Send CharacterDataWillChange notifications to nsIMutationObservers. * @param aContent Node whose data changed * @param aInfo Struct with information details about the change * @see nsIMutationObserver::CharacterDataWillChange
*/ staticvoid NotifyCharacterDataWillChange(nsIContent* aContent, const CharacterDataChangeInfo&);
/** * Send CharacterDataChanged notifications to nsIMutationObservers. * @param aContent Node whose data changed * @param aInfo Struct with information details about the change * @see nsIMutationObserver::CharacterDataChanged
*/ staticvoid NotifyCharacterDataChanged(nsIContent* aContent, const CharacterDataChangeInfo&);
/** * Send AttributeWillChange notifications to nsIMutationObservers. * @param aElement Element whose data will change * @param aNameSpaceID Namespace of changing attribute * @param aAttribute Local-name of changing attribute * @param aModType Type of change (add/change/removal) * @see nsIMutationObserver::AttributeWillChange
*/ staticvoid NotifyAttributeWillChange(mozilla::dom::Element* aElement,
int32_t aNameSpaceID,
nsAtom* aAttribute, int32_t aModType);
/** * Send AttributeChanged notifications to nsIMutationObservers. * @param aElement Element whose data changed * @param aNameSpaceID Namespace of changed attribute * @param aAttribute Local-name of changed attribute * @param aModType Type of change (add/change/removal) * @param aOldValue If the old value was StoresOwnData() (or absent), * that value, otherwise null * @see nsIMutationObserver::AttributeChanged
*/ staticvoid NotifyAttributeChanged(mozilla::dom::Element* aElement,
int32_t aNameSpaceID, nsAtom* aAttribute,
int32_t aModType, const nsAttrValue* aOldValue);
/** * Send AttributeSetToCurrentValue notifications to nsIMutationObservers. * @param aElement Element whose data changed * @param aNameSpaceID Namespace of the attribute * @param aAttribute Local-name of the attribute * @see nsIMutationObserver::AttributeSetToCurrentValue
*/ staticvoid NotifyAttributeSetToCurrentValue(mozilla::dom::Element* aElement,
int32_t aNameSpaceID,
nsAtom* aAttribute);
/** * Send ContentAppended notifications to nsIMutationObservers * @param aContainer Node into which new child/children were added * @param aFirstNewContent First new child * @see nsIMutationObserver::ContentAppended
*/ staticvoid NotifyContentAppended(nsIContent* aContainer,
nsIContent* aFirstNewContent);
/** * Send ContentInserted notifications to nsIMutationObservers * @param aContainer Node into which new child was inserted * @param aChild Newly inserted child * @see nsIMutationObserver::ContentInserted
*/ staticvoid NotifyContentInserted(nsINode* aContainer, nsIContent* aChild); /** * Send ContentWillBeRemoved notifications to nsIMutationObservers * @param aContainer Node from which child was removed * @param aChild Removed child * @param aBatchRemoving Whether we'll be removing all children of this * container. This is useful to avoid wasteful work. * @see nsIMutationObserver::ContentWillBeRemoved
*/ staticvoid NotifyContentWillBeRemoved(nsINode* aContainer,
nsIContent* aChild, const BatchRemovalState*);
/** * Send ParentChainChanged notifications to nsIMutationObservers * @param aContent The piece of content that had its parent changed. * @see nsIMutationObserver::ParentChainChanged
*/ staticinlinevoid NotifyParentChainChanged(nsIContent* aContent) {
mozilla::SafeDoublyLinkedList<nsIMutationObserver>* observers =
aContent->GetMutationObservers(); if (observers) { for (auto iter = observers->begin(); iter != observers->end(); ++iter) { if (iter->IsCallbackEnabled(nsIMutationObserver::kParentChainChanged)) {
iter->ParentChainChanged(aContent);
}
}
}
}
/** * Notify that an animation is added/changed/removed. * @param aAnimation The animation we added/changed/removed.
*/ staticvoid NotifyAnimationAdded(mozilla::dom::Animation* aAnimation); staticvoid NotifyAnimationChanged(mozilla::dom::Animation* aAnimation); staticvoid NotifyAnimationRemoved(mozilla::dom::Animation* aAnimation);
private: enumclass AnimationMutationType { Added, Changed, Removed }; /** * Notify the observers of the target of an animation * @param aAnimation The mutated animation. * @param aMutationType The mutation type of this animation. It could be * Added, Changed, or Removed.
*/ staticvoid NotifyAnimationMutated(mozilla::dom::Animation* aAnimation,
AnimationMutationType aMutatedType);
};
} // namespace mozilla::dom
#endif// DOM_BASE_MUTATIONOBSERVERS_H_
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.