зеркало из https://github.com/mozilla/pjs.git
Guarantee that a document's binding manager is non-null. Bug 282792, r+sr=bzbarsky.
This commit is contained in:
Родитель
b760d9c89b
Коммит
e6dfc671b2
|
@ -60,7 +60,7 @@ nsAccessibleTreeWalker::nsAccessibleTreeWalker(nsIWeakReference* aPresShell, nsI
|
|||
if (aWalkAnonContent) {
|
||||
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
|
||||
if (presShell)
|
||||
mBindingManager = presShell->GetDocument()->GetBindingManager();
|
||||
mBindingManager = presShell->GetDocument()->BindingManager();
|
||||
}
|
||||
MOZ_COUNT_CTOR(nsAccessibleTreeWalker);
|
||||
}
|
||||
|
|
|
@ -1193,7 +1193,7 @@ static void FlushSkinBindingsForWindow(nsIDOMWindowInternal* aWindow)
|
|||
return;
|
||||
|
||||
// Annihilate all XBL bindings.
|
||||
document->GetBindingManager()->FlushSkinBindings();
|
||||
document->BindingManager()->FlushSkinBindings();
|
||||
}
|
||||
|
||||
// XXXbsmedberg: move this to nsIWindowMediator
|
||||
|
|
|
@ -177,10 +177,6 @@
|
|||
#define NS_XBLSERVICE_CID \
|
||||
{ 0x64f300a1, 0xc88c, 0x11d3, { 0x97, 0xfb, 0x0, 0x40, 0x5, 0x53, 0xee, 0xf0 } }
|
||||
|
||||
// {15671AF5-39F9-4c70-8CE3-72C97111B52D}
|
||||
#define NS_BINDINGMANAGER_CID \
|
||||
{ 0x15671af5, 0x39f9, 0x4c70, { 0x8c, 0xe3, 0x72, 0xc9, 0x71, 0x11, 0xb5, 0x2d } }
|
||||
|
||||
// 3a9cd622-264d-11d4-ba06-0060b0fc76dd
|
||||
#define NS_DOM_IMPLEMENTATION_CID \
|
||||
{ 0x3a9cd622, 0x264d, 0x11d4, {0xba, 0x06, 0x00, 0x60, 0xb0, 0xfc, 0x76, 0xdd } }
|
||||
|
|
|
@ -526,7 +526,7 @@ public:
|
|||
return mNextContentID++;
|
||||
}
|
||||
|
||||
nsIBindingManager* GetBindingManager() const
|
||||
nsIBindingManager* BindingManager() const
|
||||
{
|
||||
return mBindingManager;
|
||||
}
|
||||
|
|
|
@ -142,6 +142,7 @@ INCLUDES += \
|
|||
-I$(srcdir)/../../xul/content/src \
|
||||
-I$(srcdir)/../../html/content/src \
|
||||
-I$(srcdir)/../../base/src \
|
||||
-I$(srcdir)/../../xbl/src \
|
||||
-I$(srcdir)/../../../layout/generic \
|
||||
-I$(srcdir)/../../../layout/style \
|
||||
-I$(srcdir)/../../../dom/src/base \
|
||||
|
|
|
@ -122,6 +122,7 @@ static NS_DEFINE_CID(kDOMEventGroupCID, NS_DOMEVENTGROUP_CID);
|
|||
#include "nsContentCreatorFunctions.h"
|
||||
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsBindingManager.h"
|
||||
|
||||
#include "nsICharsetAlias.h"
|
||||
static NS_DEFINE_CID(kCharsetAliasCID, NS_CHARSETALIAS_CID);
|
||||
|
@ -508,24 +509,6 @@ NS_IMPL_RELEASE_USING_AGGREGATOR(nsXPathDocumentTearoff, mDocument)
|
|||
// NOTE! nsDocument::operator new() zeroes out all members, so don't
|
||||
// bother initializing members to 0.
|
||||
|
||||
nsDocument::nsDocument()
|
||||
{
|
||||
|
||||
// NOTE! nsIDocument::operator new() zeroes out all members, so don't
|
||||
// bother initializing members to 0.
|
||||
|
||||
// Force initialization.
|
||||
mBindingManager = do_CreateInstance("@mozilla.org/xbl/binding-manager;1");
|
||||
|
||||
nsCOMPtr<nsIDocumentObserver> observer(do_QueryInterface(mBindingManager));
|
||||
if (observer) {
|
||||
// The binding manager must always be the first observer of the
|
||||
// document.
|
||||
|
||||
mObservers.InsertElementAt(observer, 0);
|
||||
}
|
||||
}
|
||||
|
||||
nsDocument::~nsDocument()
|
||||
{
|
||||
mInDestructor = PR_TRUE;
|
||||
|
@ -678,6 +661,15 @@ NS_IMPL_RELEASE(nsDocument)
|
|||
nsresult
|
||||
nsDocument::Init()
|
||||
{
|
||||
// Force initialization.
|
||||
nsBindingManager *bindingManager = new nsBindingManager();
|
||||
NS_ENSURE_TRUE(bindingManager, NS_ERROR_OUT_OF_MEMORY);
|
||||
mBindingManager = bindingManager;
|
||||
|
||||
// The binding manager must always be the first observer of the document.
|
||||
// (static cast to the correct interface pointer)
|
||||
mObservers.InsertElementAt(NS_STATIC_CAST(nsIDocumentObserver*, bindingManager), 0);
|
||||
|
||||
if (mNodeInfoManager) {
|
||||
return NS_ERROR_ALREADY_INITIALIZED;
|
||||
}
|
||||
|
@ -2619,27 +2611,20 @@ nsDocument::RemoveBinding(nsIDOMElement* aContent, const nsAString& aURI)
|
|||
return rv;
|
||||
}
|
||||
|
||||
if (mBindingManager) {
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(aContent));
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
rv = NS_NewURI(getter_AddRefs(uri), aURI);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
return mBindingManager->RemoveLayeredBinding(content, uri);
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
rv = NS_NewURI(getter_AddRefs(uri), aURI);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(aContent));
|
||||
return mBindingManager->RemoveLayeredBinding(content, uri);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::LoadBindingDocument(const nsAString& aURI,
|
||||
nsIDOMDocument** aResult)
|
||||
{
|
||||
if (!mBindingManager) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult rv = NS_NewURI(getter_AddRefs(uri), aURI,
|
||||
mCharacterSet.get(),
|
||||
|
@ -2739,9 +2724,6 @@ nsDocument::GetAnonymousNodes(nsIDOMElement* aElement,
|
|||
nsIDOMNodeList** aResult)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
if (!mBindingManager) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(aElement));
|
||||
return mBindingManager->GetAnonymousNodesFor(content, aResult);
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
#include "nsIHTMLCSSStyleSheet.h"
|
||||
|
||||
#include "nsStyleSet.h"
|
||||
|
||||
#include "nsXMLEventsManager.h"
|
||||
#include "pldhash.h"
|
||||
|
||||
|
||||
|
@ -102,7 +102,6 @@ class nsIDTD;
|
|||
class nsXPathDocumentTearoff;
|
||||
class nsIRadioVisitor;
|
||||
class nsIFormControl;
|
||||
class nsXMLEventsManager;
|
||||
struct nsRadioGroupStruct;
|
||||
|
||||
|
||||
|
@ -548,7 +547,7 @@ protected:
|
|||
return kNameSpaceID_None;
|
||||
};
|
||||
|
||||
nsDocument();
|
||||
nsDocument() : nsIDocument() {}
|
||||
virtual ~nsDocument();
|
||||
|
||||
nsCString mReferrer;
|
||||
|
|
|
@ -1784,11 +1784,7 @@ nsGenericElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
|
|||
if (document && aDeep) {
|
||||
// Notify XBL- & nsIAnonymousContentCreator-generated
|
||||
// anonymous content that the document is changing.
|
||||
nsIBindingManager* bindingManager = document->GetBindingManager();
|
||||
NS_ASSERTION(bindingManager, "No binding manager.");
|
||||
if (bindingManager) {
|
||||
bindingManager->ChangeDocumentFor(this, document, aDocument);
|
||||
}
|
||||
document->BindingManager()->ChangeDocumentFor(this, document, aDocument);
|
||||
|
||||
nsCOMPtr<nsIDOMElement> domElement;
|
||||
QueryInterface(NS_GET_IID(nsIDOMElement), getter_AddRefs(domElement));
|
||||
|
@ -1930,16 +1926,12 @@ nsGenericElement::HandleDOMEvent(nsPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
// determine the parent:
|
||||
// check for an anonymous parent
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
nsIBindingManager* bindingManager = nsnull;
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
if (ownerDoc) {
|
||||
bindingManager = ownerDoc->GetBindingManager();
|
||||
}
|
||||
if (bindingManager) {
|
||||
// we have a binding manager -- do we have an anonymous parent?
|
||||
bindingManager->GetInsertionParent(this, getter_AddRefs(parent));
|
||||
ownerDoc->BindingManager()->GetInsertionParent(this,
|
||||
getter_AddRefs(parent));
|
||||
}
|
||||
if (!parent) {
|
||||
// if we didn't find an anonymous parent, use the explicit one,
|
||||
|
@ -3184,9 +3176,8 @@ nsGenericElement::PostQueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
{
|
||||
nsIDocument *document = GetOwnerDoc();
|
||||
if (document) {
|
||||
nsIBindingManager* manager = document->GetBindingManager();
|
||||
if (manager)
|
||||
return manager->GetBindingImplementation(this, aIID, aInstancePtr);
|
||||
return document->BindingManager()->GetBindingImplementation(this, aIID,
|
||||
aInstancePtr);
|
||||
}
|
||||
|
||||
return NS_NOINTERFACE;
|
||||
|
@ -3439,7 +3430,7 @@ nsGenericElement::SetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
|||
|
||||
if (document) {
|
||||
nsCOMPtr<nsIXBLBinding> binding;
|
||||
document->GetBindingManager()->GetBinding(this, getter_AddRefs(binding));
|
||||
document->BindingManager()->GetBinding(this, getter_AddRefs(binding));
|
||||
if (binding)
|
||||
binding->AttributeChanged(aName, aNamespaceID, PR_FALSE, aNotify);
|
||||
|
||||
|
@ -3571,7 +3562,7 @@ nsGenericElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
|||
|
||||
if (document) {
|
||||
nsCOMPtr<nsIXBLBinding> binding;
|
||||
document->GetBindingManager()->GetBinding(this, getter_AddRefs(binding));
|
||||
document->BindingManager()->GetBinding(this, getter_AddRefs(binding));
|
||||
if (binding)
|
||||
binding->AttributeChanged(aName, aNameSpaceID, PR_TRUE, aNotify);
|
||||
|
||||
|
@ -3657,58 +3648,56 @@ nsGenericElement::List(FILE* out, PRInt32 aIndent) const
|
|||
|
||||
nsIDocument *document = GetOwnerDoc();
|
||||
if (document) {
|
||||
nsIBindingManager* bindingManager = document->GetBindingManager();
|
||||
if (bindingManager) {
|
||||
nsCOMPtr<nsIDOMNodeList> anonymousChildren;
|
||||
bindingManager->GetAnonymousNodesFor(NS_CONST_CAST(nsGenericElement*, this),
|
||||
getter_AddRefs(anonymousChildren));
|
||||
nsIBindingManager* bindingManager = document->BindingManager();
|
||||
nsCOMPtr<nsIDOMNodeList> anonymousChildren;
|
||||
bindingManager->GetAnonymousNodesFor(NS_CONST_CAST(nsGenericElement*, this),
|
||||
getter_AddRefs(anonymousChildren));
|
||||
|
||||
if (anonymousChildren) {
|
||||
PRUint32 length;
|
||||
anonymousChildren->GetLength(&length);
|
||||
if (length) {
|
||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||
fputs("anonymous-children<\n", out);
|
||||
if (anonymousChildren) {
|
||||
PRUint32 length;
|
||||
anonymousChildren->GetLength(&length);
|
||||
if (length) {
|
||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||
fputs("anonymous-children<\n", out);
|
||||
|
||||
for (PRUint32 i = 0; i < length; ++i) {
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
anonymousChildren->Item(i, getter_AddRefs(node));
|
||||
nsCOMPtr<nsIContent> child = do_QueryInterface(node);
|
||||
child->List(out, aIndent + 1);
|
||||
}
|
||||
|
||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||
fputs(">\n", out);
|
||||
for (PRUint32 i = 0; i < length; ++i) {
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
anonymousChildren->Item(i, getter_AddRefs(node));
|
||||
nsCOMPtr<nsIContent> child = do_QueryInterface(node);
|
||||
child->List(out, aIndent + 1);
|
||||
}
|
||||
|
||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||
fputs(">\n", out);
|
||||
}
|
||||
}
|
||||
|
||||
PRBool hasContentList;
|
||||
bindingManager->HasContentListFor(NS_CONST_CAST(nsGenericElement*, this),
|
||||
&hasContentList);
|
||||
PRBool hasContentList;
|
||||
bindingManager->HasContentListFor(NS_CONST_CAST(nsGenericElement*, this),
|
||||
&hasContentList);
|
||||
|
||||
if (hasContentList) {
|
||||
nsCOMPtr<nsIDOMNodeList> contentList;
|
||||
bindingManager->GetContentListFor(NS_CONST_CAST(nsGenericElement*, this),
|
||||
getter_AddRefs(contentList));
|
||||
if (hasContentList) {
|
||||
nsCOMPtr<nsIDOMNodeList> contentList;
|
||||
bindingManager->GetContentListFor(NS_CONST_CAST(nsGenericElement*, this),
|
||||
getter_AddRefs(contentList));
|
||||
|
||||
NS_ASSERTION(contentList != nsnull, "oops, binding manager lied");
|
||||
NS_ASSERTION(contentList != nsnull, "oops, binding manager lied");
|
||||
|
||||
PRUint32 length;
|
||||
contentList->GetLength(&length);
|
||||
if (length) {
|
||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||
fputs("content-list<\n", out);
|
||||
PRUint32 length;
|
||||
contentList->GetLength(&length);
|
||||
if (length) {
|
||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||
fputs("content-list<\n", out);
|
||||
|
||||
for (PRUint32 i = 0; i < length; ++i) {
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
contentList->Item(i, getter_AddRefs(node));
|
||||
nsCOMPtr<nsIContent> child = do_QueryInterface(node);
|
||||
child->List(out, aIndent + 1);
|
||||
}
|
||||
|
||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||
fputs(">\n", out);
|
||||
for (PRUint32 i = 0; i < length; ++i) {
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
contentList->Item(i, getter_AddRefs(node));
|
||||
nsCOMPtr<nsIContent> child = do_QueryInterface(node);
|
||||
child->List(out, aIndent + 1);
|
||||
}
|
||||
|
||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||
fputs(">\n", out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1748,7 +1748,7 @@ nsGenericHTMLElement::SetAttrAndNotify(PRInt32 aNamespaceID,
|
|||
|
||||
if (document) {
|
||||
nsCOMPtr<nsIXBLBinding> binding;
|
||||
document->GetBindingManager()->GetBinding(this, getter_AddRefs(binding));
|
||||
document->BindingManager()->GetBinding(this, getter_AddRefs(binding));
|
||||
if (binding) {
|
||||
binding->AttributeChanged(aAttribute, aNamespaceID, PR_FALSE, aNotify);
|
||||
}
|
||||
|
|
|
@ -99,6 +99,7 @@ include $(topsrcdir)/config/rules.mk
|
|||
|
||||
INCLUDES += \
|
||||
-I$(srcdir)/../../../base/src \
|
||||
-I$(srcdir)/../../../events/src \
|
||||
-I$(srcdir)/../../content/src \
|
||||
-I$(srcdir)/../../../../layout/style \
|
||||
-I$(srcdir)/../../../../dom/src/base \
|
||||
|
|
|
@ -464,7 +464,7 @@ nsSVGElement::GetOwnerSVGElement(nsIDOMSVGSVGElement * *aOwnerSVGElement)
|
|||
// is our owner doc.
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
if (ownerDoc) {
|
||||
bindingManager = ownerDoc->GetBindingManager();
|
||||
bindingManager = ownerDoc->BindingManager();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
|
@ -656,7 +656,7 @@ nsSVGElement::SetAttrAndNotify(PRInt32 aNamespaceID, nsIAtom* aAttribute,
|
|||
|
||||
if (document) {
|
||||
nsCOMPtr<nsIXBLBinding> binding;
|
||||
document->GetBindingManager()->GetBinding(this, getter_AddRefs(binding));
|
||||
document->BindingManager()->GetBinding(this, getter_AddRefs(binding));
|
||||
if (binding) {
|
||||
binding->AttributeChanged(aAttribute, aNamespaceID, PR_FALSE, aNotify);
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ NS_IMETHODIMP nsSVGGraphicElement::GetCTM(nsIDOMSVGMatrix **_retval)
|
|||
// is our owner doc.
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
if (ownerDoc) {
|
||||
bindingManager = ownerDoc->GetBindingManager();
|
||||
bindingManager = ownerDoc->BindingManager();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
|
@ -233,7 +233,7 @@ NS_IMETHODIMP nsSVGGraphicElement::GetScreenCTM(nsIDOMSVGMatrix **_retval)
|
|||
// is our owner doc.
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
if (ownerDoc) {
|
||||
bindingManager = ownerDoc->GetBindingManager();
|
||||
bindingManager = ownerDoc->BindingManager();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
|
|
|
@ -988,7 +988,7 @@ nsSVGSVGElement::GetCTM(nsIDOMSVGMatrix **_retval)
|
|||
// is our owner doc.
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
if (ownerDoc) {
|
||||
bindingManager = ownerDoc->GetBindingManager();
|
||||
bindingManager = ownerDoc->BindingManager();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
|
@ -1066,7 +1066,7 @@ nsSVGSVGElement::GetScreenCTM(nsIDOMSVGMatrix **_retval)
|
|||
// is our owner doc.
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
if (ownerDoc) {
|
||||
bindingManager = ownerDoc->GetBindingManager();
|
||||
bindingManager = ownerDoc->BindingManager();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
|
|
|
@ -79,6 +79,7 @@ INCLUDES += \
|
|||
-I$(srcdir)/../../../html/document/src \
|
||||
-I$(srcdir)/../../../../layout/style \
|
||||
-I$(srcdir)/../../../base/src \
|
||||
-I$(srcdir)/../../../events/src \
|
||||
$(NULL)
|
||||
|
||||
DEFINES += -D_IMPL_NS_LAYOUT
|
||||
|
|
|
@ -110,6 +110,7 @@ LOCAL_INCLUDES = \
|
|||
-I$(srcdir)/../../html/document/src \
|
||||
-I$(srcdir)/../../xml/document/src \
|
||||
-I$(srcdir)/../../xul/content/src \
|
||||
-I$(srcdir)/../../events/src \
|
||||
-I$(srcdir)/../../../layout/style \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -41,10 +41,8 @@
|
|||
#include "nsIXBLService.h"
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsDoubleHashtable.h"
|
||||
#include "nsInterfaceHashtable.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsURIHashKey.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsIParser.h"
|
||||
|
@ -63,8 +61,6 @@
|
|||
#include "nsSupportsArray.h"
|
||||
#include "nsITextContent.h"
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsIStyleRuleSupplier.h"
|
||||
#include "nsStubDocumentObserver.h"
|
||||
|
||||
#include "nsIXBLBinding.h"
|
||||
#include "nsIXBLDocumentInfo.h"
|
||||
|
@ -88,6 +84,7 @@
|
|||
#include "nsIScriptError.h"
|
||||
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsBindingManager.h"
|
||||
|
||||
// ==================================================================
|
||||
// = nsAnonymousContentList
|
||||
|
@ -291,155 +288,6 @@ SetOrRemoveObject(PLDHashTable& table, nsISupports* aKey, nsISupports* aValue)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class nsBindingManager : public nsIBindingManager,
|
||||
public nsIStyleRuleSupplier,
|
||||
public nsStubDocumentObserver
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
public:
|
||||
nsBindingManager();
|
||||
virtual ~nsBindingManager();
|
||||
|
||||
NS_IMETHOD GetBinding(nsIContent* aContent, nsIXBLBinding** aResult);
|
||||
NS_IMETHOD SetBinding(nsIContent* aContent, nsIXBLBinding* aBinding);
|
||||
|
||||
NS_IMETHOD GetInsertionParent(nsIContent* aContent, nsIContent** aResult);
|
||||
NS_IMETHOD SetInsertionParent(nsIContent* aContent, nsIContent* aResult);
|
||||
|
||||
NS_IMETHOD GetWrappedJS(nsIContent* aContent, nsIXPConnectWrappedJS** aResult);
|
||||
NS_IMETHOD SetWrappedJS(nsIContent* aContent, nsIXPConnectWrappedJS* aResult);
|
||||
|
||||
NS_IMETHOD ChangeDocumentFor(nsIContent* aContent, nsIDocument* aOldDocument,
|
||||
nsIDocument* aNewDocument);
|
||||
|
||||
NS_IMETHOD ResolveTag(nsIContent* aContent, PRInt32* aNameSpaceID, nsIAtom** aResult);
|
||||
|
||||
NS_IMETHOD GetContentListFor(nsIContent* aContent, nsIDOMNodeList** aResult);
|
||||
NS_IMETHOD SetContentListFor(nsIContent* aContent, nsVoidArray* aList);
|
||||
NS_IMETHOD HasContentListFor(nsIContent* aContent, PRBool* aResult);
|
||||
|
||||
NS_IMETHOD GetAnonymousNodesFor(nsIContent* aContent, nsIDOMNodeList** aResult);
|
||||
NS_IMETHOD SetAnonymousNodesFor(nsIContent* aContent, nsVoidArray* aList);
|
||||
|
||||
NS_IMETHOD GetXBLChildNodesFor(nsIContent* aContent, nsIDOMNodeList** aResult);
|
||||
|
||||
NS_IMETHOD GetInsertionPoint(nsIContent* aParent, nsIContent* aChild, nsIContent** aResult, PRUint32* aIndex);
|
||||
NS_IMETHOD GetSingleInsertionPoint(nsIContent* aParent, nsIContent** aResult, PRUint32* aIndex,
|
||||
PRBool* aMultipleInsertionPoints);
|
||||
|
||||
NS_IMETHOD AddLayeredBinding(nsIContent* aContent, nsIURI* aURL);
|
||||
NS_IMETHOD RemoveLayeredBinding(nsIContent* aContent, nsIURI* aURL);
|
||||
NS_IMETHOD LoadBindingDocument(nsIDocument* aBoundDoc, nsIURI* aURL,
|
||||
nsIDocument** aResult);
|
||||
|
||||
NS_IMETHOD AddToAttachedQueue(nsIXBLBinding* aBinding);
|
||||
NS_IMETHOD ClearAttachedQueue();
|
||||
NS_IMETHOD ProcessAttachedQueue();
|
||||
|
||||
NS_IMETHOD ExecuteDetachedHandlers();
|
||||
|
||||
NS_IMETHOD PutXBLDocumentInfo(nsIXBLDocumentInfo* aDocumentInfo);
|
||||
NS_IMETHOD GetXBLDocumentInfo(nsIURI* aURI, nsIXBLDocumentInfo** aResult);
|
||||
NS_IMETHOD RemoveXBLDocumentInfo(nsIXBLDocumentInfo* aDocumentInfo);
|
||||
|
||||
NS_IMETHOD PutLoadingDocListener(nsIURI* aURL, nsIStreamListener* aListener);
|
||||
NS_IMETHOD GetLoadingDocListener(nsIURI* aURL, nsIStreamListener** aResult);
|
||||
NS_IMETHOD RemoveLoadingDocListener(nsIURI* aURL);
|
||||
|
||||
NS_IMETHOD InheritsStyle(nsIContent* aContent, PRBool* aResult);
|
||||
NS_IMETHOD FlushSkinBindings();
|
||||
|
||||
NS_IMETHOD GetBindingImplementation(nsIContent* aContent, REFNSIID aIID, void** aResult);
|
||||
|
||||
NS_IMETHOD ShouldBuildChildFrames(nsIContent* aContent, PRBool* aResult);
|
||||
|
||||
// nsIStyleRuleSupplier
|
||||
NS_IMETHOD WalkRules(nsStyleSet* aStyleSet,
|
||||
nsIStyleRuleProcessor::EnumFunc aFunc,
|
||||
RuleProcessorData* aData,
|
||||
PRBool* aCutOffInheritance);
|
||||
|
||||
// nsIDocumentObserver
|
||||
virtual void ContentAppended(nsIDocument* aDocument,
|
||||
nsIContent* aContainer,
|
||||
PRInt32 aNewIndexInContainer);
|
||||
virtual void ContentInserted(nsIDocument* aDocument,
|
||||
nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer);
|
||||
virtual void ContentRemoved(nsIDocument* aDocument,
|
||||
nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer);
|
||||
|
||||
protected:
|
||||
nsresult GetXBLChildNodesInternal(nsIContent* aContent,
|
||||
nsIDOMNodeList** aResult,
|
||||
PRBool* aIsAnonymousContentList);
|
||||
nsresult GetAnonymousNodesInternal(nsIContent* aContent,
|
||||
nsIDOMNodeList** aResult,
|
||||
PRBool* aIsAnonymousContentList);
|
||||
|
||||
nsIContent* GetEnclosingScope(nsIContent* aContent) {
|
||||
return aContent->GetBindingParent();
|
||||
}
|
||||
|
||||
nsresult GetNestedInsertionPoint(nsIContent* aParent, nsIContent* aChild, nsIContent** aResult);
|
||||
|
||||
// MEMBER VARIABLES
|
||||
protected:
|
||||
// A mapping from nsIContent* to the nsIXBLBinding* that is
|
||||
// installed on that element.
|
||||
PLDHashTable mBindingTable;
|
||||
|
||||
// A mapping from nsIContent* to an nsIDOMNodeList*
|
||||
// (nsAnonymousContentList*). This list contains an accurate
|
||||
// reflection of our *explicit* children (once intermingled with
|
||||
// insertion points) in the altered DOM.
|
||||
PLDHashTable mContentListTable;
|
||||
|
||||
// A mapping from nsIContent* to an nsIDOMNodeList*
|
||||
// (nsAnonymousContentList*). This list contains an accurate
|
||||
// reflection of our *anonymous* children (if and only if they are
|
||||
// intermingled with insertion points) in the altered DOM. This
|
||||
// table is not used if no insertion points were defined directly
|
||||
// underneath a <content> tag in a binding. The NodeList from the
|
||||
// <content> is used instead as a performance optimization.
|
||||
PLDHashTable mAnonymousNodesTable;
|
||||
|
||||
// A mapping from nsIContent* to nsIContent*. The insertion parent
|
||||
// is our one true parent in the transformed DOM. This gives us a
|
||||
// more-or-less O(1) way of obtaining our transformed parent.
|
||||
PLDHashTable mInsertionParentTable;
|
||||
|
||||
// A mapping from nsIContent* to nsIXPWrappedJS* (an XPConnect
|
||||
// wrapper for JS objects). For XBL bindings that implement XPIDL
|
||||
// interfaces, and that get referred to from C++, this table caches
|
||||
// the XPConnect wrapper for the binding. By caching it, I control
|
||||
// its lifetime, and I prevent a re-wrap of the same script object
|
||||
// (in the case where multiple bindings in an XBL inheritance chain
|
||||
// both implement an XPIDL interface).
|
||||
PLDHashTable mWrapperTable;
|
||||
|
||||
// A mapping from a URL (a string) to nsIXBLDocumentInfo*. This table
|
||||
// is the cache of all binding documents that have been loaded by a
|
||||
// given bound document.
|
||||
nsInterfaceHashtable<nsURIHashKey,nsIXBLDocumentInfo> mDocumentTable;
|
||||
|
||||
// A mapping from a URL (a string) to a nsIStreamListener. This
|
||||
// table is the currently loading binding docs. If they're in this
|
||||
// table, they have not yet finished loading.
|
||||
nsInterfaceHashtable<nsURIHashKey,nsIStreamListener> mLoadingDocTable;
|
||||
|
||||
// A queue of binding attached event handlers that are awaiting
|
||||
// execution.
|
||||
nsCOMPtr<nsISupportsArray> mAttachedStack;
|
||||
PRBool mProcessingAttachedStack;
|
||||
};
|
||||
|
||||
// Implementation /////////////////////////////////////////////////////////////////
|
||||
|
||||
// Static member variable initialization
|
||||
|
@ -558,7 +406,7 @@ nsBindingManager::ChangeDocumentFor(nsIContent* aContent, nsIDocument* aOldDocum
|
|||
binding->ChangeDocument(aOldDocument, aNewDocument);
|
||||
SetBinding(aContent, nsnull);
|
||||
if (aNewDocument)
|
||||
aNewDocument->GetBindingManager()->SetBinding(aContent, binding);
|
||||
aNewDocument->BindingManager()->SetBinding(aContent, binding);
|
||||
}
|
||||
|
||||
// Clear out insertion parents and content lists.
|
||||
|
@ -1439,17 +1287,3 @@ nsBindingManager::ContentRemoved(nsIDocument* aDocument,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Creation Routine ///////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsresult
|
||||
NS_NewBindingManager(nsIBindingManager** aResult)
|
||||
{
|
||||
*aResult = new nsBindingManager;
|
||||
if (!*aResult)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(*aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,210 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Original Author: David W. Hyatt (hyatt@netscape.com)
|
||||
* Alec Flett <alecf@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef nsBindingManager_h_
|
||||
#define nsBindingManager_h_
|
||||
|
||||
#include "nsIBindingManager.h"
|
||||
#include "nsIStyleRuleSupplier.h"
|
||||
#include "nsStubDocumentObserver.h"
|
||||
#include "pldhash.h"
|
||||
#include "nsInterfaceHashtable.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsURIHashKey.h"
|
||||
|
||||
class nsIContent;
|
||||
class nsIXBLBinding;
|
||||
class nsIXPConnectWrappedJS;
|
||||
class nsIAtom;
|
||||
class nsIDOMNodeList;
|
||||
class nsVoidArray;
|
||||
class nsIDocument;
|
||||
class nsIURI;
|
||||
class nsIXBLDocumentInfo;
|
||||
class nsIStreamListener;
|
||||
class nsStyleSet;
|
||||
|
||||
class nsBindingManager : public nsIBindingManager,
|
||||
public nsIStyleRuleSupplier,
|
||||
public nsStubDocumentObserver
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
public:
|
||||
nsBindingManager();
|
||||
~nsBindingManager();
|
||||
|
||||
NS_IMETHOD GetBinding(nsIContent* aContent, nsIXBLBinding** aResult);
|
||||
NS_IMETHOD SetBinding(nsIContent* aContent, nsIXBLBinding* aBinding);
|
||||
|
||||
NS_IMETHOD GetInsertionParent(nsIContent* aContent, nsIContent** aResult);
|
||||
NS_IMETHOD SetInsertionParent(nsIContent* aContent, nsIContent* aResult);
|
||||
|
||||
NS_IMETHOD GetWrappedJS(nsIContent* aContent, nsIXPConnectWrappedJS** aResult);
|
||||
NS_IMETHOD SetWrappedJS(nsIContent* aContent, nsIXPConnectWrappedJS* aResult);
|
||||
|
||||
NS_IMETHOD ChangeDocumentFor(nsIContent* aContent, nsIDocument* aOldDocument,
|
||||
nsIDocument* aNewDocument);
|
||||
|
||||
NS_IMETHOD ResolveTag(nsIContent* aContent, PRInt32* aNameSpaceID, nsIAtom** aResult);
|
||||
|
||||
NS_IMETHOD GetContentListFor(nsIContent* aContent, nsIDOMNodeList** aResult);
|
||||
NS_IMETHOD SetContentListFor(nsIContent* aContent, nsVoidArray* aList);
|
||||
NS_IMETHOD HasContentListFor(nsIContent* aContent, PRBool* aResult);
|
||||
|
||||
NS_IMETHOD GetAnonymousNodesFor(nsIContent* aContent, nsIDOMNodeList** aResult);
|
||||
NS_IMETHOD SetAnonymousNodesFor(nsIContent* aContent, nsVoidArray* aList);
|
||||
|
||||
NS_IMETHOD GetXBLChildNodesFor(nsIContent* aContent, nsIDOMNodeList** aResult);
|
||||
|
||||
NS_IMETHOD GetInsertionPoint(nsIContent* aParent, nsIContent* aChild, nsIContent** aResult, PRUint32* aIndex);
|
||||
NS_IMETHOD GetSingleInsertionPoint(nsIContent* aParent, nsIContent** aResult, PRUint32* aIndex,
|
||||
PRBool* aMultipleInsertionPoints);
|
||||
|
||||
NS_IMETHOD AddLayeredBinding(nsIContent* aContent, nsIURI* aURL);
|
||||
NS_IMETHOD RemoveLayeredBinding(nsIContent* aContent, nsIURI* aURL);
|
||||
NS_IMETHOD LoadBindingDocument(nsIDocument* aBoundDoc, nsIURI* aURL,
|
||||
nsIDocument** aResult);
|
||||
|
||||
NS_IMETHOD AddToAttachedQueue(nsIXBLBinding* aBinding);
|
||||
NS_IMETHOD ClearAttachedQueue();
|
||||
NS_IMETHOD ProcessAttachedQueue();
|
||||
|
||||
NS_IMETHOD ExecuteDetachedHandlers();
|
||||
|
||||
NS_IMETHOD PutXBLDocumentInfo(nsIXBLDocumentInfo* aDocumentInfo);
|
||||
NS_IMETHOD GetXBLDocumentInfo(nsIURI* aURI, nsIXBLDocumentInfo** aResult);
|
||||
NS_IMETHOD RemoveXBLDocumentInfo(nsIXBLDocumentInfo* aDocumentInfo);
|
||||
|
||||
NS_IMETHOD PutLoadingDocListener(nsIURI* aURL, nsIStreamListener* aListener);
|
||||
NS_IMETHOD GetLoadingDocListener(nsIURI* aURL, nsIStreamListener** aResult);
|
||||
NS_IMETHOD RemoveLoadingDocListener(nsIURI* aURL);
|
||||
|
||||
NS_IMETHOD InheritsStyle(nsIContent* aContent, PRBool* aResult);
|
||||
NS_IMETHOD FlushSkinBindings();
|
||||
|
||||
NS_IMETHOD GetBindingImplementation(nsIContent* aContent, REFNSIID aIID, void** aResult);
|
||||
|
||||
NS_IMETHOD ShouldBuildChildFrames(nsIContent* aContent, PRBool* aResult);
|
||||
|
||||
// nsIStyleRuleSupplier
|
||||
NS_IMETHOD WalkRules(nsStyleSet* aStyleSet,
|
||||
nsIStyleRuleProcessor::EnumFunc aFunc,
|
||||
RuleProcessorData* aData,
|
||||
PRBool* aCutOffInheritance);
|
||||
|
||||
// nsIDocumentObserver
|
||||
virtual void ContentAppended(nsIDocument* aDocument,
|
||||
nsIContent* aContainer,
|
||||
PRInt32 aNewIndexInContainer);
|
||||
virtual void ContentInserted(nsIDocument* aDocument,
|
||||
nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer);
|
||||
virtual void ContentRemoved(nsIDocument* aDocument,
|
||||
nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer);
|
||||
|
||||
protected:
|
||||
nsresult GetXBLChildNodesInternal(nsIContent* aContent,
|
||||
nsIDOMNodeList** aResult,
|
||||
PRBool* aIsAnonymousContentList);
|
||||
nsresult GetAnonymousNodesInternal(nsIContent* aContent,
|
||||
nsIDOMNodeList** aResult,
|
||||
PRBool* aIsAnonymousContentList);
|
||||
|
||||
nsIContent* GetEnclosingScope(nsIContent* aContent) {
|
||||
return aContent->GetBindingParent();
|
||||
}
|
||||
|
||||
nsresult GetNestedInsertionPoint(nsIContent* aParent, nsIContent* aChild, nsIContent** aResult);
|
||||
|
||||
// MEMBER VARIABLES
|
||||
protected:
|
||||
// A mapping from nsIContent* to the nsIXBLBinding* that is
|
||||
// installed on that element.
|
||||
PLDHashTable mBindingTable;
|
||||
|
||||
// A mapping from nsIContent* to an nsIDOMNodeList*
|
||||
// (nsAnonymousContentList*). This list contains an accurate
|
||||
// reflection of our *explicit* children (once intermingled with
|
||||
// insertion points) in the altered DOM.
|
||||
PLDHashTable mContentListTable;
|
||||
|
||||
// A mapping from nsIContent* to an nsIDOMNodeList*
|
||||
// (nsAnonymousContentList*). This list contains an accurate
|
||||
// reflection of our *anonymous* children (if and only if they are
|
||||
// intermingled with insertion points) in the altered DOM. This
|
||||
// table is not used if no insertion points were defined directly
|
||||
// underneath a <content> tag in a binding. The NodeList from the
|
||||
// <content> is used instead as a performance optimization.
|
||||
PLDHashTable mAnonymousNodesTable;
|
||||
|
||||
// A mapping from nsIContent* to nsIContent*. The insertion parent
|
||||
// is our one true parent in the transformed DOM. This gives us a
|
||||
// more-or-less O(1) way of obtaining our transformed parent.
|
||||
PLDHashTable mInsertionParentTable;
|
||||
|
||||
// A mapping from nsIContent* to nsIXPWrappedJS* (an XPConnect
|
||||
// wrapper for JS objects). For XBL bindings that implement XPIDL
|
||||
// interfaces, and that get referred to from C++, this table caches
|
||||
// the XPConnect wrapper for the binding. By caching it, I control
|
||||
// its lifetime, and I prevent a re-wrap of the same script object
|
||||
// (in the case where multiple bindings in an XBL inheritance chain
|
||||
// both implement an XPIDL interface).
|
||||
PLDHashTable mWrapperTable;
|
||||
|
||||
// A mapping from a URL (a string) to nsIXBLDocumentInfo*. This table
|
||||
// is the cache of all binding documents that have been loaded by a
|
||||
// given bound document.
|
||||
nsInterfaceHashtable<nsURIHashKey,nsIXBLDocumentInfo> mDocumentTable;
|
||||
|
||||
// A mapping from a URL (a string) to a nsIStreamListener. This
|
||||
// table is the currently loading binding docs. If they're in this
|
||||
// table, they have not yet finished loading.
|
||||
nsInterfaceHashtable<nsURIHashKey,nsIStreamListener> mLoadingDocTable;
|
||||
|
||||
// A queue of binding attached event handlers that are awaiting
|
||||
// execution.
|
||||
nsCOMPtr<nsISupportsArray> mAttachedStack;
|
||||
PRBool mProcessingAttachedStack;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -541,7 +541,7 @@ nsXBLBinding::GenerateAnonymousContent()
|
|||
if (! doc)
|
||||
return NS_OK;
|
||||
|
||||
nsIBindingManager *bindingManager = doc->GetBindingManager();
|
||||
nsIBindingManager *bindingManager = doc->BindingManager();
|
||||
|
||||
nsCOMPtr<nsIDOMNodeList> children;
|
||||
bindingManager->GetContentListFor(mBoundElement, getter_AddRefs(children));
|
||||
|
@ -1016,7 +1016,7 @@ nsXBLBinding::ChangeDocument(nsIDocument* aOldDocument, nsIDocument* aNewDocumen
|
|||
|
||||
// Make sure that henceforth we don't claim that mBoundElement's children
|
||||
// have insertion parents in the old document.
|
||||
nsIBindingManager* bindingManager = aOldDocument->GetBindingManager();
|
||||
nsIBindingManager* bindingManager = aOldDocument->BindingManager();
|
||||
for (PRUint32 i = mBoundElement->GetChildCount(); i > 0; --i) {
|
||||
NS_ASSERTION(mBoundElement->GetChildAt(i-1),
|
||||
"Must have child at i for 0 <= i < GetChildCount()!");
|
||||
|
|
|
@ -411,7 +411,7 @@ nsXBLContentSink::OnOpenContainer(const PRUnichar **aAtts,
|
|||
return PR_TRUE;
|
||||
}
|
||||
|
||||
mDocument->GetBindingManager()->PutXBLDocumentInfo(mDocInfo);
|
||||
mDocument->BindingManager()->PutXBLDocumentInfo(mDocInfo);
|
||||
|
||||
nsIURI *uri = mDocument->GetDocumentURI();
|
||||
|
||||
|
|
|
@ -788,8 +788,7 @@ nsXBLPrototypeBinding::LocateInstance(nsIContent* aBoundElement,
|
|||
// count to detemine our precise position within the template.
|
||||
nsIDocument* doc = aBoundElement->GetOwnerDoc();
|
||||
nsCOMPtr<nsIXBLBinding> binding;
|
||||
doc->GetBindingManager()->GetBinding(aBoundElement,
|
||||
getter_AddRefs(binding));
|
||||
doc->BindingManager()->GetBinding(aBoundElement, getter_AddRefs(binding));
|
||||
|
||||
nsCOMPtr<nsIXBLBinding> currBinding = binding;
|
||||
nsCOMPtr<nsIContent> anonContent;
|
||||
|
|
|
@ -389,7 +389,7 @@ nsXBLStreamListener::Load(nsIDOMEvent* aEvent)
|
|||
}
|
||||
|
||||
// Remove ourselves from the set of pending docs.
|
||||
nsIBindingManager *bindingManager = doc->GetBindingManager();
|
||||
nsIBindingManager *bindingManager = doc->BindingManager();
|
||||
nsIURI* documentURI = mBindingDocument->GetDocumentURI();
|
||||
bindingManager->RemoveLoadingDocListener(documentURI);
|
||||
|
||||
|
@ -400,7 +400,7 @@ nsXBLStreamListener::Load(nsIDOMEvent* aEvent)
|
|||
|
||||
// Put our doc info in the doc table.
|
||||
nsCOMPtr<nsIXBLDocumentInfo> info;
|
||||
nsIBindingManager *xblDocBindingManager = mBindingDocument->GetBindingManager();
|
||||
nsIBindingManager *xblDocBindingManager = mBindingDocument->BindingManager();
|
||||
xblDocBindingManager->GetXBLDocumentInfo(documentURI, getter_AddRefs(info));
|
||||
xblDocBindingManager->RemoveXBLDocumentInfo(info); // Break the self-imposed cycle.
|
||||
if (!info) {
|
||||
|
@ -534,7 +534,7 @@ nsXBLService::LoadBindings(nsIContent* aContent, nsIURI* aURL, PRBool aAugmentFl
|
|||
if (!document)
|
||||
return NS_OK;
|
||||
|
||||
nsIBindingManager *bindingManager = document->GetBindingManager();
|
||||
nsIBindingManager *bindingManager = document->BindingManager();
|
||||
|
||||
nsCOMPtr<nsIXBLBinding> binding;
|
||||
bindingManager->GetBinding(aContent, getter_AddRefs(binding));
|
||||
|
@ -649,7 +649,7 @@ nsXBLService::FlushStyleBindings(nsIContent* aContent)
|
|||
if (! document)
|
||||
return NS_OK;
|
||||
|
||||
nsIBindingManager *bindingManager = document->GetBindingManager();
|
||||
nsIBindingManager *bindingManager = document->BindingManager();
|
||||
|
||||
nsCOMPtr<nsIXBLBinding> binding;
|
||||
bindingManager->GetBinding(aContent, getter_AddRefs(binding));
|
||||
|
@ -677,10 +677,8 @@ nsXBLService::ResolveTag(nsIContent* aContent, PRInt32* aNameSpaceID,
|
|||
{
|
||||
nsIDocument* document = aContent->GetOwnerDoc();
|
||||
if (document) {
|
||||
nsIBindingManager *bindingManager = document->GetBindingManager();
|
||||
|
||||
if (bindingManager)
|
||||
return bindingManager->ResolveTag(aContent, aNameSpaceID, aResult);
|
||||
return document->BindingManager()->ResolveTag(aContent, aNameSpaceID,
|
||||
aResult);
|
||||
}
|
||||
|
||||
*aNameSpaceID = aContent->GetNameSpaceID();
|
||||
|
@ -709,7 +707,7 @@ nsXBLService::GetXBLDocumentInfo(nsIURI* aURI, nsIContent* aBoundElement, nsIXBL
|
|||
// The second line of defense is the binding manager's document table.
|
||||
nsIDocument* boundDocument = aBoundElement->GetOwnerDoc();
|
||||
if (boundDocument)
|
||||
boundDocument->GetBindingManager()->GetXBLDocumentInfo(aURI, aResult);
|
||||
boundDocument->BindingManager()->GetXBLDocumentInfo(aURI, aResult);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1055,7 +1053,7 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (aBoundDocument) {
|
||||
bindingManager = aBoundDocument->GetBindingManager();
|
||||
bindingManager = aBoundDocument->BindingManager();
|
||||
bindingManager->GetXBLDocumentInfo(documentURI, getter_AddRefs(info));
|
||||
}
|
||||
|
||||
|
@ -1103,7 +1101,7 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement,
|
|||
bindingURL, aForceSyncLoad, getter_AddRefs(document));
|
||||
|
||||
if (document) {
|
||||
nsIBindingManager *xblDocBindingManager = document->GetBindingManager();
|
||||
nsIBindingManager *xblDocBindingManager = document->BindingManager();
|
||||
xblDocBindingManager->GetXBLDocumentInfo(documentURI, getter_AddRefs(info));
|
||||
if (!info) {
|
||||
NS_ERROR("An XBL file is malformed. Did you forget the XBL namespace on the bindings tag?");
|
||||
|
@ -1198,7 +1196,7 @@ nsXBLService::FetchBindingDocument(nsIContent* aBoundElement, nsIDocument* aBoun
|
|||
// Add ourselves to the list of loading docs.
|
||||
nsIBindingManager *bindingManager;
|
||||
if (aBoundDocument)
|
||||
bindingManager = aBoundDocument->GetBindingManager();
|
||||
bindingManager = aBoundDocument->BindingManager();
|
||||
else
|
||||
bindingManager = nsnull;
|
||||
|
||||
|
|
|
@ -91,6 +91,7 @@ LOCAL_INCLUDES = \
|
|||
-I$(srcdir)/../../../../layout/style \
|
||||
-I$(srcdir)/../../../base/src \
|
||||
-I$(srcdir)/../../../xul/content/src \
|
||||
-I$(srcdir)/../../../events/src \
|
||||
-I$(srcdir)/../../../../dom/src/base \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ nsXMLPrettyPrinter::PrettyPrint(nsIDocument* aDocument)
|
|||
nsCOMPtr<nsIObserver> binding;
|
||||
nsCOMPtr<nsIContent> rootCont = do_QueryInterface(rootElem);
|
||||
NS_ASSERTION(rootCont, "Element doesn't implement nsIContent");
|
||||
aDocument->GetBindingManager()->GetBindingImplementation(rootCont,
|
||||
aDocument->BindingManager()->GetBindingImplementation(rootCont,
|
||||
NS_GET_IID(nsIObserver),
|
||||
(void**)getter_AddRefs(binding));
|
||||
NS_ASSERTION(binding, "Prettyprint binding doesn't implement nsIObserver");
|
||||
|
|
|
@ -99,6 +99,7 @@ LOCAL_INCLUDES = \
|
|||
-I$(srcdir)/../../../xml/document/src \
|
||||
-I$(srcdir)/../../../../layout/style \
|
||||
-I$(srcdir)/../../../html/content/src \
|
||||
-I$(srcdir)/../../../events/src \
|
||||
$(NULL)
|
||||
|
||||
DEFINES += -D_IMPL_NS_LAYOUT
|
||||
|
|
|
@ -862,11 +862,7 @@ nsXULElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
|
|||
if (doc) {
|
||||
// Notify XBL- & nsIAnonymousContentCreator-generated
|
||||
// anonymous content that the document is changing.
|
||||
nsIBindingManager *bindingManager = doc->GetBindingManager();
|
||||
NS_ASSERTION(bindingManager, "no binding manager");
|
||||
if (bindingManager) {
|
||||
bindingManager->ChangeDocumentFor(this, doc, aDocument);
|
||||
}
|
||||
doc->BindingManager()->ChangeDocumentFor(this, doc, aDocument);
|
||||
|
||||
nsCOMPtr<nsIDOMNSDocument> nsDoc(do_QueryInterface(doc));
|
||||
nsDoc->SetBoxObjectFor(this, nsnull);
|
||||
|
@ -1388,7 +1384,7 @@ nsXULElement::SetAttrAndNotify(PRInt32 aNamespaceID,
|
|||
|
||||
if (doc) {
|
||||
nsCOMPtr<nsIXBLBinding> binding;
|
||||
doc->GetBindingManager()->GetBinding(this, getter_AddRefs(binding));
|
||||
doc->BindingManager()->GetBinding(this, getter_AddRefs(binding));
|
||||
if (binding) {
|
||||
binding->AttributeChanged(aAttribute, aNamespaceID, PR_FALSE, aNotify);
|
||||
}
|
||||
|
@ -1599,7 +1595,7 @@ nsXULElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNotify)
|
|||
}
|
||||
|
||||
nsCOMPtr<nsIXBLBinding> binding;
|
||||
doc->GetBindingManager()->GetBinding(this, getter_AddRefs(binding));
|
||||
doc->BindingManager()->GetBinding(this, getter_AddRefs(binding));
|
||||
if (binding)
|
||||
binding->AttributeChanged(aName, aNameSpaceID, PR_TRUE, aNotify);
|
||||
|
||||
|
@ -1794,58 +1790,56 @@ nsXULElement::List(FILE* out, PRInt32 aIndent) const
|
|||
// XXX sXBL/XBL2 issue! Owner or current document?
|
||||
nsIDocument* doc = GetCurrentDoc();
|
||||
if (doc) {
|
||||
nsIBindingManager *bindingManager = doc->GetBindingManager();
|
||||
if (bindingManager) {
|
||||
nsCOMPtr<nsIDOMNodeList> anonymousChildren;
|
||||
bindingManager->GetAnonymousNodesFor(NS_STATIC_CAST(nsIContent*, NS_CONST_CAST(nsXULElement*, this)),
|
||||
getter_AddRefs(anonymousChildren));
|
||||
nsIBindingManager *bindingManager = doc->BindingManager();
|
||||
nsCOMPtr<nsIDOMNodeList> anonymousChildren;
|
||||
bindingManager->GetAnonymousNodesFor(NS_STATIC_CAST(nsIContent*, NS_CONST_CAST(nsXULElement*, this)),
|
||||
getter_AddRefs(anonymousChildren));
|
||||
|
||||
if (anonymousChildren) {
|
||||
PRUint32 length;
|
||||
anonymousChildren->GetLength(&length);
|
||||
if (length) {
|
||||
rdf_Indent(out, aIndent);
|
||||
fputs("anonymous-children<\n", out);
|
||||
if (anonymousChildren) {
|
||||
PRUint32 length;
|
||||
anonymousChildren->GetLength(&length);
|
||||
if (length) {
|
||||
rdf_Indent(out, aIndent);
|
||||
fputs("anonymous-children<\n", out);
|
||||
|
||||
for (PRUint32 i2 = 0; i2 < length; ++i2) {
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
anonymousChildren->Item(i2, getter_AddRefs(node));
|
||||
nsCOMPtr<nsIContent> child = do_QueryInterface(node);
|
||||
child->List(out, aIndent + 1);
|
||||
}
|
||||
|
||||
rdf_Indent(out, aIndent);
|
||||
fputs(">\n", out);
|
||||
for (PRUint32 i2 = 0; i2 < length; ++i2) {
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
anonymousChildren->Item(i2, getter_AddRefs(node));
|
||||
nsCOMPtr<nsIContent> child = do_QueryInterface(node);
|
||||
child->List(out, aIndent + 1);
|
||||
}
|
||||
|
||||
rdf_Indent(out, aIndent);
|
||||
fputs(">\n", out);
|
||||
}
|
||||
}
|
||||
|
||||
PRBool hasContentList;
|
||||
bindingManager->HasContentListFor(NS_STATIC_CAST(nsIContent*, NS_CONST_CAST(nsXULElement*, this)),
|
||||
&hasContentList);
|
||||
PRBool hasContentList;
|
||||
bindingManager->HasContentListFor(NS_STATIC_CAST(nsIContent*, NS_CONST_CAST(nsXULElement*, this)),
|
||||
&hasContentList);
|
||||
|
||||
if (hasContentList) {
|
||||
nsCOMPtr<nsIDOMNodeList> contentList;
|
||||
bindingManager->GetContentListFor(NS_STATIC_CAST(nsIContent*, NS_CONST_CAST(nsXULElement*, this)),
|
||||
getter_AddRefs(contentList));
|
||||
if (hasContentList) {
|
||||
nsCOMPtr<nsIDOMNodeList> contentList;
|
||||
bindingManager->GetContentListFor(NS_STATIC_CAST(nsIContent*, NS_CONST_CAST(nsXULElement*, this)),
|
||||
getter_AddRefs(contentList));
|
||||
|
||||
NS_ASSERTION(contentList != nsnull, "oops, binding manager lied");
|
||||
NS_ASSERTION(contentList != nsnull, "oops, binding manager lied");
|
||||
|
||||
PRUint32 length;
|
||||
contentList->GetLength(&length);
|
||||
if (length) {
|
||||
rdf_Indent(out, aIndent);
|
||||
fputs("content-list<\n", out);
|
||||
PRUint32 length;
|
||||
contentList->GetLength(&length);
|
||||
if (length) {
|
||||
rdf_Indent(out, aIndent);
|
||||
fputs("content-list<\n", out);
|
||||
|
||||
for (PRUint32 i2 = 0; i2 < length; ++i2) {
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
contentList->Item(i2, getter_AddRefs(node));
|
||||
nsCOMPtr<nsIContent> child = do_QueryInterface(node);
|
||||
child->List(out, aIndent + 1);
|
||||
}
|
||||
|
||||
rdf_Indent(out, aIndent);
|
||||
fputs(">\n", out);
|
||||
for (PRUint32 i2 = 0; i2 < length; ++i2) {
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
contentList->Item(i2, getter_AddRefs(node));
|
||||
nsCOMPtr<nsIContent> child = do_QueryInterface(node);
|
||||
child->List(out, aIndent + 1);
|
||||
}
|
||||
|
||||
rdf_Indent(out, aIndent);
|
||||
fputs(">\n", out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1977,11 +1971,9 @@ nsXULElement::HandleDOMEvent(nsPresContext* aPresContext, nsEvent* aEvent,
|
|||
// XXX sXBL/XBL2 issue! Owner or current document?
|
||||
nsIDocument* doc = GetCurrentDoc();
|
||||
if (doc) {
|
||||
nsIBindingManager* bindingManager = doc->GetBindingManager();
|
||||
if (bindingManager) {
|
||||
// we have a binding manager -- do we have an anonymous parent?
|
||||
bindingManager->GetInsertionParent(this, getter_AddRefs(parent));
|
||||
}
|
||||
// check for an anonymous parent
|
||||
doc->BindingManager()->GetInsertionParent(this,
|
||||
getter_AddRefs(parent));
|
||||
}
|
||||
|
||||
if (!parent) {
|
||||
|
|
|
@ -96,6 +96,7 @@ LOCAL_INCLUDES = -I$(srcdir)/../../../base/src \
|
|||
-I$(srcdir)/../../templates/src \
|
||||
-I$(srcdir)/../../../../layout/style \
|
||||
-I$(srcdir)/../../../xml/document/src \
|
||||
-I$(srcdir)/../../../events/src \
|
||||
$(NULL)
|
||||
|
||||
DEFINES += -D_IMPL_NS_LAYOUT
|
||||
|
|
|
@ -1474,28 +1474,24 @@ nsXULTemplateBuilder::GetTemplateRoot(nsIContent** aResult)
|
|||
if (! doc)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsIBindingManager *bindingManager = doc->GetBindingManager();
|
||||
nsCOMPtr<nsIDOMNodeList> kids;
|
||||
doc->BindingManager()->GetXBLChildNodesFor(mRoot, getter_AddRefs(kids));
|
||||
|
||||
if (bindingManager) {
|
||||
nsCOMPtr<nsIDOMNodeList> kids;
|
||||
bindingManager->GetXBLChildNodesFor(mRoot, getter_AddRefs(kids));
|
||||
if (kids) {
|
||||
PRUint32 length;
|
||||
kids->GetLength(&length);
|
||||
|
||||
if (kids) {
|
||||
PRUint32 length;
|
||||
kids->GetLength(&length);
|
||||
for (PRUint32 i = 0; i < length; ++i) {
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
kids->Item(i, getter_AddRefs(node));
|
||||
if (! node)
|
||||
continue;
|
||||
|
||||
for (PRUint32 i = 0; i < length; ++i) {
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
kids->Item(i, getter_AddRefs(node));
|
||||
if (! node)
|
||||
continue;
|
||||
nsCOMPtr<nsIContent> child = do_QueryInterface(node);
|
||||
|
||||
nsCOMPtr<nsIContent> child = do_QueryInterface(node);
|
||||
|
||||
if (IsTemplateElement(child)) {
|
||||
NS_ADDREF(*aResult = child.get());
|
||||
return NS_OK;
|
||||
}
|
||||
if (IsTemplateElement(child)) {
|
||||
NS_ADDREF(*aResult = child.get());
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5346,11 +5346,8 @@ nsElementSH::PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|||
// We must ensure that the XBL Binding is installed before we hand
|
||||
// back this object.
|
||||
|
||||
nsIBindingManager *bindingManager = doc->GetBindingManager();
|
||||
NS_ENSURE_TRUE(bindingManager, NS_ERROR_UNEXPECTED);
|
||||
|
||||
nsCOMPtr<nsIXBLBinding> binding;
|
||||
bindingManager->GetBinding(content, getter_AddRefs(binding));
|
||||
doc->BindingManager()->GetBinding(content, getter_AddRefs(binding));
|
||||
|
||||
if (binding) {
|
||||
// There's already a binding for this element so nothing left to
|
||||
|
|
|
@ -866,9 +866,7 @@ nsGlobalWindow::HandleDOMEvent(nsPresContext* aPresContext, nsEvent* aEvent,
|
|||
// down.
|
||||
if (aEvent->message == NS_PAGE_UNLOAD && mDocument && !(aFlags & NS_EVENT_FLAG_SYSTEM_EVENT)) {
|
||||
nsCOMPtr<nsIDocument> doc(do_QueryInterface(mDocument));
|
||||
nsIBindingManager *bindingManager = doc->GetBindingManager();
|
||||
if (bindingManager)
|
||||
bindingManager->ExecuteDetachedHandlers();
|
||||
doc->BindingManager()->ExecuteDetachedHandlers();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -225,8 +225,7 @@ inDOMUtils::GetBindingURLs(nsIDOMElement *aElement, nsISimpleEnumerator **_retva
|
|||
if (!doc1) return NS_OK;
|
||||
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(doc1);
|
||||
nsIBindingManager *bindingManager = doc->GetBindingManager();
|
||||
if (!bindingManager) return NS_OK;
|
||||
nsIBindingManager *bindingManager = doc->BindingManager();
|
||||
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
|
||||
nsCOMPtr<nsIXBLBinding> binding;
|
||||
|
|
|
@ -224,7 +224,7 @@ inLayoutUtils::GetBindingManagerFor(nsIDOMNode* aNode)
|
|||
aNode->GetOwnerDocument(getter_AddRefs(domdoc));
|
||||
if (domdoc) {
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(domdoc);
|
||||
return doc->GetBindingManager();
|
||||
return doc->BindingManager();
|
||||
}
|
||||
|
||||
return nsnull;
|
||||
|
|
|
@ -1686,10 +1686,7 @@ private:
|
|||
nsAutoEnqueueBinding::~nsAutoEnqueueBinding()
|
||||
{
|
||||
if (mBinding) {
|
||||
nsIBindingManager *bm = mDocument->GetBindingManager();
|
||||
if (bm) {
|
||||
bm->AddToAttachedQueue(mBinding);
|
||||
}
|
||||
mDocument->BindingManager()->AddToAttachedQueue(mBinding);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4022,9 +4019,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsFrameConstructorState& aState,
|
|||
return NS_OK; // Binding will load asynchronously.
|
||||
|
||||
if (binding) {
|
||||
nsIBindingManager *bm = mDocument->GetBindingManager();
|
||||
if (bm)
|
||||
bm->AddToAttachedQueue(binding);
|
||||
mDocument->BindingManager()->AddToAttachedQueue(binding);
|
||||
}
|
||||
|
||||
if (resolveStyle) {
|
||||
|
@ -4213,12 +4208,12 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIContent* aDocElement,
|
|||
*/
|
||||
|
||||
// Set up our style rule observer.
|
||||
nsIBindingManager *bindingManager = mDocument->GetBindingManager();
|
||||
if (bindingManager) {
|
||||
nsCOMPtr<nsIStyleRuleSupplier> ruleSupplier(do_QueryInterface(bindingManager));
|
||||
{
|
||||
nsCOMPtr<nsIStyleRuleSupplier> ruleSupplier =
|
||||
do_QueryInterface(mDocument->BindingManager());
|
||||
mPresShell->StyleSet()->SetStyleRuleSupplier(ruleSupplier);
|
||||
}
|
||||
|
||||
|
||||
// --------- BUILD VIEWPORT -----------
|
||||
nsIFrame* viewportFrame = nsnull;
|
||||
nsRefPtr<nsStyleContext> viewportPseudoStyle;
|
||||
|
@ -6066,8 +6061,8 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
|
|||
if (processChildren || processAnonymousChildren) {
|
||||
nsFrameItems childItems;
|
||||
if (processChildren) {
|
||||
mDocument->GetBindingManager()->ShouldBuildChildFrames(aContent,
|
||||
&processChildren);
|
||||
mDocument->BindingManager()->ShouldBuildChildFrames(aContent,
|
||||
&processChildren);
|
||||
if (processChildren)
|
||||
rv = ProcessChildren(aState, aContent, newFrame, PR_FALSE,
|
||||
childItems, PR_FALSE);
|
||||
|
@ -8295,11 +8290,10 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
|
|||
|
||||
#ifdef MOZ_XUL
|
||||
if (aContainer) {
|
||||
nsIBindingManager *bindingManager = mDocument->GetBindingManager();
|
||||
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
PRInt32 namespaceID;
|
||||
bindingManager->ResolveTag(aContainer, &namespaceID, getter_AddRefs(tag));
|
||||
mDocument->BindingManager()->ResolveTag(aContainer, &namespaceID,
|
||||
getter_AddRefs(tag));
|
||||
|
||||
// Just ignore tree tags, anyway we don't create any frames for them.
|
||||
if (tag == nsXULAtoms::treechildren ||
|
||||
|
@ -8337,7 +8331,7 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
|
|||
document = firstAppendedChild->GetDocument();
|
||||
}
|
||||
if (document)
|
||||
bindingManager = document->GetBindingManager();
|
||||
bindingManager = document->BindingManager();
|
||||
if (bindingManager) {
|
||||
nsCOMPtr<nsIContent> insParent;
|
||||
bindingManager->GetInsertionParent(firstAppendedChild, getter_AddRefs(insParent));
|
||||
|
@ -8556,7 +8550,7 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
|
|||
}
|
||||
|
||||
// We built some new frames. Initialize any newly-constructed bindings.
|
||||
mDocument->GetBindingManager()->ProcessAttachedQueue();
|
||||
mDocument->BindingManager()->ProcessAttachedQueue();
|
||||
|
||||
// process the current pseudo frame state
|
||||
if (!state.mPseudoFrames.IsEmpty()) {
|
||||
|
@ -8883,8 +8877,8 @@ PRBool NotifyListBoxBody(nsPresContext* aPresContext,
|
|||
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
PRInt32 namespaceID;
|
||||
aDocument->GetBindingManager()->ResolveTag(aContainer, &namespaceID,
|
||||
getter_AddRefs(tag));
|
||||
aDocument->BindingManager()->ResolveTag(aContainer, &namespaceID,
|
||||
getter_AddRefs(tag));
|
||||
|
||||
// Just ignore tree tags, anyway we don't create any frames for them.
|
||||
if (tag == nsXULAtoms::treechildren ||
|
||||
|
@ -8979,7 +8973,7 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
|
|||
#endif
|
||||
}
|
||||
|
||||
mDocument->GetBindingManager()->ProcessAttachedQueue();
|
||||
mDocument->BindingManager()->ProcessAttachedQueue();
|
||||
|
||||
// otherwise this is not a child of the root element, and we
|
||||
// won't let it have a frame.
|
||||
|
@ -9176,7 +9170,7 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
|
|||
|
||||
// Now that we've created frames, run the attach queue.
|
||||
//XXXwaterson should we do this after we've processed pseudos, too?
|
||||
mDocument->GetBindingManager()->ProcessAttachedQueue();
|
||||
mDocument->BindingManager()->ProcessAttachedQueue();
|
||||
|
||||
// process the current pseudo frame state
|
||||
if (!state.mPseudoFrames.IsEmpty())
|
||||
|
@ -10248,8 +10242,8 @@ nsCSSFrameConstructor::AttributeChanged(nsIContent* aContent,
|
|||
if (!primaryFrame && !reframe) {
|
||||
PRInt32 namespaceID;
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
mDocument->GetBindingManager()->ResolveTag(aContent, &namespaceID,
|
||||
getter_AddRefs(tag));
|
||||
mDocument->BindingManager()->ResolveTag(aContent, &namespaceID,
|
||||
getter_AddRefs(tag));
|
||||
|
||||
if (namespaceID == kNameSpaceID_XUL &&
|
||||
(tag == nsXULAtoms::listitem ||
|
||||
|
@ -10311,8 +10305,8 @@ nsCSSFrameConstructor::AttributeChanged(nsIContent* aContent,
|
|||
aAttribute == nsXULAtoms::menugenerated) {
|
||||
PRInt32 namespaceID;
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
mDocument->GetBindingManager()->ResolveTag(aContent, &namespaceID,
|
||||
getter_AddRefs(tag));
|
||||
mDocument->BindingManager()->ResolveTag(aContent, &namespaceID,
|
||||
getter_AddRefs(tag));
|
||||
|
||||
if (namespaceID == kNameSpaceID_XUL &&
|
||||
(tag == nsXULAtoms::menupopup || tag == nsXULAtoms::popup ||
|
||||
|
@ -11368,9 +11362,7 @@ nsCSSFrameConstructor::GetInsertionPoint(nsIFrame* aParentFrame,
|
|||
if (!container)
|
||||
return NS_OK;
|
||||
|
||||
nsIBindingManager *bindingManager = mDocument->GetBindingManager();
|
||||
if (!bindingManager)
|
||||
return NS_OK;
|
||||
nsIBindingManager *bindingManager = mDocument->BindingManager();
|
||||
|
||||
nsCOMPtr<nsIContent> insertionElement;
|
||||
if (aChildContent) {
|
||||
|
@ -12608,7 +12600,7 @@ nsCSSFrameConstructor::CreateListBoxContent(nsPresContext* aPresContext,
|
|||
*aNewFrame = newFrame;
|
||||
|
||||
if (NS_SUCCEEDED(rv) && (nsnull != newFrame)) {
|
||||
mDocument->GetBindingManager()->ProcessAttachedQueue();
|
||||
mDocument->BindingManager()->ProcessAttachedQueue();
|
||||
|
||||
// Notify the parent frame
|
||||
if (aIsAppend)
|
||||
|
|
|
@ -58,14 +58,10 @@ ChildIterator::Init(nsIContent* aContent,
|
|||
if (! doc)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsIBindingManager *mgr = doc->GetBindingManager();
|
||||
if (! mgr)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// If this node has XBL children, then use them. Otherwise, just use
|
||||
// the vanilla content APIs.
|
||||
nsCOMPtr<nsIDOMNodeList> nodes;
|
||||
mgr->GetXBLChildNodesFor(aContent, getter_AddRefs(nodes));
|
||||
doc->BindingManager()->GetXBLChildNodesFor(aContent, getter_AddRefs(nodes));
|
||||
|
||||
PRUint32 length;
|
||||
if (nodes)
|
||||
|
|
|
@ -145,10 +145,6 @@
|
|||
#define NS_XBLSERVICE_CID \
|
||||
{ 0x64f300a1, 0xc88c, 0x11d3, { 0x97, 0xfb, 0x0, 0x40, 0x5, 0x53, 0xee, 0xf0 } }
|
||||
|
||||
// {15671AF5-39F9-4c70-8CE3-72C97111B52D}
|
||||
#define NS_BINDINGMANAGER_CID \
|
||||
{ 0x15671af5, 0x39f9, 0x4c70, { 0x8c, 0xe3, 0x72, 0xc9, 0x71, 0x11, 0xb5, 0x2d } }
|
||||
|
||||
// {D750A964-2D14-484c-B3AA-8ED7823B5C7B}
|
||||
#define NS_BOXOBJECT_CID \
|
||||
{ 0xd750a964, 0x2d14, 0x484c, { 0xb3, 0xaa, 0x8e, 0xd7, 0x82, 0x3b, 0x5c, 0x7b } }
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
#include "nsHTMLContentSerializer.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsIBindingManager.h"
|
||||
#include "nsICSSLoader.h"
|
||||
#include "nsICSSParser.h"
|
||||
#include "nsCSSScanner.h"
|
||||
|
@ -463,7 +462,6 @@ nsresult NS_NewContentDocumentLoaderFactory(nsIDocumentLoaderFactory** aResult);
|
|||
nsresult NS_NewHTMLCopyTextEncoder(nsIDocumentEncoder** aResult);
|
||||
nsresult NS_NewTextEncoder(nsIDocumentEncoder** aResult);
|
||||
nsresult NS_NewXBLService(nsIXBLService** aResult);
|
||||
nsresult NS_NewBindingManager(nsIBindingManager** aResult);
|
||||
nsresult NS_NewContentPolicy(nsIContentPolicy** aResult);
|
||||
nsresult NS_NewSyncLoadDOMService(nsISyncLoadDOMService** aResult);
|
||||
nsresult NS_NewDOMEventGroup(nsIDOMEventGroup** aResult);
|
||||
|
@ -565,7 +563,6 @@ MAKE_CTOR(CreateXMLFragmentSink, nsIFragmentContentSink, NS_NewXML
|
|||
MAKE_CTOR(CreateXMLFragmentSink2, nsIFragmentContentSink, NS_NewXMLFragmentContentSink2)
|
||||
MAKE_CTOR(CreateSanitizingHTMLSerializer, nsIContentSerializer, NS_NewSanitizingHTMLSerializer)
|
||||
MAKE_CTOR(CreateXBLService, nsIXBLService, NS_NewXBLService)
|
||||
MAKE_CTOR(CreateBindingManager, nsIBindingManager, NS_NewBindingManager)
|
||||
MAKE_CTOR(CreateContentPolicy, nsIContentPolicy, NS_NewContentPolicy)
|
||||
MAKE_CTOR(CreateComputedDOMStyle, nsIComputedDOMStyle, NS_NewComputedDOMStyle)
|
||||
#ifdef MOZ_XUL
|
||||
|
@ -1127,11 +1124,6 @@ static const nsModuleComponentInfo gComponents[] = {
|
|||
"@mozilla.org/xbl;1",
|
||||
CreateXBLService },
|
||||
|
||||
{ "XBL Binding Manager",
|
||||
NS_BINDINGMANAGER_CID,
|
||||
"@mozilla.org/xbl/binding-manager;1",
|
||||
CreateBindingManager },
|
||||
|
||||
{ "Content policy service",
|
||||
NS_CONTENTPOLICY_CID,
|
||||
NS_CONTENTPOLICY_CONTRACTID,
|
||||
|
|
|
@ -185,7 +185,7 @@ FindBodyContent(nsIContent* aParent, nsIContent** aResult)
|
|||
}
|
||||
else {
|
||||
nsCOMPtr<nsIDOMNodeList> kids;
|
||||
aParent->GetDocument()->GetBindingManager()->GetXBLChildNodesFor(aParent, getter_AddRefs(kids));
|
||||
aParent->GetDocument()->BindingManager()->GetXBLChildNodesFor(aParent, getter_AddRefs(kids));
|
||||
if (!kids) return;
|
||||
|
||||
PRUint32 i;
|
||||
|
|
|
@ -1298,7 +1298,7 @@ static void FlushSkinBindingsForWindow(nsIDOMWindowInternal* aWindow)
|
|||
return;
|
||||
|
||||
// Annihilate all XBL bindings.
|
||||
document->GetBindingManager()->FlushSkinBindings();
|
||||
document->BindingManager()->FlushSkinBindings();
|
||||
}
|
||||
|
||||
// XXXbsmedberg: move this to nsIWindowMediator
|
||||
|
|
Загрузка…
Ссылка в новой задаче