mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1184842. Add aOldValue parameter to nsNodeUtils::AttributeChanged. r=peterv
This commit is contained in:
parent
4c4dbbd99b
commit
0d0c23582f
@ -2328,7 +2328,11 @@ Element::SetAttrAndNotify(int32_t aNamespaceID,
|
||||
}
|
||||
|
||||
if (aNotify) {
|
||||
nsNodeUtils::AttributeChanged(this, aNamespaceID, aName, aModType);
|
||||
// Don't pass aOldValue to AttributeChanged since it may not be reliable.
|
||||
// Callers only compute aOldValue under certain conditions which may not
|
||||
// be triggered by all nsIMutationObservers.
|
||||
nsNodeUtils::AttributeChanged(this, aNamespaceID, aName, aModType,
|
||||
oldValue == &aParsedValue ? &aParsedValue : nullptr);
|
||||
}
|
||||
|
||||
if (aFireMutation) {
|
||||
@ -2540,8 +2544,10 @@ Element::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
}
|
||||
|
||||
if (aNotify) {
|
||||
// We can always pass oldValue here since there is no new value which could
|
||||
// have corrupted it.
|
||||
nsNodeUtils::AttributeChanged(this, aNameSpaceID, aName,
|
||||
nsIDOMMutationEvent::REMOVAL);
|
||||
nsIDOMMutationEvent::REMOVAL, &oldValue);
|
||||
}
|
||||
|
||||
rv = AfterSetAttr(aNameSpaceID, aName, nullptr, aNotify);
|
||||
|
@ -135,7 +135,8 @@ void
|
||||
nsNodeUtils::AttributeChanged(Element* aElement,
|
||||
int32_t aNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
int32_t aModType)
|
||||
int32_t aModType,
|
||||
const nsAttrValue* aOldValue)
|
||||
{
|
||||
nsIDocument* doc = aElement->OwnerDoc();
|
||||
IMPL_MUTATION_NOTIFICATION(AttributeChanged, aElement,
|
||||
|
@ -61,12 +61,16 @@ public:
|
||||
* @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
|
||||
*/
|
||||
static void AttributeChanged(mozilla::dom::Element* aElement,
|
||||
int32_t aNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
int32_t aModType);
|
||||
int32_t aModType,
|
||||
const nsAttrValue* aOldValue);
|
||||
|
||||
/**
|
||||
* Send AttributeSetToCurrentValue notifications to nsIMutationObservers.
|
||||
* @param aElement Element whose data changed
|
||||
|
Loading…
Reference in New Issue
Block a user