Bug 386560 enable inspector support to work with --disable-xul
authortimeless@mozdev.org
Tue, 17 Jul 2007 22:35:23 -0700
changeset 3603 b32bde8b982eb6d8738e31171d8bfafeb81f0397
parent 3602 e2ef6e20cf950ca4122ad3925c3c792134a0bef2
child 3604 414b5814669fb4f1392fe7f0e34e14b3edec3813
push idunknown
push userunknown
push dateunknown
bugs386560
milestone1.9a7pre
Bug 386560 enable inspector support to work with --disable-xul r=bsmedberg sr=bz
layout/build/Makefile.in
layout/build/nsLayoutModule.cpp
layout/build/nsLayoutStatics.cpp
layout/inspector/src/Makefile.in
--- a/layout/build/Makefile.in
+++ b/layout/build/Makefile.in
@@ -95,17 +95,16 @@ REQUIRES	= xpcom \
 		  xul \
 		  xultmpl \
 		  lwbrk \
 		  plugin \
 		  commandhandler \
 		  webbrwsr \
 		  uconv \
 		  txtsvc \
-		  inspector \
 		  $(NULL)
 
 ifdef MOZ_ENABLE_CAIRO_GFX
 REQUIRES += thebes
 endif
 
 CPPSRCS		= \
 		nsLayoutModule.cpp \
@@ -160,16 +159,22 @@ SHARED_LIBRARY_LIBS += \
 		../xul/base/src/tree/src/$(LIB_PREFIX)gkxultree_s.$(LIB_SUFFIX) \
 		../xul/base/src/grid/$(LIB_PREFIX)gkxulgrid_s.$(LIB_SUFFIX) \
 		$(DEPTH)/content/xul/content/src/$(LIB_PREFIX)gkconxulcon_s.$(LIB_SUFFIX) \
 		$(DEPTH)/content/xul/templates/src/$(LIB_PREFIX)gkconxultmpl_s.$(LIB_SUFFIX) \
 		$(NULL)
 endif
 
 ifndef MOZ_NO_INSPECTOR_APIS
+LOCAL_INCLUDES  += \
+      -I$(srcdir)/../inspector/src \
+      $(NULL)
+REQUIRES += \
+      inspector \
+      $(NULL)
 SHARED_LIBRARY_LIBS += ../inspector/src/$(LIB_PREFIX)inspector_s.$(LIB_SUFFIX)
 else
 DEFINES += -DMOZ_NO_INSPECTOR_APIS
 endif
 
 ifdef MOZ_MATHML
 SHARED_LIBRARY_LIBS += \
                 ../mathml/content/src/$(LIB_PREFIX)gkmathmlcon_s.$(LIB_SUFFIX) \
@@ -253,17 +258,16 @@ include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES	+= -I$(srcdir)/../base \
 		   -I$(srcdir)/../generic \
 		   -I$(srcdir)/../forms \
 		   -I$(srcdir)/../tables \
 		   -I$(srcdir)/../style \
 		   -I$(srcdir)/../xul/content/src \
 		   -I$(srcdir)/../xul/base/src \
