Bug 1519185: Remove AttributeWillChange aNewValue parameter r=emilio,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D17073
This commit is contained in:
committed by
Emilio Cobos Álvarez
parent
ef8b62c773
commit
cdc6f539cb
@@ -641,8 +641,7 @@ NS_IMPL_NSIDOCUMENTOBSERVER_LOAD_STUB(DocAccessible)
|
||||
|
||||
void DocAccessible::AttributeWillChange(dom::Element* aElement,
|
||||
int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute, int32_t aModType,
|
||||
const nsAttrValue* aNewValue) {
|
||||
nsAtom* aAttribute, int32_t aModType) {
|
||||
Accessible* accessible = GetAccessible(aElement);
|
||||
if (!accessible) {
|
||||
if (aElement != mContent) return;
|
||||
|
||||
@@ -2355,8 +2355,7 @@ nsresult Element::SetAttr(int32_t aNamespaceID, nsAtom* aName, nsAtom* aPrefix,
|
||||
}
|
||||
|
||||
if (aNotify) {
|
||||
nsNodeUtils::AttributeWillChange(this, aNamespaceID, aName, modType,
|
||||
nullptr);
|
||||
nsNodeUtils::AttributeWillChange(this, aNamespaceID, aName, modType);
|
||||
}
|
||||
|
||||
// Hold a script blocker while calling ParseAttribute since that can call
|
||||
@@ -2402,8 +2401,7 @@ nsresult Element::SetParsedAttr(int32_t aNamespaceID, nsAtom* aName,
|
||||
}
|
||||
|
||||
if (aNotify) {
|
||||
nsNodeUtils::AttributeWillChange(this, aNamespaceID, aName, modType,
|
||||
&aParsedValue);
|
||||
nsNodeUtils::AttributeWillChange(this, aNamespaceID, aName, modType);
|
||||
}
|
||||
|
||||
nsresult rv = BeforeSetAttr(aNamespaceID, aName, &value, aNotify);
|
||||
@@ -2708,7 +2706,7 @@ nsresult Element::UnsetAttr(int32_t aNameSpaceID, nsAtom* aName, bool aNotify) {
|
||||
|
||||
if (aNotify) {
|
||||
nsNodeUtils::AttributeWillChange(this, aNameSpaceID, aName,
|
||||
MutationEvent_Binding::REMOVAL, nullptr);
|
||||
MutationEvent_Binding::REMOVAL);
|
||||
}
|
||||
|
||||
nsresult rv = BeforeSetAttr(aNameSpaceID, aName, nullptr, aNotify);
|
||||
|
||||
@@ -139,8 +139,7 @@ void nsMutationReceiver::NativeAnonymousChildListChange(nsIContent* aContent,
|
||||
void nsMutationReceiver::AttributeWillChange(mozilla::dom::Element* aElement,
|
||||
int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute,
|
||||
int32_t aModType,
|
||||
const nsAttrValue* aNewValue) {
|
||||
int32_t aModType) {
|
||||
if (nsAutoMutationBatch::IsBatching() ||
|
||||
!ObservesAttr(RegisterTarget(), aElement, aNameSpaceID, aAttribute)) {
|
||||
return;
|
||||
|
||||
@@ -359,8 +359,7 @@ class nsMutationReceiver : public nsMutationReceiverBase {
|
||||
nsAtom* aAttribute) override {
|
||||
// We can reuse AttributeWillChange implementation.
|
||||
AttributeWillChange(aElement, aNameSpaceID, aAttribute,
|
||||
mozilla::dom::MutationEvent_Binding::MODIFICATION,
|
||||
nullptr);
|
||||
mozilla::dom::MutationEvent_Binding::MODIFICATION);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -164,8 +164,7 @@ class nsIMutationObserver : public nsISupports {
|
||||
*/
|
||||
virtual void AttributeWillChange(mozilla::dom::Element* aElement,
|
||||
int32_t aNameSpaceID, nsAtom* aAttribute,
|
||||
int32_t aModType,
|
||||
const nsAttrValue* aNewValue) = 0;
|
||||
int32_t aModType) = 0;
|
||||
|
||||
/**
|
||||
* Notification that an attribute of an element has changed.
|
||||
@@ -308,8 +307,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIMutationObserver, NS_IMUTATION_OBSERVER_IID)
|
||||
#define NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTEWILLCHANGE \
|
||||
virtual void AttributeWillChange(mozilla::dom::Element* aElement, \
|
||||
int32_t aNameSpaceID, nsAtom* aAttribute, \
|
||||
int32_t aModType, \
|
||||
const nsAttrValue* aNewValue) override;
|
||||
int32_t aModType) override;
|
||||
|
||||
#define NS_DECL_NSIMUTATIONOBSERVER_NATIVEANONYMOUSCHILDLISTCHANGE \
|
||||
virtual void NativeAnonymousChildListChange(nsIContent* aContent, \
|
||||
@@ -357,9 +355,9 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIMutationObserver, NS_IMUTATION_OBSERVER_IID)
|
||||
nsIContent* aContent, const CharacterDataChangeInfo& aInfo) {} \
|
||||
void _class::CharacterDataChanged(nsIContent* aContent, \
|
||||
const CharacterDataChangeInfo& aInfo) {} \
|
||||
void _class::AttributeWillChange( \
|
||||
mozilla::dom::Element* aElement, int32_t aNameSpaceID, \
|
||||
nsAtom* aAttribute, int32_t aModType, const nsAttrValue* aNewValue) {} \
|
||||
void _class::AttributeWillChange(mozilla::dom::Element* aElement, \
|
||||
int32_t aNameSpaceID, nsAtom* aAttribute, \
|
||||
int32_t aModType) {} \
|
||||
void _class::NativeAnonymousChildListChange(nsIContent* aContent, \
|
||||
bool aIsRemove) {} \
|
||||
void _class::AttributeChanged( \
|
||||
|
||||
@@ -141,12 +141,10 @@ void nsNodeUtils::CharacterDataChanged(nsIContent* aContent,
|
||||
}
|
||||
|
||||
void nsNodeUtils::AttributeWillChange(Element* aElement, int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute, int32_t aModType,
|
||||
const nsAttrValue* aNewValue) {
|
||||
nsAtom* aAttribute, int32_t aModType) {
|
||||
Document* doc = aElement->OwnerDoc();
|
||||
IMPL_MUTATION_NOTIFICATION(
|
||||
AttributeWillChange, aElement,
|
||||
(aElement, aNameSpaceID, aAttribute, aModType, aNewValue),
|
||||
IMPL_MUTATION_NOTIFICATION(AttributeWillChange, aElement,
|
||||
(aElement, aNameSpaceID, aAttribute, aModType),
|
||||
IsRemoveNotification::No);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,8 +57,7 @@ class nsNodeUtils {
|
||||
*/
|
||||
static void AttributeWillChange(mozilla::dom::Element* aElement,
|
||||
int32_t aNameSpaceID, nsAtom* aAttribute,
|
||||
int32_t aModType,
|
||||
const nsAttrValue* aNewValue);
|
||||
int32_t aModType);
|
||||
|
||||
/**
|
||||
* Send AttributeChanged notifications to nsIMutationObservers.
|
||||
|
||||
@@ -97,7 +97,7 @@ void nsStyledElement::InlineStyleDeclarationWillChange(
|
||||
modification ? static_cast<uint8_t>(MutationEvent_Binding::MODIFICATION)
|
||||
: static_cast<uint8_t>(MutationEvent_Binding::ADDITION);
|
||||
nsNodeUtils::AttributeWillChange(this, kNameSpaceID_None, nsGkAtoms::style,
|
||||
aData.mModType, nullptr);
|
||||
aData.mModType);
|
||||
|
||||
// XXXsmaug In order to make attribute handling more consistent, consider to
|
||||
// call BeforeSetAttr and pass kCallAfterSetAttr to
|
||||
|
||||
@@ -1088,8 +1088,7 @@ void IMEContentObserver::ContentRemoved(nsIContent* aChild,
|
||||
void IMEContentObserver::AttributeWillChange(dom::Element* aElement,
|
||||
int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute,
|
||||
int32_t aModType,
|
||||
const nsAttrValue* aNewValue) {
|
||||
int32_t aModType) {
|
||||
if (!NeedsTextChangeNotification()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1252,8 +1252,7 @@ nsAttrValue SVGElement::WillChangeValue(nsAtom* aName) {
|
||||
uint8_t modType =
|
||||
attrValue ? static_cast<uint8_t>(MutationEvent_Binding::MODIFICATION)
|
||||
: static_cast<uint8_t>(MutationEvent_Binding::ADDITION);
|
||||
nsNodeUtils::AttributeWillChange(this, kNameSpaceID_None, aName, modType,
|
||||
nullptr);
|
||||
nsNodeUtils::AttributeWillChange(this, kNameSpaceID_None, aName, modType);
|
||||
|
||||
// This is not strictly correct--the attribute value parameter for
|
||||
// BeforeSetAttr should reflect the value that *will* be set but that implies
|
||||
|
||||
@@ -4262,8 +4262,7 @@ void PresShell::DocumentStatesChanged(Document* aDocument,
|
||||
}
|
||||
|
||||
void PresShell::AttributeWillChange(Element* aElement, int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute, int32_t aModType,
|
||||
const nsAttrValue* aNewValue) {
|
||||
nsAtom* aAttribute, int32_t aModType) {
|
||||
MOZ_ASSERT(!mIsDocumentGone, "Unexpected AttributeWillChange");
|
||||
MOZ_ASSERT(aElement->OwnerDoc() == mDocument, "Unexpected document");
|
||||
|
||||
@@ -4272,8 +4271,8 @@ void PresShell::AttributeWillChange(Element* aElement, int32_t aNameSpaceID,
|
||||
// squelch any other inappropriate notifications as well.
|
||||
if (mDidInitialize) {
|
||||
nsAutoCauseReflowNotifier crNotifier(this);
|
||||
mPresContext->RestyleManager()->AttributeWillChange(
|
||||
aElement, aNameSpaceID, aAttribute, aModType, aNewValue);
|
||||
mPresContext->RestyleManager()->AttributeWillChange(aElement, aNameSpaceID,
|
||||
aAttribute, aModType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3279,8 +3279,7 @@ static inline bool NeedToRecordAttrChange(
|
||||
|
||||
void RestyleManager::AttributeWillChange(Element* aElement,
|
||||
int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute, int32_t aModType,
|
||||
const nsAttrValue* aNewValue) {
|
||||
nsAtom* aAttribute, int32_t aModType) {
|
||||
TakeSnapshotForAttributeChange(*aElement, aNameSpaceID, aAttribute);
|
||||
}
|
||||
|
||||
|
||||
@@ -341,8 +341,7 @@ class RestyleManager {
|
||||
|
||||
void ContentStateChanged(nsIContent* aContent, EventStates aStateMask);
|
||||
void AttributeWillChange(Element* aElement, int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute, int32_t aModType,
|
||||
const nsAttrValue* aNewValue);
|
||||
nsAtom* aAttribute, int32_t aModType);
|
||||
void ClassAttributeWillBeChangedBySMIL(dom::Element* aElement);
|
||||
void AttributeChanged(dom::Element* aElement, int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute, int32_t aModType,
|
||||
|
||||
@@ -180,8 +180,7 @@ void nsFormFillController::CharacterDataChanged(
|
||||
void nsFormFillController::AttributeWillChange(mozilla::dom::Element* aElement,
|
||||
int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute,
|
||||
int32_t aModType,
|
||||
const nsAttrValue* aNewValue) {}
|
||||
int32_t aModType) {}
|
||||
|
||||
void nsFormFillController::NativeAnonymousChildListChange(nsIContent* aContent,
|
||||
bool aIsRemove) {}
|
||||
|
||||
@@ -70,8 +70,7 @@ void nsMenuGroupOwnerX::ContentAppended(nsIContent* aFirstNewContent) {
|
||||
void nsMenuGroupOwnerX::NodeWillBeDestroyed(const nsINode* aNode) {}
|
||||
|
||||
void nsMenuGroupOwnerX::AttributeWillChange(dom::Element* aContent, int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute, int32_t aModType,
|
||||
const nsAttrValue* aNewValue) {}
|
||||
nsAtom* aAttribute, int32_t aModType) {}
|
||||
|
||||
void nsMenuGroupOwnerX::NativeAnonymousChildListChange(nsIContent* aContent, bool aIsRemove) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user