From 5c10ea255d361934b3f391537e0d2ef018a6320e Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 30 Apr 2010 09:12:06 -0400 Subject: [PATCH] Bug 562688 part 8. Change broadcasters to use Element. r=jst --- content/xul/document/src/nsXULDocument.cpp | 12 ++++++------ content/xul/document/src/nsXULDocument.h | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index ed3d3233130f..22b01366c98e 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -986,11 +986,14 @@ nsXULDocument::AttributeWillChange(nsIDocument* aDocument, void nsXULDocument::AttributeChanged(nsIDocument* aDocument, - nsIContent* aElement, PRInt32 aNameSpaceID, + nsIContent* aElementContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) { NS_ASSERTION(aDocument == this, "unexpected doc"); + // XXXbz once we change AttributeChanged to take Element, we can nix this line + Element* aElement = aElementContent->AsElement(); + // Do this here so that all the exit paths below don't leave this undone nsXMLDocument::AttributeChanged(aDocument, aElement, aNameSpaceID, aAttribute, aModType); @@ -4231,15 +4234,12 @@ nsXULDocument::TemplateBuilderHookup::Resolve() //---------------------------------------------------------------------- nsresult -nsXULDocument::FindBroadcaster(nsIContent* aElement, +nsXULDocument::FindBroadcaster(Element* aElement, nsIDOMElement** aListener, nsString& aBroadcasterID, nsString& aAttribute, nsIDOMElement** aBroadcaster) { - NS_ASSERTION(aElement->IsElement(), - "Only pass elements into FindBroadcaster!"); - nsresult rv; nsINodeInfo *ni = aElement->NodeInfo(); *aListener = nsnull; @@ -4323,7 +4323,7 @@ nsXULDocument::FindBroadcaster(nsIContent* aElement, } nsresult -nsXULDocument::CheckBroadcasterHookup(nsIContent* aElement, +nsXULDocument::CheckBroadcasterHookup(Element* aElement, PRBool* aNeedsHookup, PRBool* aDidResolve) { diff --git a/content/xul/document/src/nsXULDocument.h b/content/xul/document/src/nsXULDocument.h index e6388ef1f909..e7a9e6038acd 100644 --- a/content/xul/document/src/nsXULDocument.h +++ b/content/xul/document/src/nsXULDocument.h @@ -485,12 +485,12 @@ protected: { protected: nsXULDocument* mDocument; // [WEAK] - nsCOMPtr mObservesElement; // [OWNER] + nsCOMPtr mObservesElement; // [OWNER] PRBool mResolved; public: BroadcasterHookup(nsXULDocument* aDocument, - nsIContent* aObservesElement) + mozilla::dom::Element* aObservesElement) : mDocument(aDocument), mObservesElement(aObservesElement), mResolved(PR_FALSE) @@ -550,14 +550,14 @@ protected: // values of the out params should not be relied on (though *aListener and // *aBroadcaster do need to be released if non-null, of course). nsresult - FindBroadcaster(nsIContent* aElement, + FindBroadcaster(mozilla::dom::Element* aElement, nsIDOMElement** aListener, nsString& aBroadcasterID, nsString& aAttribute, nsIDOMElement** aBroadcaster); nsresult - CheckBroadcasterHookup(nsIContent* aElement, + CheckBroadcasterHookup(mozilla::dom::Element* aElement, PRBool* aNeedsHookup, PRBool* aDidResolve);