bindableContent->GetBinding(getter_AddRefs(binding)); if (binding) bindableContent->SetBinding(nsnull);
bindingManager->GetBinding(aContent, getter_AddRefs(binding)); if (binding && !aAugmentFlag) { nsCOMPtr<nsIXBLBinding> styleBinding; binding->GetFirstStyleBinding(getter_AddRefs(styleBinding)); if (styleBinding) { PRBool marked = PR_FALSE; binding->MarkedForDeath(&marked); if (marked) { FlushStyleBindings(aContent); binding = nsnull; } else {  nsIURI* uri = styleBinding->BindingURI(); PRBool equal; if (NS_SUCCEEDED(uri->Equals(aURL, &equal)) && equal) return NS_OK; FlushStyleBindings(aContent); binding = nsnull; } } }
nsXBLService::LoadBindings(nsIContent* aContent, const nsString& aURL) {   nsresult rv;  nsCOMPtr<nsIBindableContent> bindableContent = do_QueryInterface(aContent);  if (!bindableContent)    return NS_ERROR_FAILURE;  nsCOMPtr<nsIXBLBinding> binding;  bindableContent->GetBinding(getter_AddRefs(binding));  if (binding)    bindableContent->SetBinding(nsnull); // Flush old bindings  nsCAutoString url = aURL;  if (NS_FAILED(rv = GetBinding(url, getter_AddRefs(binding)))) {    NS_ERROR("Failed loading an XBL document for content node.");    return rv;  }  // Install the binding on the content node.  bindableContent->SetBinding(binding);  // Tell the binding to build the anonymous content.  binding->GenerateAnonymousContent(aContent);  // Tell the binding to install event handlers  binding->InstallEventHandlers(aContent);  // XXX Methods and properties. How?  return NS_OK; }