mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-07 15:12:28 +00:00
Stubbing out some more XBL functions for future implementation.
This commit is contained in:
parent
464dcb3188
commit
3aeb5cb791
@ -52,6 +52,9 @@ public:
|
||||
|
||||
NS_IMETHOD GetBindingElement(nsIContent** aResult) = 0;
|
||||
NS_IMETHOD SetBindingElement(nsIContent* aElement) = 0;
|
||||
|
||||
NS_IMETHOD GenerateAnonymousContent(nsIContent* aBoundElement) = 0;
|
||||
NS_IMETHOD InstallEventHandlers(nsIContent* aBoundElement) = 0;
|
||||
};
|
||||
|
||||
extern nsresult
|
||||
|
@ -36,6 +36,9 @@ class nsXBLBinding: public nsIXBLBinding
|
||||
NS_IMETHOD GetBindingElement(nsIContent** aResult);
|
||||
NS_IMETHOD SetBindingElement(nsIContent* aElement);
|
||||
|
||||
NS_IMETHOD GenerateAnonymousContent(nsIContent* aBoundElement);
|
||||
NS_IMETHOD InstallEventHandlers(nsIContent* aBoundElement);
|
||||
|
||||
public:
|
||||
nsXBLBinding();
|
||||
virtual ~nsXBLBinding();
|
||||
@ -110,6 +113,19 @@ nsXBLBinding::SetBindingElement(nsIContent* aElement)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXBLBinding::GenerateAnonymousContent(nsIContent* aBoundElement)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXBLBinding::InstallEventHandlers(nsIContent* aBoundElement)
|
||||
{
|
||||
// XXX Implement me!
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Creation Routine ///////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsresult
|
||||
|
@ -218,18 +218,28 @@ nsXBLService::LoadBindings(nsIContent* aContent, const nsString& aURL)
|
||||
if (!bindableContent)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCAutoString url = aURL;
|
||||
nsCOMPtr<nsIXBLBinding> binding;
|
||||
bindableContent->GetBinding(getter_AddRefs(binding));
|
||||
if (binding)
|
||||
return NS_OK; // The bindings are already loaded.
|
||||
// XXX Think about how to flush them when styles cause a dynamic change
|
||||
|
||||
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.
|
||||
// When installed, the bound content will clone the
|
||||
// anonymous content and place it into the binding.
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -52,6 +52,9 @@ public:
|
||||
|
||||
NS_IMETHOD GetBindingElement(nsIContent** aResult) = 0;
|
||||
NS_IMETHOD SetBindingElement(nsIContent* aElement) = 0;
|
||||
|
||||
NS_IMETHOD GenerateAnonymousContent(nsIContent* aBoundElement) = 0;
|
||||
NS_IMETHOD InstallEventHandlers(nsIContent* aBoundElement) = 0;
|
||||
};
|
||||
|
||||
extern nsresult
|
||||
|
@ -36,6 +36,9 @@ class nsXBLBinding: public nsIXBLBinding
|
||||
NS_IMETHOD GetBindingElement(nsIContent** aResult);
|
||||
NS_IMETHOD SetBindingElement(nsIContent* aElement);
|
||||
|
||||
NS_IMETHOD GenerateAnonymousContent(nsIContent* aBoundElement);
|
||||
NS_IMETHOD InstallEventHandlers(nsIContent* aBoundElement);
|
||||
|
||||
public:
|
||||
nsXBLBinding();
|
||||
virtual ~nsXBLBinding();
|
||||
@ -110,6 +113,19 @@ nsXBLBinding::SetBindingElement(nsIContent* aElement)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXBLBinding::GenerateAnonymousContent(nsIContent* aBoundElement)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXBLBinding::InstallEventHandlers(nsIContent* aBoundElement)
|
||||
{
|
||||
// XXX Implement me!
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Creation Routine ///////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsresult
|
||||
|
@ -218,18 +218,28 @@ nsXBLService::LoadBindings(nsIContent* aContent, const nsString& aURL)
|
||||
if (!bindableContent)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCAutoString url = aURL;
|
||||
nsCOMPtr<nsIXBLBinding> binding;
|
||||
bindableContent->GetBinding(getter_AddRefs(binding));
|
||||
if (binding)
|
||||
return NS_OK; // The bindings are already loaded.
|
||||
// XXX Think about how to flush them when styles cause a dynamic change
|
||||
|
||||
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.
|
||||
// When installed, the bound content will clone the
|
||||
// anonymous content and place it into the binding.
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user