Making XML, MathML, SVG, and HTML elements support passing attribute changes into XBL bindings.

This commit is contained in:
hyatt%netscape.com 2000-05-10 02:15:47 +00:00
parent e7d80eb3ca
commit d83baf3529
2 changed files with 44 additions and 12 deletions

View File

@ -2254,11 +2254,18 @@ nsGenericContainerElement::SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName,
}
}
if (aNotify && (nsnull != mDocument)) {
if (NS_SUCCEEDED(rv)) {
if (mDocument && NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIBindingManager> bindingManager;
mDocument->GetBindingManager(getter_AddRefs(bindingManager));
nsCOMPtr<nsIXBLBinding> binding;
bindingManager->GetBinding(mContent, getter_AddRefs(binding));
if (binding)
binding->AttributeChanged(aName, aNameSpaceID, PR_FALSE);
if (aNotify) {
mDocument->AttributeChanged(mContent, aNameSpaceID, aName, NS_STYLE_HINT_UNKNOWN);
mDocument->EndUpdate();
}
mDocument->EndUpdate();
}
return rv;
@ -2334,9 +2341,18 @@ nsGenericContainerElement::UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName,
}
}
if (NS_SUCCEEDED(rv) && found && aNotify && (nsnull != mDocument)) {
mDocument->AttributeChanged(mContent, aNameSpaceID, aName, NS_STYLE_HINT_UNKNOWN);
mDocument->EndUpdate();
if (NS_SUCCEEDED(rv) && found && mDocument) {
nsCOMPtr<nsIBindingManager> bindingManager;
mDocument->GetBindingManager(getter_AddRefs(bindingManager));
nsCOMPtr<nsIXBLBinding> binding;
bindingManager->GetBinding(mContent, getter_AddRefs(binding));
if (binding)
binding->AttributeChanged(aName, aNameSpaceID, PR_TRUE);
if (aNotify) {
mDocument->AttributeChanged(mContent, aNameSpaceID, aName, NS_STYLE_HINT_UNKNOWN);
mDocument->EndUpdate();
}
}
}

View File

@ -2254,11 +2254,18 @@ nsGenericContainerElement::SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName,
}
}
if (aNotify && (nsnull != mDocument)) {
if (NS_SUCCEEDED(rv)) {
if (mDocument && NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIBindingManager> bindingManager;
mDocument->GetBindingManager(getter_AddRefs(bindingManager));
nsCOMPtr<nsIXBLBinding> binding;
bindingManager->GetBinding(mContent, getter_AddRefs(binding));
if (binding)
binding->AttributeChanged(aName, aNameSpaceID, PR_FALSE);
if (aNotify) {
mDocument->AttributeChanged(mContent, aNameSpaceID, aName, NS_STYLE_HINT_UNKNOWN);
mDocument->EndUpdate();
}
mDocument->EndUpdate();
}
return rv;
@ -2334,9 +2341,18 @@ nsGenericContainerElement::UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName,
}
}
if (NS_SUCCEEDED(rv) && found && aNotify && (nsnull != mDocument)) {
mDocument->AttributeChanged(mContent, aNameSpaceID, aName, NS_STYLE_HINT_UNKNOWN);
mDocument->EndUpdate();
if (NS_SUCCEEDED(rv) && found && mDocument) {
nsCOMPtr<nsIBindingManager> bindingManager;
mDocument->GetBindingManager(getter_AddRefs(bindingManager));
nsCOMPtr<nsIXBLBinding> binding;
bindingManager->GetBinding(mContent, getter_AddRefs(binding));
if (binding)
binding->AttributeChanged(aName, aNameSpaceID, PR_TRUE);
if (aNotify) {
mDocument->AttributeChanged(mContent, aNameSpaceID, aName, NS_STYLE_HINT_UNKNOWN);
mDocument->EndUpdate();
}
}
}