Bug 945572 part 2. Make NS_NewXULElement take an Element** outparam instead of an nsIContent** one. r=smaug
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 03 Dec 2013 09:40:11 -0500
changeset 174207 4f841d982dcbb958900758c887193fd2dff67cc7
parent 174206 2ae6663f558c4241302066e46b8cc57e8a2d6f69
child 174208 e2e643dc35f58e34beeb192a04046faa98ce7eeb
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs945572
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 945572 part 2. Make NS_NewXULElement take an Element** outparam instead of an nsIContent** one. r=smaug
content/base/public/nsContentCreatorFunctions.h
content/base/src/nsNameSpaceManager.cpp
content/xul/content/src/nsXULElement.cpp
content/xul/content/src/nsXULElement.h
layout/xul/base/src/nsDocElementBoxFrame.cpp
--- a/content/base/public/nsContentCreatorFunctions.h
+++ b/content/base/public/nsContentCreatorFunctions.h
@@ -48,17 +48,18 @@ CreateHTMLElement(uint32_t aNodeType, al
                   mozilla::dom::FromParser aFromParser);
 
 nsresult
 NS_NewMathMLElement(nsIContent** aResult,
                      already_AddRefed<nsINodeInfo> aNodeInfo);
 
 #ifdef MOZ_XUL
 nsresult
-NS_NewXULElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo);
+NS_NewXULElement(mozilla::dom::Element** aResult,
+                 already_AddRefed<nsINodeInfo> aNodeInfo);
 
 void
 NS_TrustedNewXULElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo);
 #endif
 
 nsresult
 NS_NewSVGElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo,
                  mozilla::dom::FromParser aFromParser);
--- a/content/base/src/nsNameSpaceManager.cpp
+++ b/content/base/src/nsNameSpaceManager.cpp
@@ -196,17 +196,20 @@ NS_NewElement(nsIContent** aResult,
   if (ns == kNameSpaceID_XHTML) {
     nsCOMPtr<Element> el;
     nsresult rv = NS_NewHTMLElement(getter_AddRefs(el), aNodeInfo, aFromParser);
     el.forget(aResult);
     return rv;
   }
 #ifdef MOZ_XUL
   if (ns == kNameSpaceID_XUL) {
-    return NS_NewXULElement(aResult, aNodeInfo);
+    nsCOMPtr<Element> el;
+    nsresult rv = NS_NewXULElement(getter_AddRefs(el), aNodeInfo);
+    el.forget(aResult);
+    return rv;
   }
 #endif
   if (ns == kNameSpaceID_MathML) {
     return NS_NewMathMLElement(aResult, aNodeInfo);
   }
   if (ns == kNameSpaceID_SVG) {
     return NS_NewSVGElement(aResult, aNodeInfo, aFromParser);
   }
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -288,17 +288,17 @@ nsXULElement::Create(nsXULPrototypeEleme
     }
 
     element.forget(aResult);
 
     return NS_OK;
 }
 
 nsresult
-NS_NewXULElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo)
+NS_NewXULElement(Element** aResult, already_AddRefed<nsINodeInfo> aNodeInfo)
 {
     NS_PRECONDITION(aNodeInfo.get(), "need nodeinfo for non-proto Create");
 
     nsIDocument* doc = aNodeInfo.get()->GetDocument();
     if (doc && !doc->AllowXULXBL()) {
         nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
         return NS_ERROR_NOT_AVAILABLE;
     }
--- a/content/xul/content/src/nsXULElement.h
+++ b/content/xul/content/src/nsXULElement.h
@@ -690,17 +690,17 @@ protected:
       nsDOMSlots* slots = GetExistingDOMSlots();
       return slots ? slots->mControllers : nullptr; 
     }
 
     void UnregisterAccessKey(const nsAString& aOldValue);
     bool BoolAttrIsTrue(nsIAtom* aName) const;
 
     friend nsresult
-    NS_NewXULElement(nsIContent** aResult, nsINodeInfo *aNodeInfo);
+    NS_NewXULElement(mozilla::dom::Element** aResult, nsINodeInfo *aNodeInfo);
     friend void
     NS_TrustedNewXULElement(nsIContent** aResult, nsINodeInfo *aNodeInfo);
 
     static already_AddRefed<nsXULElement>
     Create(nsXULPrototypeElement* aPrototype, nsINodeInfo *aNodeInfo,
            bool aIsScriptable, bool aIsRoot);
 
     bool IsReadWriteTextElement() const
--- a/layout/xul/base/src/nsDocElementBoxFrame.cpp
+++ b/layout/xul/base/src/nsDocElementBoxFrame.cpp
@@ -15,19 +15,22 @@
 #include "nsStackLayout.h"
 #include "nsIAnonymousContentCreator.h"
 #include "nsINodeInfo.h"
 #include "nsIServiceManager.h"
 #include "nsNodeInfoManager.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsContentUtils.h"
 #include "nsContentList.h"
+#include "mozilla/dom/Element.h"
 
 //#define DEBUG_REFLOW
 
+using namespace mozilla::dom;
+
 class nsDocElementBoxFrame : public nsBoxFrame,
                              public nsIAnonymousContentCreator
 {
 public:
   virtual void DestroyFrom(nsIFrame* aDestructRoot);
 
   friend nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
                                   nsStyleContext* aContext);
@@ -50,18 +53,18 @@ public:
       return false;
     return nsBoxFrame::IsFrameOfType(aFlags);
   }
 
 #ifdef DEBUG
   NS_IMETHOD GetFrameName(nsAString& aResult) const;
 #endif
 private:
-  nsCOMPtr<nsIContent> mPopupgroupContent;
-  nsCOMPtr<nsIContent> mTooltipContent;
+  nsCOMPtr<Element> mPopupgroupContent;
+  nsCOMPtr<Element> mTooltipContent;
 };
 
 //----------------------------------------------------------------------
 
 nsIFrame*
 NS_NewDocElementBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsDocElementBoxFrame (aPresShell, aContext);