-		   -I$(srcdir)/../inspector/src \
 		   -I$(topsrcdir)/content/base/src \
 		   -I$(topsrcdir)/content/html/content/src \
 		   -I$(topsrcdir)/content/html/document/src \
 		   -I$(topsrcdir)/content/html/style/src \
 		   -I$(topsrcdir)/content/xslt/src/base \
 		   -I$(topsrcdir)/content/xslt/src/xml \
 		   -I$(topsrcdir)/content/xslt/src/xpath \
 		   -I$(topsrcdir)/content/xslt/src/xslt \
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -446,17 +446,19 @@ MAKE_CTOR(CreateNewListBoxObject,       
 MAKE_CTOR(CreateNewMenuBoxObject,       nsIBoxObject,           NS_NewMenuBoxObject)
 MAKE_CTOR(CreateNewPopupBoxObject,      nsIBoxObject,           NS_NewPopupBoxObject)
 MAKE_CTOR(CreateNewScrollBoxObject,     nsIBoxObject,           NS_NewScrollBoxObject)
 MAKE_CTOR(CreateNewTreeBoxObject,       nsIBoxObject,           NS_NewTreeBoxObject)
 MAKE_CTOR(CreateNewContainerBoxObject,  nsIBoxObject,           NS_NewContainerBoxObject)
 #endif // MOZ_XUL
 
 #ifndef MOZ_NO_INSPECTOR_APIS
+#ifdef MOZ_XUL
 NS_GENERIC_FACTORY_CONSTRUCTOR(inDOMView)
+#endif
 NS_GENERIC_FACTORY_CONSTRUCTOR(inDeepTreeWalker)
 NS_GENERIC_FACTORY_CONSTRUCTOR(inFlasher)
 NS_GENERIC_FACTORY_CONSTRUCTOR(inCSSValueSearch)
 NS_GENERIC_FACTORY_CONSTRUCTOR(inDOMUtils)
 #endif
 
 #ifndef MOZ_CAIRO_GFX
 MAKE_CTOR(CreateSelectionImageService,  nsISelectionImageService,NS_NewSelectionImageService)
@@ -852,21 +854,22 @@ static const nsModuleComponentInfo gComp
   { "XUL Tree Box Object",
     NS_TREEBOXOBJECT_CID,
     "@mozilla.org/layout/xul-boxobject-tree;1",
     CreateNewTreeBoxObject },
 
 #endif // MOZ_XUL
 
 #ifndef MOZ_NO_INSPECTOR_APIS
-
+#ifdef MOZ_XUL
   { "DOM View",
     IN_DOMVIEW_CID, 
     "@mozilla.org/inspector/dom-view;1",
     inDOMViewConstructor },
+#endif
 
   { "Deep Tree Walker", 
     IN_DEEPTREEWALKER_CID, 
     "@mozilla.org/inspector/deep-tree-walker;1",
     inDeepTreeWalkerConstructor },
 
   { "Flasher", 
     IN_FLASHER_CID, 
--- a/layout/build/nsLayoutStatics.cpp
+++ b/layout/build/nsLayoutStatics.cpp
@@ -165,26 +165,27 @@ nsLayoutStatics::Initialize()
   }
 
   rv = nsTextFrameTextRunCache::Init();
   if (NS_FAILED(rv)) {
     NS_ERROR("Could not initialize textframe textrun cache");
     return rv;
   }
 
-#ifndef MOZ_NO_INSPECTOR_APIS
-  inDOMView::InitAtoms();
-#endif
-
 #ifdef MOZ_XUL
   rv = nsXULContentUtils::Init();
   if (NS_FAILED(rv)) {
     NS_ERROR("Could not initialize nsXULContentUtils");
     return rv;
   }
+
+#ifndef MOZ_NO_INSPECTOR_APIS
+  inDOMView::InitAtoms();
+#endif
+
 #endif
 
 #ifdef MOZ_MATHML
   nsMathMLOperators::AddRefTable();
 #endif
 
 #ifdef MOZ_SVG
   if (NS_SVGEnabled())
--- a/layout/inspector/src/Makefile.in
+++ b/layout/inspector/src/Makefile.in
@@ -47,36 +47,43 @@ LIBRARY_NAME = inspector_s
 LIBXUL_LIBRARY = 1
 
 REQUIRES	= xpcom \
 		  string \
 		  dom \
 		  gfx \
 		  layout \
 		  content \
-		  xul \
 		  widget \
 		  locale \
 		  necko \
 		  docshell \
 		  view \
 		  webshell \
 		  $(NULL)
 
 ifdef ACCESSIBILITY
 REQUIRES        += accessibility
 endif
 
 CPPSRCS= \
-  inDOMView.cpp \
   inDeepTreeWalker.cpp \
   inFlasher.cpp \
   inSearchLoop.cpp \
   inCSSValueSearch.cpp \
   inDOMUtils.cpp \
   inLayoutUtils.cpp \
 	$(NULL)
 
+ifdef MOZ_XUL
+REQUIRES += \
+  xul \
+  $(NULL)
+CPPSRCS += \
+  inDOMView.cpp \
+  $(NULL)
+endif
+
 FORCE_STATIC_LIB = 1
 # This library is used by other shared libs in a static build
 FORCE_USE_PIC = 1
 
 include $(topsrcdir)/config/rules.mk