From db74d9de15293fbcdd07af6db07518066cb52ff8 Mon Sep 17 00:00:00 2001 From: "jonas%sicking.cc" Date: Tue, 4 Mar 2008 01:25:06 +0000 Subject: [PATCH] Bug 383818: Cloned menu items don't display correctly. r/sr=jst git-svn-id: svn://10.0.0.236/trunk@246965 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsGenericElement.cpp | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/mozilla/content/base/src/nsGenericElement.cpp b/mozilla/content/base/src/nsGenericElement.cpp index 3152b738c4c..c4d24f42914 100644 --- a/mozilla/content/base/src/nsGenericElement.cpp +++ b/mozilla/content/base/src/nsGenericElement.cpp @@ -3748,11 +3748,14 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID, } NS_ENSURE_SUCCESS(rv, rv); - if (document) { - nsRefPtr binding = - document->BindingManager()->GetBinding(this); - if (binding) { - binding->AttributeChanged(aName, aNamespaceID, PR_FALSE, aNotify); + if (document || HasFlag(NODE_FORCE_XBL_BINDINGS)) { + nsIDocument* ownerDoc = GetOwnerDoc(); + if (ownerDoc) { + nsRefPtr binding = + ownerDoc->BindingManager()->GetBinding(this); + if (binding) { + binding->AttributeChanged(aName, aNamespaceID, PR_FALSE, aNotify); + } } } @@ -3998,11 +4001,15 @@ nsGenericElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, rv = mAttrsAndChildren.RemoveAttrAt(index, oldValue); NS_ENSURE_SUCCESS(rv, rv); - if (document) { - nsRefPtr binding = - document->BindingManager()->GetBinding(this); - if (binding) - binding->AttributeChanged(aName, aNameSpaceID, PR_TRUE, aNotify); + if (document || HasFlag(NODE_FORCE_XBL_BINDINGS)) { + nsIDocument* ownerDoc = GetOwnerDoc(); + if (ownerDoc) { + nsRefPtr binding = + ownerDoc->BindingManager()->GetBinding(this); + if (binding) { + binding->AttributeChanged(aName, aNameSpaceID, PR_TRUE, aNotify); + } + } } if (aNotify) {