diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index fa5504caa232..0aace7995a4f 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -66,7 +66,7 @@ #include "nsContentCID.h" #include "nsError.h" -#include "nsIPresShell.h" +#include "nsPresShell.h" #include "nsPresContext.h" #include "nsIJSON.h" #include "nsThreadUtils.h" @@ -3322,13 +3322,8 @@ nsDocument::doCreateShell(nsPresContext* aContext, FillStyleSet(aStyleSet); - nsCOMPtr shell; - nsresult rv = NS_NewPresShell(getter_AddRefs(shell)); - if (NS_FAILED(rv)) { - return rv; - } - - rv = shell->Init(this, aContext, aViewManager, aStyleSet, aCompatMode); + nsRefPtr shell = new PresShell; + nsresult rv = shell->Init(this, aContext, aViewManager, aStyleSet, aCompatMode); NS_ENSURE_SUCCESS(rv, rv); // Note: we don't hold a ref to the shell (it holds a ref to us) @@ -3338,7 +3333,7 @@ nsDocument::doCreateShell(nsPresContext* aContext, MaybeRescheduleAnimationFrameNotifications(); - shell.swap(*aInstancePtrResult); + shell.forget(aInstancePtrResult); return NS_OK; } diff --git a/layout/base/nsIPresShell.h b/layout/base/nsIPresShell.h index 6183edc0760f..82d35f2160fc 100644 --- a/layout/base/nsIPresShell.h +++ b/layout/base/nsIPresShell.h @@ -1515,11 +1515,4 @@ protected: nscoord mMaxLineBoxWidth; }; -/** - * Create a new empty presentation shell. Upon success, call Init - * before attempting to use the shell. - */ -nsresult -NS_NewPresShell(nsIPresShell** aInstancePtrResult); - #endif /* nsIPresShell_h___ */ diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index c168f52a02d8..a6ef89990ac1 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -686,20 +686,6 @@ nsIPresShell::FrameSelection() //---------------------------------------------------------------------- -nsresult -NS_NewPresShell(nsIPresShell** aInstancePtrResult) -{ - NS_PRECONDITION(nullptr != aInstancePtrResult, "null ptr"); - - if (!aInstancePtrResult) - return NS_ERROR_NULL_POINTER; - - *aInstancePtrResult = new PresShell(); - - NS_ADDREF(*aInstancePtrResult); - return NS_OK; -} - static bool sSynthMouseMove = true; PresShell::PresShell() diff --git a/layout/build/nsLayoutCID.h b/layout/build/nsLayoutCID.h index b07f20cddee2..f44bdadce45f 100644 --- a/layout/build/nsLayoutCID.h +++ b/layout/build/nsLayoutCID.h @@ -18,10 +18,6 @@ #define NS_FRAME_UTIL_CID \ { 0xa6cf90d5, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}} -// {E6FD9940-899D-11d2-8EAE-00805F29F370} -#define NS_PRESSHELL_CID \ -{ 0xe6fd9940, 0x899d, 0x11d2, { 0x8e, 0xae, 0x0, 0x80, 0x5f, 0x29, 0xf3, 0x70 } } - #define NS_DOMSELECTION_CID \ {/* {C87A37FC-8109-4ce2-A322-8CDEC925379F}*/ \ 0xc87a37fc, 0x8109, 0x4ce2, { 0xa3, 0x22, 0x8c, 0xde, 0xc9, 0x25, 0x37, 0x9f } } diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index 0eaa7eb28d3b..2e88084e474a 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -34,7 +34,6 @@ #include "nsINodeInfo.h" #include "nsIObserver.h" #include "nsIObserverService.h" -#include "nsIPresShell.h" #include "nsIScriptNameSpaceManager.h" #include "nsISelection.h" #include "nsCaret.h" @@ -517,7 +516,6 @@ MAKE_CTOR(CreateNewLayoutDebugger, nsILayoutDebugger, NS_NewLay #endif MAKE_CTOR(CreateNewFrameTraversal, nsIFrameTraversal, NS_CreateFrameTraversal) -MAKE_CTOR(CreateNewPresShell, nsIPresShell, NS_NewPresShell) MAKE_CTOR(CreateNewBoxObject, nsIBoxObject, NS_NewBoxObject) #ifdef MOZ_XUL @@ -699,7 +697,6 @@ NS_DEFINE_NAMED_CID(NS_FRAME_UTIL_CID); NS_DEFINE_NAMED_CID(NS_LAYOUT_DEBUGGER_CID); #endif NS_DEFINE_NAMED_CID(NS_FRAMETRAVERSAL_CID); -NS_DEFINE_NAMED_CID(NS_PRESSHELL_CID); NS_DEFINE_NAMED_CID(NS_BOXOBJECT_CID); #ifdef MOZ_XUL NS_DEFINE_NAMED_CID(NS_LISTBOXOBJECT_CID); @@ -987,7 +984,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = { { &kNS_LAYOUT_DEBUGGER_CID, false, NULL, CreateNewLayoutDebugger }, #endif { &kNS_FRAMETRAVERSAL_CID, false, NULL, CreateNewFrameTraversal }, - { &kNS_PRESSHELL_CID, false, NULL, CreateNewPresShell }, { &kNS_BOXOBJECT_CID, false, NULL, CreateNewBoxObject }, #ifdef MOZ_XUL { &kNS_LISTBOXOBJECT_CID, false, NULL, CreateNewListBoxObject },