Bug 1436508 part 13. Remove nsIDOMMutationEvent constants. r=masayuki

MozReview-Commit-ID: Anl5QJZknJL
This commit is contained in:
Boris Zbarsky 2018-02-09 11:17:10 -05:00
Родитель 034e47c66b
Коммит 3660ff5632
25 изменённых файлов: 103 добавлений и 104 удалений

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

@ -25,7 +25,6 @@
#include "nsIDocument.h"
#include "nsIDOMCharacterData.h"
#include "nsIDOMDocument.h"
#include "nsIDOMMutationEvent.h"
#include "nsPIDOMWindow.h"
#include "nsIEditingSession.h"
#include "nsIFrame.h"
@ -48,6 +47,7 @@
#include "mozilla/dom/TabChild.h"
#include "mozilla/dom/DocumentType.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/MutationEventBinding.h"
using namespace mozilla;
using namespace mozilla::a11y;
@ -719,7 +719,7 @@ DocAccessible::AttributeWillChange(nsIDocument* aDocument,
// Update dependent IDs cache. Take care of elements that are accessible
// because dependent IDs cache doesn't contain IDs from non accessible
// elements.
if (aModType != nsIDOMMutationEvent::ADDITION)
if (aModType != dom::MutationEventBinding::ADDITION)
RemoveDependentIDsFor(accessible, aAttribute);
if (aAttribute == nsGkAtoms::id) {
@ -737,7 +737,7 @@ DocAccessible::AttributeWillChange(nsIDocument* aDocument,
// need to newly expose it as a toggle button) etc.
if (aAttribute == nsGkAtoms::aria_checked ||
aAttribute == nsGkAtoms::aria_pressed) {
mARIAAttrOldValue = (aModType != nsIDOMMutationEvent::ADDITION) ?
mARIAAttrOldValue = (aModType != dom::MutationEventBinding::ADDITION) ?
nsAccUtils::GetARIAToken(aElement, aAttribute) : nullptr;
return;
}
@ -794,8 +794,8 @@ DocAccessible::AttributeChanged(nsIDocument* aDocument,
// its accessible will be created later. It doesn't make sense to keep
// dependent IDs for non accessible elements. For the second case we'll update
// dependent IDs cache when its accessible is created.
if (aModType == nsIDOMMutationEvent::MODIFICATION ||
aModType == nsIDOMMutationEvent::ADDITION) {
if (aModType == dom::MutationEventBinding::MODIFICATION ||
aModType == dom::MutationEventBinding::ADDITION) {
AddDependentIDsFor(accessible, aAttribute);
}
}

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

@ -53,11 +53,11 @@
#include "nsError.h"
#include "nsDOMString.h"
#include "nsIScriptSecurityManager.h"
#include "nsIDOMMutationEvent.h"
#include "mozilla/dom/AnimatableBinding.h"
#include "mozilla/dom/HTMLDivElement.h"
#include "mozilla/dom/HTMLSpanElement.h"
#include "mozilla/dom/KeyframeAnimationOptionsBinding.h"
#include "mozilla/dom/MutationEventBinding.h"
#include "mozilla/AnimationComparator.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/ContentEvents.h"
@ -2490,8 +2490,8 @@ Element::MaybeCheckSameAttrVal(int32_t aNamespaceID,
}
}
*aModType = modification ?
static_cast<uint8_t>(nsIDOMMutationEvent::MODIFICATION) :
static_cast<uint8_t>(nsIDOMMutationEvent::ADDITION);
static_cast<uint8_t>(MutationEventBinding::MODIFICATION) :
static_cast<uint8_t>(MutationEventBinding::ADDITION);
return false;
}
@ -2539,7 +2539,7 @@ Element::SetSingleClassFromParser(nsAtom* aSingleClassName)
nullptr, // old value
value,
nullptr,
static_cast<uint8_t>(nsIDOMMutationEvent::ADDITION),
static_cast<uint8_t>(MutationEventBinding::ADDITION),
false, // hasListeners
false, // notify
kCallAfterSetAttr,
@ -2755,7 +2755,7 @@ Element::SetAttrAndNotify(int32_t aNamespaceID,
LifecycleCallbackArgs args = {
nsDependentAtomString(aName),
aModType == nsIDOMMutationEvent::ADDITION ?
aModType == MutationEventBinding::ADDITION ?
VoidString() : nsDependentAtomString(oldValueAtom),
nsDependentAtomString(newValueAtom),
(ns.IsEmpty() ? VoidString() : ns)
@ -2990,7 +2990,7 @@ Element::UnsetAttr(int32_t aNameSpaceID, nsAtom* aName,
if (aNotify) {
nsNodeUtils::AttributeWillChange(this, aNameSpaceID, aName,
nsIDOMMutationEvent::REMOVAL,
MutationEventBinding::REMOVAL,
nullptr);
}
@ -3073,7 +3073,7 @@ Element::UnsetAttr(int32_t aNameSpaceID, nsAtom* aName,
// We can always pass oldValue here since there is no new value which could
// have corrupted it.
nsNodeUtils::AttributeChanged(this, aNameSpaceID, aName,
nsIDOMMutationEvent::REMOVAL, &oldValue);
MutationEventBinding::REMOVAL, &oldValue);
}
if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::dir) {
@ -3090,7 +3090,7 @@ Element::UnsetAttr(int32_t aNameSpaceID, nsAtom* aName,
oldValue.ToString(value);
if (!value.IsEmpty())
mutation.mPrevAttrValue = NS_Atomize(value);
mutation.mAttrChange = nsIDOMMutationEvent::REMOVAL;
mutation.mAttrChange = MutationEventBinding::REMOVAL;
mozAutoSubtreeModified subtree(OwnerDoc(), this);
(new AsyncEventDispatcher(this, mutation))->RunDOMEventWhenSafe();

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

@ -737,8 +737,8 @@ public:
* @param aOldValue [out] Set to the old value of the attribute, but only if
* there are event listeners. If set, the type of aOldValue will be either
* nsAttrValue::eString or nsAttrValue::eAtom.
* @param aModType [out] Set to nsIDOMMutationEvent::MODIFICATION or to
* nsIDOMMutationEvent::ADDITION, but only if this helper returns true
* @param aModType [out] Set to MutationEventBinding::MODIFICATION or to
* MutationEventBinding::ADDITION, but only if this helper returns true
* @param aHasListeners [out] Set to true if there are mutation event
* listeners listening for NS_EVENT_BITS_MUTATION_ATTRMODIFIED
* @param aOldValueSet [out] Indicates whether an old attribute value has been
@ -764,8 +764,8 @@ public:
* @param aOldValue [out] Set to the old value of the attribute, but only if
* there are event listeners. If set, the type of aOldValue will be either
* nsAttrValue::eString or nsAttrValue::eAtom.
* @param aModType [out] Set to nsIDOMMutationEvent::MODIFICATION or to
* nsIDOMMutationEvent::ADDITION, but only if this helper returns true
* @param aModType [out] Set to MutationEventBinding::MODIFICATION or to
* MutationEventBinding::ADDITION, but only if this helper returns true
* @param aHasListeners [out] Set to true if there are mutation event
* listeners listening for NS_EVENT_BITS_MUTATION_ATTRMODIFIED
* @param aOldValueSet [out] Indicates whether an old attribute value has been
@ -1739,7 +1739,7 @@ protected:
* non-null value does guarantee that a scripted caller
* with the given principal is directly responsible for
* the attribute change.
* @param aModType nsIDOMMutationEvent::MODIFICATION or ADDITION. Only
* @param aModType MutationEventBinding::MODIFICATION or ADDITION. Only
* needed if aFireMutation or aNotify is true.
* @param aFireMutation should mutation-events be fired?
* @param aNotify should we notify document-observers?

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

@ -20,8 +20,8 @@
#include "mozilla/dom/Element.h"
#include "nsClassHashtable.h"
#include "nsNodeUtils.h"
#include "nsIDOMMutationEvent.h"
#include "nsWrapperCache.h"
#include "mozilla/dom/MutationEventBinding.h"
#include "mozilla/dom/MutationObserverBinding.h"
#include "nsIDocument.h"
#include "mozilla/dom/Animation.h"
@ -411,7 +411,7 @@ public:
{
// We can reuse AttributeWillChange implementation.
AttributeWillChange(aDocument, aElement, aNameSpaceID, aAttribute,
nsIDOMMutationEvent::MODIFICATION, nullptr);
mozilla::dom::MutationEventBinding::MODIFICATION, nullptr);
}
protected:

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

@ -10,6 +10,7 @@
#include "nsAttrValue.h"
#include "nsAttrValueInlines.h"
#include "mozilla/dom/ElementInlines.h"
#include "mozilla/dom/MutationEventBinding.h"
#include "mozilla/InternalMutationEvent.h"
#include "nsDOMCSSDeclaration.h"
#include "nsDOMCSSAttrDeclaration.h"
@ -18,7 +19,6 @@
#include "mozilla/DeclarationBlockInlines.h"
#include "nsCSSParser.h"
#include "mozilla/css/Loader.h"
#include "nsIDOMMutationEvent.h"
#include "nsXULElement.h"
#include "nsContentUtils.h"
#include "nsStyleUtil.h"
@ -104,8 +104,8 @@ nsStyledElement::SetInlineStyleDeclaration(DeclarationBlock* aDeclaration,
// XXXbz do we ever end up with ADDITION here? I doubt it.
uint8_t modType = modification ?
static_cast<uint8_t>(nsIDOMMutationEvent::MODIFICATION) :
static_cast<uint8_t>(nsIDOMMutationEvent::ADDITION);
static_cast<uint8_t>(MutationEventBinding::MODIFICATION) :
static_cast<uint8_t>(MutationEventBinding::ADDITION);
nsIDocument* document = GetComposedDoc();
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, aNotify);

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

@ -13,7 +13,6 @@
#include "nsSize.h"
#include "nsDocument.h"
#include "nsIDocument.h"
#include "nsIDOMMutationEvent.h"
#include "nsIScriptContext.h"
#include "nsIURL.h"
#include "nsIIOService.h"
@ -26,6 +25,7 @@
#include "nsIDOMWindow.h"
#include "nsFocusManager.h"
#include "mozilla/dom/HTMLFormElement.h"
#include "mozilla/dom/MutationEventBinding.h"
#include "nsAttrValueOrString.h"
#include "imgLoader.h"
#include "Image.h"
@ -266,8 +266,8 @@ HTMLImageElement::GetAttributeChangeHint(const nsAtom* aAttribute,
aAttribute == nsGkAtoms::ismap) {
retval |= nsChangeHint_ReconstructFrame;
} else if (aAttribute == nsGkAtoms::alt) {
if (aModType == nsIDOMMutationEvent::ADDITION ||
aModType == nsIDOMMutationEvent::REMOVAL) {
if (aModType == MutationEventBinding::ADDITION ||
aModType == MutationEventBinding::REMOVAL) {
retval |= nsChangeHint_ReconstructFrame;
}
}

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

@ -11,7 +11,7 @@
#include "nsGenericHTMLElement.h"
#include "nsContentUtils.h"
#include "mozilla/dom/DOMStringMapBinding.h"
#include "nsIDOMMutationEvent.h"
#include "mozilla/dom/MutationEventBinding.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -256,8 +256,8 @@ nsDOMStringMap::AttributeChanged(nsIDocument *aDocument, Element* aElement,
int32_t aModType,
const nsAttrValue* aOldValue)
{
if ((aModType == nsIDOMMutationEvent::ADDITION ||
aModType == nsIDOMMutationEvent::REMOVAL) &&
if ((aModType == MutationEventBinding::ADDITION ||
aModType == MutationEventBinding::REMOVAL) &&
aNameSpaceID == kNameSpaceID_None &&
StringBeginsWith(nsDependentAtomString(aAttribute),
NS_LITERAL_STRING("data-"))) {

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

@ -9,11 +9,6 @@
[builtinclass, uuid(30c9997f-bc4c-4890-b890-febb6ae3051b)]
interface nsIDOMMutationEvent : nsISupports
{
const unsigned short MODIFICATION = 1;
const unsigned short ADDITION = 2;
const unsigned short REMOVAL = 3;
const unsigned short SMIL = 4;
readonly attribute nsIDOMNode relatedNode;
readonly attribute DOMString prevValue;
readonly attribute DOMString newValue;

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

@ -5,13 +5,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "gfx2DGlue.h"
#include "mozilla/dom/MutationEventBinding.h"
#include "mozilla/dom/SVGAnimatedTransformList.h"
#include "mozilla/dom/SVGGraphicsElementBinding.h"
#include "mozilla/dom/SVGTransformableElement.h"
#include "mozilla/dom/SVGMatrix.h"
#include "mozilla/dom/SVGSVGElement.h"
#include "nsContentUtils.h"
#include "nsIDOMMutationEvent.h"
#include "nsIFrame.h"
#include "nsSVGDisplayableFrame.h"
#include "mozilla/dom/SVGRect.h"
@ -65,11 +65,11 @@ SVGTransformableElement::GetAttributeChangeHint(const nsAtom* aAttribute,
}
bool isAdditionOrRemoval = false;
if (aModType == nsIDOMMutationEvent::ADDITION ||
aModType == nsIDOMMutationEvent::REMOVAL) {
if (aModType == MutationEventBinding::ADDITION ||
aModType == MutationEventBinding::REMOVAL) {
isAdditionOrRemoval = true;
} else {
MOZ_ASSERT(aModType == nsIDOMMutationEvent::MODIFICATION,
MOZ_ASSERT(aModType == MutationEventBinding::MODIFICATION,
"Unknown modification type.");
if (!mTransforms ||
!mTransforms->HasTransform()) {
@ -133,11 +133,11 @@ SVGTransformableElement::SetAnimateMotionTransform(const gfx::Matrix* aMatrix)
bool nowSet = mAnimateMotionTransform || transformSet;
int32_t modType;
if (prevSet && !nowSet) {
modType = nsIDOMMutationEvent::REMOVAL;
modType = MutationEventBinding::REMOVAL;
} else if(!prevSet && nowSet) {
modType = nsIDOMMutationEvent::ADDITION;
modType = MutationEventBinding::ADDITION;
} else {
modType = nsIDOMMutationEvent::MODIFICATION;
modType = MutationEventBinding::MODIFICATION;
}
DidAnimateTransformList(modType);
nsIFrame* frame = GetPrimaryFrame();

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

@ -6,6 +6,7 @@
#include "nsSVGAnimatedTransformList.h"
#include "mozilla/dom/MutationEventBinding.h"
#include "mozilla/dom/SVGAnimatedTransformList.h"
#include "mozilla/dom/SVGAnimationElement.h"
#include "mozilla/Move.h"
@ -14,7 +15,6 @@
#include "nsSMILValue.h"
#include "SVGContentUtils.h"
#include "SVGTransformListSMILType.h"
#include "nsIDOMMutationEvent.h"
namespace mozilla {
@ -124,9 +124,9 @@ nsSVGAnimatedTransformList::SetAnimValue(const SVGTransformList& aValue,
}
int32_t modType;
if(prevSet) {
modType = nsIDOMMutationEvent::MODIFICATION;
modType = MutationEventBinding::MODIFICATION;
} else {
modType = nsIDOMMutationEvent::ADDITION;
modType = MutationEventBinding::ADDITION;
}
aElement->DidAnimateTransformList(modType);
return NS_OK;
@ -148,9 +148,9 @@ nsSVGAnimatedTransformList::ClearAnimValue(nsSVGElement *aElement)
mAnimVal = nullptr;
int32_t modType;
if (HasTransform() || aElement->GetAnimateMotionTransform()) {
modType = nsIDOMMutationEvent::MODIFICATION;
modType = MutationEventBinding::MODIFICATION;
} else {
modType = nsIDOMMutationEvent::REMOVAL;
modType = MutationEventBinding::REMOVAL;
}
aElement->DidAnimateTransformList(modType);
}

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

@ -17,7 +17,6 @@
#include "nsICSSDeclaration.h"
#include "nsIContentInlines.h"
#include "nsIDocument.h"
#include "nsIDOMMutationEvent.h"
#include "mozilla/InternalMutationEvent.h"
#include "mozAutoDocUpdate.h"
#include "nsError.h"
@ -55,6 +54,7 @@
#include "SVGMotionSMILAttr.h"
#include "nsAttrValueOrString.h"
#include "nsSMILAnimationController.h"
#include "mozilla/dom/MutationEventBinding.h"
#include "mozilla/dom/SVGElementBinding.h"
#include "mozilla/DeclarationBlock.h"
#include "mozilla/DeclarationBlockInlines.h"
@ -1449,8 +1449,8 @@ nsSVGElement::WillChangeValue(nsAtom* aName)
}
uint8_t modType = attrValue
? static_cast<uint8_t>(nsIDOMMutationEvent::MODIFICATION)
: static_cast<uint8_t>(nsIDOMMutationEvent::ADDITION);
? static_cast<uint8_t>(MutationEventBinding::MODIFICATION)
: static_cast<uint8_t>(MutationEventBinding::ADDITION);
nsNodeUtils::AttributeWillChange(this, kNameSpaceID_None, aName, modType,
nullptr);
@ -1495,8 +1495,8 @@ nsSVGElement::DidChangeValue(nsAtom* aName,
NS_EVENT_BITS_MUTATION_ATTRMODIFIED,
this);
uint8_t modType = HasAttr(kNameSpaceID_None, aName)
? static_cast<uint8_t>(nsIDOMMutationEvent::MODIFICATION)
: static_cast<uint8_t>(nsIDOMMutationEvent::ADDITION);
? static_cast<uint8_t>(MutationEventBinding::MODIFICATION)
: static_cast<uint8_t>(MutationEventBinding::ADDITION);
nsIDocument* document = GetComposedDoc();
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL,
@ -1630,7 +1630,7 @@ nsSVGElement::DidAnimateLength(uint8_t aAttrEnum)
LengthAttributesInfo info = GetLengthInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mLengthInfo[aAttrEnum].mName,
nsIDOMMutationEvent::SMIL);
MutationEventBinding::SMIL);
}
}
@ -1727,7 +1727,7 @@ nsSVGElement::DidAnimateLengthList(uint8_t aAttrEnum)
LengthListAttributesInfo info = GetLengthListInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mLengthListInfo[aAttrEnum].mName,
nsIDOMMutationEvent::SMIL);
MutationEventBinding::SMIL);
}
}
@ -1815,7 +1815,7 @@ nsSVGElement::DidAnimateNumberList(uint8_t aAttrEnum)
frame->AttributeChanged(kNameSpaceID_None,
*info.mNumberListInfo[aAttrEnum].mName,
nsIDOMMutationEvent::SMIL);
MutationEventBinding::SMIL);
}
}
@ -1876,7 +1876,7 @@ nsSVGElement::DidAnimatePointList()
if (frame) {
frame->AttributeChanged(kNameSpaceID_None,
GetPointListAttrName(),
nsIDOMMutationEvent::SMIL);
MutationEventBinding::SMIL);
}
}
@ -1913,7 +1913,7 @@ nsSVGElement::DidAnimatePathSegList()
if (frame) {
frame->AttributeChanged(kNameSpaceID_None,
GetPathDataAttrName(),
nsIDOMMutationEvent::SMIL);
MutationEventBinding::SMIL);
}
}
@ -1954,7 +1954,7 @@ nsSVGElement::DidAnimateNumber(uint8_t aAttrEnum)
NumberAttributesInfo info = GetNumberInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mNumberInfo[aAttrEnum].mName,
nsIDOMMutationEvent::SMIL);
MutationEventBinding::SMIL);
}
}
@ -2024,7 +2024,7 @@ nsSVGElement::DidAnimateNumberPair(uint8_t aAttrEnum)
NumberPairAttributesInfo info = GetNumberPairInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mNumberPairInfo[aAttrEnum].mName,
nsIDOMMutationEvent::SMIL);
MutationEventBinding::SMIL);
}
}
@ -2065,7 +2065,7 @@ nsSVGElement::DidAnimateInteger(uint8_t aAttrEnum)
IntegerAttributesInfo info = GetIntegerInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mIntegerInfo[aAttrEnum].mName,
nsIDOMMutationEvent::SMIL);
MutationEventBinding::SMIL);
}
}
@ -2136,7 +2136,7 @@ nsSVGElement::DidAnimateIntegerPair(uint8_t aAttrEnum)
IntegerPairAttributesInfo info = GetIntegerPairInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mIntegerPairInfo[aAttrEnum].mName,
nsIDOMMutationEvent::SMIL);
MutationEventBinding::SMIL);
}
}
@ -2184,7 +2184,7 @@ nsSVGElement::DidAnimateAngle(uint8_t aAttrEnum)
AngleAttributesInfo info = GetAngleInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mAngleInfo[aAttrEnum].mName,
nsIDOMMutationEvent::SMIL);
MutationEventBinding::SMIL);
}
}
@ -2223,7 +2223,7 @@ nsSVGElement::DidAnimateBoolean(uint8_t aAttrEnum)
BooleanAttributesInfo info = GetBooleanInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mBooleanInfo[aAttrEnum].mName,
nsIDOMMutationEvent::SMIL);
MutationEventBinding::SMIL);
}
}
@ -2262,7 +2262,7 @@ nsSVGElement::DidAnimateEnum(uint8_t aAttrEnum)
EnumAttributesInfo info = GetEnumInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mEnumInfo[aAttrEnum].mName,
nsIDOMMutationEvent::SMIL);
MutationEventBinding::SMIL);
}
}
@ -2299,7 +2299,7 @@ nsSVGElement::DidAnimateViewBox()
if (frame) {
frame->AttributeChanged(kNameSpaceID_None,
nsGkAtoms::viewBox,
nsIDOMMutationEvent::SMIL);
MutationEventBinding::SMIL);
}
}
@ -2339,7 +2339,7 @@ nsSVGElement::DidAnimatePreserveAspectRatio()
if (frame) {
frame->AttributeChanged(kNameSpaceID_None,
nsGkAtoms::preserveAspectRatio,
nsIDOMMutationEvent::SMIL);
MutationEventBinding::SMIL);
}
}
@ -2437,7 +2437,7 @@ nsSVGElement::DidAnimateString(uint8_t aAttrEnum)
StringAttributesInfo info = GetStringInfo();
frame->AttributeChanged(info.mStringInfo[aAttrEnum].mNamespaceID,
*info.mStringInfo[aAttrEnum].mName,
nsIDOMMutationEvent::SMIL);
MutationEventBinding::SMIL);
}
}

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

