зеркало из https://github.com/mozilla/pjs.git
Notify before firing mutation events. Bug 387460, r+sr=sicking
This commit is contained in:
Родитель
9bba06ca93
Коммит
15dfe80590
|
@ -3626,6 +3626,10 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
|
|||
}
|
||||
}
|
||||
|
||||
if (aNotify) {
|
||||
nsNodeUtils::AttributeChanged(this, aNamespaceID, aName, modType);
|
||||
}
|
||||
|
||||
if (aFireMutation) {
|
||||
nsMutationEvent mutation(PR_TRUE, NS_MUTATION_ATTRMODIFIED);
|
||||
|
||||
|
@ -3651,10 +3655,6 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
|
|||
nsEventDispatcher::Dispatch(this, nsnull, &mutation);
|
||||
}
|
||||
|
||||
if (aNotify) {
|
||||
nsNodeUtils::AttributeChanged(this, aNamespaceID, aName, modType);
|
||||
}
|
||||
|
||||
if (aNamespaceID == kNameSpaceID_XMLEvents &&
|
||||
aName == nsGkAtoms::event && mNodeInfo->GetDocument()) {
|
||||
mNodeInfo->GetDocument()->AddXMLEventsContent(this);
|
||||
|
|
|
@ -1297,6 +1297,18 @@ nsXULElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNotify)
|
|||
}
|
||||
}
|
||||
|
||||
if (doc) {
|
||||
nsXBLBinding *binding = doc->BindingManager()->GetBinding(this);
|
||||
if (binding)
|
||||
binding->AttributeChanged(aName, aNameSpaceID, PR_TRUE, aNotify);
|
||||
|
||||
}
|
||||
|
||||
if (aNotify) {
|
||||
nsNodeUtils::AttributeChanged(this, aNameSpaceID, aName,
|
||||
nsIDOMMutationEvent::REMOVAL);
|
||||
}
|
||||
|
||||
if (hasMutationListeners) {
|
||||
nsMutationEvent mutation(PR_TRUE, NS_MUTATION_ATTRMODIFIED);
|
||||
|
||||
|
@ -1312,18 +1324,6 @@ nsXULElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNotify)
|
|||
nsnull, &mutation);
|
||||
}
|
||||
|
||||
if (doc) {
|
||||
nsXBLBinding *binding = doc->BindingManager()->GetBinding(this);
|
||||
if (binding)
|
||||
binding->AttributeChanged(aName, aNameSpaceID, PR_TRUE, aNotify);
|
||||
|
||||
}
|
||||
|
||||
if (aNotify) {
|
||||
nsNodeUtils::AttributeChanged(this, aNameSpaceID, aName,
|
||||
nsIDOMMutationEvent::REMOVAL);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче