зеркало из https://github.com/mozilla/gecko-dev.git
Bug 464009, patch2, r+sr=sicking
This commit is contained in:
Родитель
e53d662757
Коммит
cb15ff06b9
|
@ -4255,11 +4255,9 @@ nsGenericElement::SetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
|||
attrValue.SetTo(aValue);
|
||||
}
|
||||
|
||||
rv = SetAttrAndNotify(aNamespaceID, aName, aPrefix, oldValue,
|
||||
attrValue, modification, hasListeners, aNotify);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return AfterSetAttr(aNamespaceID, aName, &aValue, aNotify);
|
||||
return SetAttrAndNotify(aNamespaceID, aName, aPrefix, oldValue,
|
||||
attrValue, modification, hasListeners, aNotify,
|
||||
&aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -4270,7 +4268,8 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
|
|||
nsAttrValue& aParsedValue,
|
||||
PRBool aModification,
|
||||
PRBool aFireMutation,
|
||||
PRBool aNotify)
|
||||
PRBool aNotify,
|
||||
const nsAString* aValueForAfterSetAttr)
|
||||
{
|
||||
nsresult rv;
|
||||
PRUint8 modType = aModification ?
|
||||
|
@ -4329,7 +4328,16 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
|
|||
nsNodeUtils::AttributeChanged(this, aNamespaceID, aName, modType,
|
||||
stateMask);
|
||||
}
|
||||
|
||||
|
||||
if (aNamespaceID == kNameSpaceID_XMLEvents &&
|
||||
aName == nsGkAtoms::event && mNodeInfo->GetDocument()) {
|
||||
mNodeInfo->GetDocument()->AddXMLEventsContent(this);
|
||||
}
|
||||
if (aValueForAfterSetAttr) {
|
||||
rv = AfterSetAttr(aNamespaceID, aName, aValueForAfterSetAttr, aNotify);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
if (aFireMutation) {
|
||||
mozAutoRemovableBlockerRemover blockerRemover;
|
||||
|
||||
|
@ -4358,11 +4366,6 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
|
|||
nsEventDispatcher::Dispatch(this, nsnull, &mutation);
|
||||
}
|
||||
|
||||
if (aNamespaceID == kNameSpaceID_XMLEvents &&
|
||||
aName == nsGkAtoms::event && mNodeInfo->GetDocument()) {
|
||||
mNodeInfo->GetDocument()->AddXMLEventsContent(this);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -4587,6 +4590,9 @@ nsGenericElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
|||
stateMask);
|
||||
}
|
||||
|
||||
rv = AfterSetAttr(aNameSpaceID, aName, nsnull, aNotify);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (hasMutationListeners) {
|
||||
mozAutoRemovableBlockerRemover blockerRemover;
|
||||
|
||||
|
@ -4607,7 +4613,7 @@ nsGenericElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
|||
nsEventDispatcher::Dispatch(this, nsnull, &mutation);
|
||||
}
|
||||
|
||||
return AfterSetAttr(aNameSpaceID, aName, nsnull, aNotify);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
const nsAttrName*
|
||||
|
|
|
@ -771,6 +771,8 @@ protected:
|
|||
* needed if aFireMutation or aNotify is true.
|
||||
* @param aFireMutation should mutation-events be fired?
|
||||
* @param aNotify should we notify document-observers?
|
||||
* @param aValueForAfterSetAttr If not null, AfterSetAttr will be called
|
||||
* with the value pointed by this parameter.
|
||||
*/
|
||||
nsresult SetAttrAndNotify(PRInt32 aNamespaceID,
|
||||
nsIAtom* aName,
|
||||
|
@ -779,7 +781,8 @@ protected:
|
|||
nsAttrValue& aParsedValue,
|
||||
PRBool aModification,
|
||||
PRBool aFireMutation,
|
||||
PRBool aNotify);
|
||||
PRBool aNotify,
|
||||
const nsAString* aValueForAfterSetAttr);
|
||||
|
||||
/**
|
||||
* Convert an attribute string value to attribute type based on the type of
|
||||
|
|
|
@ -133,7 +133,7 @@ nsStyledElement::SetInlineStyleRule(nsICSSStyleRule* aStyleRule, PRBool aNotify)
|
|||
|
||||
return SetAttrAndNotify(kNameSpaceID_None, nsGkAtoms::style, nsnull,
|
||||
oldValueStr, attrValue, modification, hasListeners,
|
||||
aNotify);
|
||||
aNotify, nsnull);
|
||||
}
|
||||
|
||||
nsICSSStyleRule*
|
||||
|
|
|
@ -994,7 +994,7 @@ nsSVGElement::DidModifySVGObservable(nsISVGValue* aObservable,
|
|||
|
||||
return SetAttrAndNotify(attrName->NamespaceID(), attrName->LocalName(),
|
||||
attrName->GetPrefix(), EmptyString(), newValue,
|
||||
modification, hasListeners, PR_TRUE);
|
||||
modification, hasListeners, PR_TRUE, nsnull);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -1749,7 +1749,7 @@ nsXULElement::SetInlineStyleRule(nsICSSStyleRule* aStyleRule, PRBool aNotify)
|
|||
nsAttrValue attrValue(aStyleRule);
|
||||
|
||||
return SetAttrAndNotify(kNameSpaceID_None, nsGkAtoms::style, nsnull, oldValueStr,
|
||||
attrValue, modification, hasListeners, aNotify);
|
||||
attrValue, modification, hasListeners, aNotify, nsnull);
|
||||
}
|
||||
|
||||
nsChangeHint
|
||||
|
|
Загрузка…
Ссылка в новой задаче