@ -14,6 +14,8 @@ interface MutationEvent : Event
const unsigned short MODIFICATION = 1;
const unsigned short ADDITION = 2;
const unsigned short REMOVAL = 3;
[ChromeOnly]
const unsigned short SMIL = 4;
readonly attribute Node? relatedNode;
readonly attribute DOMString prevValue;

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

@ -61,7 +61,6 @@
#include "nsContentList.h"
#include "mozilla/InternalMutationEvent.h"
#include "mozilla/MouseEvents.h"
#include "nsIDOMMutationEvent.h"
#include "nsPIDOMWindow.h"
#include "nsJSPrincipals.h"
#include "nsDOMAttributeMap.h"
@ -92,6 +91,7 @@
#include "mozilla/dom/XULElementBinding.h"
#include "mozilla/dom/BoxObject.h"
#include "mozilla/dom/HTMLIFrameElement.h"
#include "mozilla/dom/MutationEventBinding.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -1404,8 +1404,8 @@ nsXULElement::GetAttributeChangeHint(const nsAtom* aAttribute,
nsChangeHint retval(nsChangeHint(0));
if (aAttribute == nsGkAtoms::value &&
(aModType == nsIDOMMutationEvent::REMOVAL ||
aModType == nsIDOMMutationEvent::ADDITION)) {
(aModType == MutationEventBinding::REMOVAL ||
aModType == MutationEventBinding::ADDITION)) {
if (IsAnyOfXULElements(nsGkAtoms::label, nsGkAtoms::description))
// Label and description dynamically morph between a normal
// block and a cropping single-line XUL text frame. If the

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

@ -18,6 +18,7 @@
#include "mozilla/EventStates.h"
#include "mozilla/ViewportFrame.h"
#include "mozilla/css/StyleRule.h" // For nsCSSSelector
#include "mozilla/dom/MutationEventBinding.h"
#include "nsLayoutUtils.h"
#include "AnimationCommon.h" // For GetLayerAnimationInfo
#include "FrameLayerBuilder.h"
@ -43,7 +44,6 @@
#include "SVGTextFrame.h"
#include "StickyScrollContainer.h"
#include "nsIRootBox.h"
#include "nsIDOMMutationEvent.h"
#include "nsContentUtils.h"
#include "nsIFrameInlines.h"
#include "ActiveLayerTracker.h"
@ -400,9 +400,9 @@ GeckoRestyleManager::AttributeChanged(Element* aElement,
{
nsIRootBox* rootBox = nsIRootBox::GetRootBox(PresContext()->GetPresShell());
if (rootBox) {
if (aModType == nsIDOMMutationEvent::REMOVAL)
if (aModType == MutationEventBinding::REMOVAL)
rootBox->RemoveTooltipSupport(aElement);
if (aModType == nsIDOMMutationEvent::ADDITION)
if (aModType == MutationEventBinding::ADDITION)
rootBox->AddTooltipSupport(aElement);
}
}

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

@ -17,11 +17,11 @@
#include "nsContentUtils.h"
#include "nsContentCreatorFunctions.h"
#include "mozilla/dom/HTMLInputElement.h"
#include "mozilla/dom/MutationEventBinding.h"
#include "nsNodeInfoManager.h"
#include "nsIDateTimeInputArea.h"
#include "nsIObserverService.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMMutationEvent.h"
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nsThreadUtils.h"
@ -422,14 +422,14 @@ nsDateTimeControlFrame::AttributeChanged(int32_t aNameSpaceID,
&nsIDateTimeInputArea::NotifyInputElementValueChanged));
}
} else {
if (aModType == nsIDOMMutationEvent::REMOVAL) {
if (aModType == MutationEventBinding::REMOVAL) {
if (inputAreaContent) {
nsAtomString name(aAttribute);
inputAreaContent->RemoveEditAttribute(name);
}
} else {
MOZ_ASSERT(aModType == nsIDOMMutationEvent::ADDITION ||
aModType == nsIDOMMutationEvent::MODIFICATION);
MOZ_ASSERT(aModType == MutationEventBinding::ADDITION ||
aModType == MutationEventBinding::MODIFICATION);
if (inputAreaContent) {
nsAtomString name(aAttribute);
nsAutoString value;

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

@ -15,6 +15,7 @@
#include "mozilla/dom/DOMPrefs.h"
#include "mozilla/dom/HTMLButtonElement.h"
#include "mozilla/dom/HTMLInputElement.h"
#include "mozilla/dom/MutationEventBinding.h"
#include "mozilla/Preferences.h"
#include "nsNodeInfoManager.h"
#include "nsContentCreatorFunctions.h"
@ -25,7 +26,6 @@
#include "mozilla/dom/FileList.h"
#include "nsIDOMDragEvent.h"
#include "nsIDOMFileList.h"
#include "nsIDOMMutationEvent.h"
#include "nsTextNode.h"
using namespace mozilla;
@ -448,7 +448,7 @@ nsFileControlFrame::AttributeChanged(int32_t aNameSpaceID,
int32_t aModType)
{
if (aNameSpaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::tabindex) {
if (aModType == nsIDOMMutationEvent::REMOVAL) {
if (aModType == MutationEventBinding::REMOVAL) {
mBrowseFilesOrDirs->UnsetAttr(aNameSpaceID, aAttribute, true);
} else {
nsAutoString value;

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

@ -26,9 +26,9 @@
#endif
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsIDOMMutationEvent.h"
#include "nsThreadUtils.h"
#include "mozilla/FloatingPoint.h"
#include "mozilla/dom/MutationEventBinding.h"
#ifdef ACCESSIBILITY
#include "mozilla/a11y/AccTypes.h"
@ -272,11 +272,11 @@ nsNumberControlFrame::AttributeChanged(int32_t aNameSpaceID,
if (aAttribute == nsGkAtoms::placeholder ||
aAttribute == nsGkAtoms::readonly ||
aAttribute == nsGkAtoms::tabindex) {
if (aModType == nsIDOMMutationEvent::REMOVAL) {
if (aModType == MutationEventBinding::REMOVAL) {
mTextField->UnsetAttr(aNameSpaceID, aAttribute, true);
} else {
MOZ_ASSERT(aModType == nsIDOMMutationEvent::ADDITION ||
aModType == nsIDOMMutationEvent::MODIFICATION);
MOZ_ASSERT(aModType == MutationEventBinding::ADDITION ||
aModType == MutationEventBinding::MODIFICATION);
nsAutoString value;
mContent->AsElement()->GetAttr(aNameSpaceID, aAttribute, value);
mTextField->SetAttr(aNameSpaceID, aAttribute, value, true);

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

@ -14,7 +14,6 @@
#include "nsIDOMNode.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMCharacterData.h"
#include "nsIDOMMutationEvent.h"
#include "nsBindingManager.h"
#include "nsNameSpaceManager.h"
#include "nsIDocument.h"
@ -26,6 +25,7 @@
#include "mozilla/Services.h"
#include "mozilla/dom/InspectorUtils.h"
#include "mozilla/dom/NodeFilterBinding.h"
#include "mozilla/dom/MutationEventBinding.h"
#ifdef ACCESSIBILITY
#include "nsAccessibilityService.h"
@ -653,7 +653,7 @@ inDOMView::AttributeChanged(nsIDocument* aDocument, dom::Element* aElement,
domAttr = aElement->GetAttributeNode(attrStr);
}
if (aModType == nsIDOMMutationEvent::MODIFICATION) {
if (aModType == dom::MutationEventBinding::MODIFICATION) {
// No fancy stuff here, just invalidate the changed row
if (!domAttr) {
return;
@ -661,7 +661,7 @@ inDOMView::AttributeChanged(nsIDocument* aDocument, dom::Element* aElement,
int32_t row = 0;
NodeToRow(domAttr, &row);
mTree->InvalidateRange(row, row);
} else if (aModType == nsIDOMMutationEvent::ADDITION) {
} else if (aModType == dom::MutationEventBinding::ADDITION) {
if (!domAttr) {
return;
}
@ -700,7 +700,7 @@ inDOMView::AttributeChanged(nsIDocument* aDocument, dom::Element* aElement,
}
InsertNode(newNode, attrRow);
mTree->RowCountChanged(attrRow, 1);
} else if (aModType == nsIDOMMutationEvent::REMOVAL) {
} else if (aModType == dom::MutationEventBinding::REMOVAL) {
// At this point, the attribute is already gone from the DOM, but is still represented
// in our mRows array. Search through the content node's children for the corresponding
// node and remove it.

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

@ -14,13 +14,13 @@
#include "nsIPresShell.h"
#include "nsStyleContext.h"
#include "nsNameSpaceManager.h"
#include "nsIDOMMutationEvent.h"
#include "nsGkAtoms.h"
#include "nsDisplayList.h"
#include "mozilla/Likely.h"
#include "nsIScriptError.h"
#include "nsContentUtils.h"
#include "nsMathMLElement.h"
#include "mozilla/dom/MutationEventBinding.h"
using namespace mozilla;
using namespace mozilla::gfx;
@ -740,7 +740,7 @@ nsMathMLContainerFrame::AppendFrames(ChildListID aListID,
{
MOZ_ASSERT(aListID == kPrincipalList);
mFrames.AppendFrames(this, aFrameList);
ChildListChanged(nsIDOMMutationEvent::ADDITION);
ChildListChanged(dom::MutationEventBinding::ADDITION);
}
void
@ -750,7 +750,7 @@ nsMathMLContainerFrame::InsertFrames(ChildListID aListID,
{
MOZ_ASSERT(aListID == kPrincipalList);
mFrames.InsertFrames(this, aPrevFrame, aFrameList);
ChildListChanged(nsIDOMMutationEvent::ADDITION);
ChildListChanged(dom::MutationEventBinding::ADDITION);
}
void
@ -759,7 +759,7 @@ nsMathMLContainerFrame::RemoveFrame(ChildListID aListID,
{
MOZ_ASSERT(aListID == kPrincipalList);
mFrames.DestroyFrame(aOldFrame);
ChildListChanged(nsIDOMMutationEvent::REMOVAL);
ChildListChanged(dom::MutationEventBinding::REMOVAL);
}
nsresult

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

@ -54,7 +54,7 @@
#include "mozilla/OperatorNewExtensions.h"
#include "mozilla/TypedEnumBits.h"
#include "RuleProcessorCache.h"
#include "nsIDOMMutationEvent.h"
#include "mozilla/dom/MutationEventBinding.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -2622,7 +2622,7 @@ nsCSSRuleProcessor::HasAttributeDependentStyle(
aData->mNameSpaceID == kNameSpaceID_None) {
const nsAttrValue* otherClasses = aData->mOtherValue;
NS_ASSERTION(otherClasses ||
aData->mModType == nsIDOMMutationEvent::REMOVAL,
aData->mModType == MutationEventBinding::REMOVAL,
"All class values should be StoresOwnData and parsed"
"via Element::BeforeSetAttr, so available here");
// For WillChange, enumerate classes that will be removed to see which

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

@ -15,11 +15,11 @@
#include "mozilla/DeclarationBlock.h"
#include "mozilla/DeclarationBlockInlines.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/MutationEventBinding.h"
#include "mozilla/InternalMutationEvent.h"
#include "mozilla/ServoDeclarationBlock.h"
#include "nsContentUtils.h"
#include "nsIDocument.h"
#include "nsIDOMMutationEvent.h"
#include "nsIURI.h"
#include "nsNodeUtils.h"
#include "nsWrapperCacheInlines.h"
@ -120,7 +120,7 @@ nsDOMCSSAttributeDeclaration::GetCSSDeclaration(Operation aOperation)
(aOperation == eOperation_RemoveProperty && declaration))) {
nsNodeUtils::AttributeWillChange(mElement, kNameSpaceID_None,
nsGkAtoms::style,
nsIDOMMutationEvent::MODIFICATION,
dom::MutationEventBinding::MODIFICATION,
nullptr);
}

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

@ -9,11 +9,11 @@
#include "nsContentUtils.h"
#include "nsFrame.h"
#include "nsGkAtoms.h"
#include "nsIDOMMutationEvent.h"
#include "nsLiteralString.h"
#include "SVGObserverUtils.h"
#include "nsSVGFilters.h"
#include "mozilla/dom/SVGFEImageElement.h"
#include "mozilla/dom/MutationEventBinding.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -132,7 +132,7 @@ SVGFEImageFrame::AttributeChanged(int32_t aNameSpaceID,
// Currently our SMIL implementation does not modify the DOM attributes. Once
// we implement the SVG 2 SMIL behaviour this can be removed
// SVGFEImageElement::AfterSetAttr's implementation will be sufficient.
if (aModType == nsIDOMMutationEvent::SMIL &&
if (aModType == MutationEventBinding::SMIL &&
aAttribute == nsGkAtoms::href &&
(aNameSpaceID == kNameSpaceID_XLink ||
aNameSpaceID == kNameSpaceID_None)) {

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

@ -7,8 +7,8 @@
// Keep in (case-insensitive) order:
#include "gfxMatrix.h"
#include "mozilla/dom/SVGAElement.h"
#include "mozilla/dom/MutationEventBinding.h"
#include "nsAutoPtr.h"
#include "nsIDOMMutationEvent.h"
#include "nsSVGContainerFrame.h"
#include "nsSVGIntegrationUtils.h"
#include "nsSVGUtils.h"
@ -91,7 +91,7 @@ nsSVGAFrame::AttributeChanged(int32_t aNameSpaceID,
// Currently our SMIL implementation does not modify the DOM attributes. Once
// we implement the SVG 2 SMIL behaviour this can be removed
// SVGAElement::SetAttr/UnsetAttr's ResetLinkState() call will be sufficient.
if (aModType == nsIDOMMutationEvent::SMIL &&
if (aModType == dom::MutationEventBinding::SMIL &&
aAttribute == nsGkAtoms::href &&
(aNameSpaceID == kNameSpaceID_None ||
aNameSpaceID == kNameSpaceID_XLink)) {
@ -104,4 +104,4 @@ nsSVGAFrame::AttributeChanged(int32_t aNameSpaceID,
}
return NS_OK;
}
}

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

@ -12,7 +12,6 @@
#include "mozilla/gfx/2D.h"
#include "imgIContainer.h"
#include "nsContainerFrame.h"
#include "nsIDOMMutationEvent.h"
#include "nsIImageLoadingContent.h"
#include "nsLayoutUtils.h"
#include "imgINotificationObserver.h"
@ -21,6 +20,7 @@
#include "SVGContentUtils.h"
#include "SVGGeometryFrame.h"
#include "SVGImageContext.h"
#include "mozilla/dom/MutationEventBinding.h"
#include "mozilla/dom/SVGImageElement.h"
#include "nsContentUtils.h"
#include "nsIReflowCallback.h"
@ -147,7 +147,7 @@ nsSVGImageFrame::AttributeChanged(int32_t aNameSpaceID,
// Currently our SMIL implementation does not modify the DOM attributes. Once
// we implement the SVG 2 SMIL behaviour this can be removed
// SVGImageElement::AfterSetAttr's implementation will be sufficient.
if (aModType == nsIDOMMutationEvent::SMIL &&
if (aModType == MutationEventBinding::SMIL &&
aAttribute == nsGkAtoms::href &&
(aNameSpaceID == kNameSpaceID_XLink ||
aNameSpaceID == kNameSpaceID_None)) {

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

@ -20,7 +20,7 @@
#include "mozilla/LookAndFeel.h"
#include "nsThemeConstants.h"
#include "nsIContent.h"
#include "nsIDOMMutationEvent.h"
#include "mozilla/dom/MutationEventBinding.h"
using namespace mozilla;
@ -267,7 +267,8 @@ nsScrollbarFrame::MoveToNewPosition()
}
content->SetAttr(kNameSpaceID_None, nsGkAtoms::curpos, curposStr, false);
// notify the nsScrollbarFrame of the change
AttributeChanged(kNameSpaceID_None, nsGkAtoms::curpos, nsIDOMMutationEvent::MODIFICATION);
AttributeChanged(kNameSpaceID_None, nsGkAtoms::curpos,
dom::MutationEventBinding::MODIFICATION);
if (!weakFrame.IsAlive()) {
return curpos;
}
@ -279,7 +280,8 @@ nsScrollbarFrame::MoveToNewPosition()
nsIFrame* f = childFrames.get();
nsSliderFrame* sliderFrame = do_QueryFrame(f);
if (sliderFrame) {
sliderFrame->AttributeChanged(kNameSpaceID_None, nsGkAtoms::curpos, nsIDOMMutationEvent::MODIFICATION);
sliderFrame->AttributeChanged(kNameSpaceID_None, nsGkAtoms::curpos,
dom::MutationEventBinding::MODIFICATION);
if (!weakFrame.IsAlive()) {
return curpos;
}