bug 659722 - remove _IMPL_NS_LAYOUT r=bz
authorTrevor Saunders <trev.saunders@gmail.com>
Sat, 16 Mar 2013 00:31:38 -0400
changeset 141907 50b000502edadd181abc20575a099c05d2074636
parent 141906 cb5af54006d6455a796586a2766d7c9b9aea6450
child 141908 fd936ec22d08b07e5590bdd552fde8db73453a81
push id32280
push usertrev.saunders@gmail.com
push dateFri, 09 Aug 2013 19:06:27 +0000
treeherdermozilla-inbound@fd936ec22d08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs659722
milestone26.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 659722 - remove _IMPL_NS_LAYOUT r=bz
content/base/public/nsINode.h
content/base/src/Makefile.in
content/canvas/src/Makefile.in
content/events/src/Makefile.in
content/html/content/src/Makefile.in
content/html/document/src/Makefile.in
content/mathml/content/src/Makefile.in
content/media/Makefile.in
content/smil/Makefile.in
content/svg/content/src/Makefile.in
content/svg/document/src/Makefile.in
content/xbl/src/Makefile.in
content/xml/content/src/Makefile.in
content/xml/document/src/Makefile.in
content/xslt/src/xpath/Makefile.in
content/xslt/src/xslt/Makefile.in
content/xul/content/src/Makefile.in
content/xul/document/src/Makefile.in
content/xul/templates/src/Makefile.in
docshell/base/nsDocShell.cpp
dom/base/nsDOMClassInfoID.h
dom/base/nsIDOMClassInfo.h
dom/base/nsPIDOMWindow.h
dom/devicestorage/Makefile.in
dom/dom-config.mk
dom/indexedDB/Makefile.in
dom/indexedDB/ipc/Makefile.in
dom/ipc/TabChild.h
dom/src/geolocation/Makefile.in
dom/src/json/Makefile.in
dom/src/jsurl/nsJSProtocolHandler.cpp
dom/src/notification/Makefile.in
dom/src/offline/Makefile.in
dom/src/storage/Makefile.in
editor/libeditor/html/Makefile.in
embedding/components/windowwatcher/src/nsWindowWatcher.cpp
js/xpconnect/src/Makefile.in
layout/base/Makefile.in
layout/base/nsIPresShell.h
layout/base/nsPresContext.h
layout/build/Makefile.in
layout/forms/Makefile.in
layout/generic/Makefile.in
layout/generic/nsBlockFrame.h
layout/generic/nsIFrame.h
layout/inspector/src/Makefile.in
layout/mathml/Makefile.in
layout/printing/Makefile.in
layout/style/Declaration.h
layout/style/Makefile.in
layout/style/nsStyleSet.h
layout/style/test/Makefile.in
layout/svg/Makefile.in
layout/tables/Makefile.in
layout/xul/base/src/Makefile.in
layout/xul/grid/Makefile.in
layout/xul/tree/Makefile.in
view/src/Makefile.in
--- a/content/base/public/nsINode.h
+++ b/content/base/public/nsINode.h
@@ -941,17 +941,17 @@ public:
     }
     else {
       UnsetFlags(NODE_IS_EDITABLE);
     }
   }
 
   bool IsEditable() const
   {
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
     return IsEditableInternal();
 #else
     return IsEditableExternal();
 #endif
   }
 
   /**
    * Returns true if |this| or any of its ancestors is native anonymous.
--- a/content/base/src/Makefile.in
+++ b/content/base/src/Makefile.in
@@ -46,17 +46,16 @@ LOCAL_INCLUDES += \
   -I$(topsrcdir)/layout/generic \
   -I$(topsrcdir)/layout/style \
   -I$(topsrcdir)/layout/svg \
   -I$(topsrcdir)/layout/xul/base/src \
   -I$(topsrcdir)/netwerk/base/src \
   -I$(topsrcdir)/js/xpconnect/wrappers \
   $(NULL)
 
-DEFINES += -D_IMPL_NS_LAYOUT
 DEFINES += -DHB_DONT_DEFINE_STDINT
 
 # gcc requires -msse2 for this file since it uses SSE2 intrinsics.  (See bug
 # 585538 comment 12.)
 ifneq (,$(INTEL_ARCHITECTURE))
 ifdef GNU_CC
 nsTextFragmentSSE2.$(OBJ_SUFFIX): CXXFLAGS+=-msse2
 endif
--- a/content/canvas/src/Makefile.in
+++ b/content/canvas/src/Makefile.in
@@ -31,10 +31,8 @@ INCLUDES	+= \
 		-I$(srcdir)/../../../layout/style \
 		-I$(srcdir)/../../../layout/generic \
 		-I$(srcdir)/../../base/src \
 		-I$(srcdir)/../../html/content/src \
 		-I$(srcdir)/../../../js/xpconnect/src \
 		-I$(srcdir)/../../../dom/base \
 		-I$(topsrcdir)/content/xul/content/src \
 		$(NULL)
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/events/src/Makefile.in
+++ b/content/events/src/Makefile.in
@@ -33,15 +33,13 @@ LOCAL_INCLUDES	+= \
              $(NULL)
 
 ifdef MOZ_B2G_RIL
 LOCAL_INCLUDES += \
               -I$(srcdir)/../../../dom/wifi \
               $(NULL)
 endif
 
-DEFINES += -D_IMPL_NS_LAYOUT
-
 ifdef MOZ_JSDEBUGGER
 DEFINES += -DMOZ_JSDEBUGGER
 endif
 
 
--- a/content/html/content/src/Makefile.in
+++ b/content/html/content/src/Makefile.in
@@ -33,12 +33,8 @@ INCLUDES	+= \
 		-I$(srcdir)/../../../../editor/libeditor/base \
 		-I$(srcdir)/../../../../editor/libeditor/text \
 		-I$(srcdir)/../../../../editor/txmgr/src \
 		-I$(srcdir)/../../../../netwerk/base/src \
 		-I$(srcdir) \
 		-I$(topsrcdir)/xpcom/ds \
 		-I$(topsrcdir)/content/media/ \
 		$(NULL)
-
-DEFINES		+= \
-		-D_IMPL_NS_LAYOUT \
-		$(NULL)
--- a/content/html/document/src/Makefile.in
+++ b/content/html/document/src/Makefile.in
@@ -20,10 +20,8 @@ LOCAL_INCLUDES += \
 		-I$(srcdir)/../../../base/src \
 		-I$(srcdir)/../../../events/src \
 		-I$(srcdir)/../../content/src \
 		-I$(topsrcdir)/layout/style \
 		-I$(topsrcdir)/dom/base \
 		-I$(topsrcdir)/caps/include \
 		-I$(topsrcdir)/xpcom/ds \
 		$(NULL)
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/mathml/content/src/Makefile.in
+++ b/content/mathml/content/src/Makefile.in
@@ -17,10 +17,8 @@ FAIL_ON_WARNINGS = 1
 include $(topsrcdir)/config/config.mk
 
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 
 INCLUDES += \
   -I$(srcdir)/../../../base/src \
   $(NULL)
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/media/Makefile.in
+++ b/content/media/Makefile.in
@@ -19,11 +19,10 @@ include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 
 INCLUDES  += \
   -I$(topsrcdir)/content/base/src \
   -I$(topsrcdir)/layout/generic \
   -I$(topsrcdir)/layout/xul/base/src \
   $(NULL)
 
-DEFINES  += -D_IMPL_NS_LAYOUT
 CFLAGS   += $(GSTREAMER_CFLAGS)
 CXXFLAGS += $(GSTREAMER_CFLAGS)
--- a/content/smil/Makefile.in
+++ b/content/smil/Makefile.in
@@ -18,10 +18,8 @@ include $(topsrcdir)/config/config.mk
 
 INCLUDES += 	\
 		-I$(srcdir)/../base/src \
 		-I$(srcdir)/../../layout/style \
 		-I$(srcdir)/../events/src \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/svg/content/src/Makefile.in
+++ b/content/svg/content/src/Makefile.in
@@ -27,10 +27,8 @@ INCLUDES += 	\
 		-I$(srcdir)/../../../../layout/xul/base/src \
 		-I$(srcdir)/../../../../layout/svg \
 		-I$(srcdir)/../../../../layout/style \
 		-I$(srcdir)/../../../events/src \
 		-I$(srcdir)/../../../html/content/src \
 		-I$(topsrcdir)/content/xbl/src \
 		-I$(srcdir)/../../../smil \
 		$(NULL)
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/svg/document/src/Makefile.in
+++ b/content/svg/document/src/Makefile.in
@@ -20,10 +20,8 @@ INCLUDES	+= \
 		-I$(srcdir)/../../../xml/document/src \
 		-I$(srcdir)/../../../html/document/src \
 		-I$(srcdir)/../../../../layout/style \
 		-I$(srcdir)/../../../base/src \
 		-I$(srcdir)/../../../events/src \
 		-I$(topsrcdir)/xpcom/ds \
 		-I$(topsrcdir)/content/svg/content/src \
 		$(NULL)
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/xbl/src/Makefile.in
+++ b/content/xbl/src/Makefile.in
@@ -23,10 +23,8 @@ LOCAL_INCLUDES	= \
 		-I$(srcdir)/../../xml/document/src \
 		-I$(srcdir)/../../xul/content/src \
 		-I$(srcdir)/../../xul/document/src \
 		-I$(srcdir)/../../events/src \
 		-I$(srcdir)/../../../layout/style \
 		-I$(srcdir)/../../../dom/base \
 		-I$(topsrcdir)/xpcom/ds \
 		$(NULL)
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/xml/content/src/Makefile.in
+++ b/content/xml/content/src/Makefile.in
@@ -23,10 +23,8 @@ INCLUDES	+= \
 EXPORT_RESOURCE_CONTENT = \
 		$(srcdir)/htmlmathml-f.ent \
 		$(NULL)
 libs::
 	$(INSTALL) $(EXPORT_RESOURCE_CONTENT) $(DIST)/bin/res/dtd
 
 install::
 	$(SYSINSTALL) $(IFLAGS1) $(EXPORT_RESOURCE_CONTENT) $(DESTDIR)$(mozappdir)/res/dtd
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/xml/document/src/Makefile.in
+++ b/content/xml/document/src/Makefile.in
@@ -22,10 +22,8 @@ LOCAL_INCLUDES	= \
 		-I$(srcdir)/../../../../layout/style \
 		-I$(srcdir)/../../../base/src \
 		-I$(srcdir)/../../../xul/content/src \
 		-I$(srcdir)/../../../events/src \
 		-I$(srcdir)/../../../../dom/base \
 		-I$(srcdir)/../../../../caps/include \
 		-I$(topsrcdir)/xpcom/ds \
 		$(NULL)
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/xslt/src/xpath/Makefile.in
+++ b/content/xslt/src/xpath/Makefile.in
@@ -15,10 +15,8 @@ FAIL_ON_WARNINGS = 1
 include $(topsrcdir)/config/rules.mk
 
 INCLUDES += \
 	-I$(srcdir)/../base \
 	-I$(srcdir)/../xml \
 	-I$(srcdir) \
 	-I$(srcdir)/../xslt \
 	$(NULL)
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/xslt/src/xslt/Makefile.in
+++ b/content/xslt/src/xslt/Makefile.in
@@ -21,10 +21,8 @@ include $(topsrcdir)/config/rules.mk
 
 INCLUDES += \
 	-I$(srcdir) \
 	-I$(srcdir)/../base \
 	-I$(srcdir)/../xml \
 	-I$(srcdir)/../xpath \
 	-I$(srcdir)/../../../base/src \
 	$(NULL)
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/xul/content/src/Makefile.in
+++ b/content/xul/content/src/Makefile.in
@@ -29,10 +29,8 @@ LOCAL_INCLUDES	= \
 	-I$(srcdir)/../../../../layout/generic \
 	-I$(srcdir)/../../../../layout/style \
 	-I$(srcdir)/../../../../layout/xul/base/src \
 	-I$(srcdir)/../../../html/content/src \
 	-I$(srcdir)/../../../events/src \
 	-I$(srcdir)/../../../xbl/src \
 	-I$(topsrcdir)/xpcom/ds \
 	$(NULL)
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/xul/document/src/Makefile.in
+++ b/content/xul/document/src/Makefile.in
@@ -24,10 +24,8 @@ LOCAL_INCLUDES	= -I$(srcdir)/../../../ba
 		  -I$(srcdir)/../../../../layout/style \
 		  -I$(srcdir)/../../../../layout/xul/base/src \
 		  -I$(srcdir)/../../../xml/document/src \
 		  -I$(srcdir)/../../../xbl/src \
 		  -I$(srcdir)/../../../events/src \
 		  -I$(topsrcdir)/xpcom/ds \
 		  -I$(topsrcdir)/dom/base \
 		  $(NULL)
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/xul/templates/src/Makefile.in
+++ b/content/xul/templates/src/Makefile.in
@@ -15,10 +15,8 @@ LIBXUL_LIBRARY	= 1
 
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES	= -I$(srcdir)/../../../base/src \
 		  -I$(srcdir)/../../content/src \
 		  -I$(srcdir)/../../../../dom/base \
 		  -I$(srcdir)/../../../../layout/xul/tree/ \
 		  $(NULL)
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -4129,17 +4129,17 @@ nsDocShell::LoadURI(const PRUnichar * aU
 
     PopupControlState popupState;
     if (aLoadFlags & LOAD_FLAGS_ALLOW_POPUPS) {
         popupState = openAllowed;
         aLoadFlags &= ~LOAD_FLAGS_ALLOW_POPUPS;
     } else {
         popupState = openOverridden;
     }
-    nsAutoPopupStatePusher statePusher(mScriptGlobal, popupState);
+    nsAutoPopupStatePusher statePusher(popupState);
 
     // Don't pass certain flags that aren't needed and end up confusing
     // ConvertLoadTypeToDocShellLoadInfo.  We do need to ensure that they are
     // passed to LoadURI though, since it uses them.
     uint32_t extraFlags = (aLoadFlags & EXTRA_LOAD_FLAGS);
     aLoadFlags &= ~EXTRA_LOAD_FLAGS;
 
     nsCOMPtr<nsIDocShellLoadInfo> loadInfo;
@@ -12118,18 +12118,17 @@ public:
                    nsIURI* aURI,
                    const PRUnichar* aTargetSpec,
                    const nsAString& aFileName,
                    nsIInputStream* aPostDataStream,
                    nsIInputStream* aHeadersDataStream,
                    bool aIsTrusted);
 
   NS_IMETHOD Run() {
-    nsRefPtr<nsGlobalWindow> window = mHandler->mScriptGlobal.get();
-    nsAutoPopupStatePusher popupStatePusher(window, mPopupState);
+    nsAutoPopupStatePusher popupStatePusher(mPopupState);
 
     nsCxPusher pusher;
     if (mIsTrusted || pusher.Push(mContent)) {
       mHandler->OnLinkClickSync(mContent, mURI,
                                 mTargetSpec.get(), mFileName,
                                 mPostDataStream, mHeadersDataStream,
                                 nullptr, nullptr);
     }
--- a/dom/base/nsDOMClassInfoID.h
+++ b/dom/base/nsDOMClassInfoID.h
@@ -76,17 +76,17 @@ namespace mozilla {
 namespace dom {
 class Element;
 class EventTarget;
 } // namespace dom
 } // namespace mozilla
 
 #define DOMCI_CASTABLE_NODECL_INTERFACE DOMCI_CASTABLE_INTERFACE
 
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
 
 #define DOMCI_CLASS(_dom_class)                                               \
   extern const uint32_t kDOMClassInfo_##_dom_class##_interfaces;
 
 #include "nsDOMClassInfoClasses.h"
 
 #undef DOMCI_CLASS
 
@@ -162,11 +162,11 @@ NS_GetDOMClassInfoInstance(nsDOMClassInf
       return NS_ERROR_OUT_OF_MEMORY;                                          \
     }                                                                         \
   } else
 
 #else
 
 // See nsIDOMClassInfo.h
 
-#endif // _IMPL_NS_LAYOUT
+#endif // MOZILLA_INTERNAL_API
 
 #endif // nsDOMClassInfoID_h__
--- a/dom/base/nsIDOMClassInfo.h
+++ b/dom/base/nsIDOMClassInfo.h
@@ -29,17 +29,17 @@
    nsIXPCScriptable::WANT_PRECREATE)
 
 #define DOM_DEFAULT_SCRIPTABLE_FLAGS                                       \
   (DEFAULT_SCRIPTABLE_FLAGS |                                              \
    nsIXPCScriptable::DONT_ENUM_QUERY_INTERFACE |                           \
    nsIXPCScriptable::CLASSINFO_INTERFACES_ONLY)
 
 
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
 
 // See nsDOMClassInfoID.h
 
 #else
 
 #define NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(_class)                       \
   if (aIID.Equals(NS_GET_IID(nsIClassInfo)) ||                             \
       aIID.Equals(NS_GET_IID(nsXPCClassInfo))) {                           \
@@ -52,17 +52,17 @@
       *aInstancePtr = nullptr;                                              \
       return rv;                                                           \
     }                                                                      \
                                                                            \
     foundInterface =                                                       \
       sof->GetClassInfoInstance(eDOMClassInfo_##_class##_id);              \
   } else
 
-#endif /* _IMPL_NS_LAYOUT */
+#endif /* MOZILLA_INTERNAL_API */
 
 // Looks up the nsIClassInfo for a class name registered with the 
 // nsScriptNamespaceManager. Remember to release NS_CLASSINFO_NAME(_class)
 // (eg. when your module unloads).
 #define NS_INTERFACE_MAP_ENTRY_EXTERNAL_DOM_CLASSINFO(_class)              \
   if (aIID.Equals(NS_GET_IID(nsIClassInfo)) ||                             \
       aIID.Equals(NS_GET_IID(nsXPCClassInfo))) {                           \
     extern nsISupports *NS_CLASSINFO_NAME(_class);                         \
--- a/dom/base/nsPIDOMWindow.h
+++ b/dom/base/nsPIDOMWindow.h
@@ -722,17 +722,17 @@ protected:
   // This is only used by the inner window. Set to true once we've sent
   // the (chrome|content)-document-global-created notification.
   bool mHasNotifiedGlobalCreated;
 };
 
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMWindow, NS_PIDOMWINDOW_IID)
 
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
 PopupControlState
 PushPopupControlState(PopupControlState aState, bool aForce);
 
 void
 PopPopupControlState(PopupControlState aState);
 
 #define NS_AUTO_POPUP_STATE_PUSHER nsAutoPopupStatePusherInternal
 #else
@@ -743,17 +743,17 @@ PopPopupControlState(PopupControlState a
 // state. Note that this class looks different from within code that's
 // part of the layout library than it does in code outside the layout
 // library.  We give the two object layouts different names so the symbols
 // don't conflict, but code should always use the name
 // |nsAutoPopupStatePusher|.
 class NS_AUTO_POPUP_STATE_PUSHER
 {
 public:
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
   NS_AUTO_POPUP_STATE_PUSHER(PopupControlState aState, bool aForce = false)
     : mOldState(::PushPopupControlState(aState, aForce))
   {
   }
 
   ~NS_AUTO_POPUP_STATE_PUSHER()
   {
     PopPopupControlState(mOldState);
@@ -771,17 +771,17 @@ public:
   {
     if (mWindow) {
       mWindow->PopPopupControlState(mOldState);
     }
   }
 #endif
 
 protected:
-#ifndef _IMPL_NS_LAYOUT
+#ifndef MOZILLA_INTERNAL_API
   nsCOMPtr<nsPIDOMWindow> mWindow;
 #endif
   PopupControlState mOldState;
 
 private:
   // Hide so that this class can only be stack-allocated
   static void* operator new(size_t /*size*/) CPP_THROW_NEW { return nullptr; }
   static void operator delete(void* /*memory*/) {}
--- a/dom/devicestorage/Makefile.in
+++ b/dom/devicestorage/Makefile.in
@@ -20,11 +20,8 @@ LOCAL_INCLUDES = \
 		-I$(topsrcdir)/dom/ipc \
 		-I$(topsrcdir)/content/base/src \
 		-I$(topsrcdir)/content/events/src \
 		$(NULL)
 
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
-
-DEFINES += -D_IMPL_NS_LAYOUT
-
--- a/dom/dom-config.mk
+++ b/dom/dom-config.mk
@@ -56,9 +56,8 @@ ifdef MOZ_B2G_BT
 DOM_SRCDIRS += dom/bluetooth
 endif
 
 ifdef MOZ_WEBSPEECH
 DOM_SRCDIRS += content/media/webspeech
 endif
 
 LOCAL_INCLUDES += $(DOM_SRCDIRS:%=-I$(topsrcdir)/%)
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/dom/indexedDB/Makefile.in
+++ b/dom/indexedDB/Makefile.in
@@ -19,16 +19,15 @@ LOCAL_INCLUDES = \
   -I$(topsrcdir)/content/events/src \
   -I$(topsrcdir)/db/sqlite3/src \
   -I$(topsrcdir)/dom/base \
   -I$(topsrcdir)/dom/src/storage \
   -I$(topsrcdir)/dom/quota \
   -I$(topsrcdir)/xpcom/build \
   $(NULL)
 
-DEFINES += -D_IMPL_NS_LAYOUT
 
 # Make sure to quickstub as much as possible here! See
 # js/xpconnect/src/dom_quickstubs.qsconf.
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 
--- a/dom/indexedDB/ipc/Makefile.in
+++ b/dom/indexedDB/ipc/Makefile.in
@@ -14,18 +14,16 @@ include $(DEPTH)/config/autoconf.mk
 LIBRARY_NAME = dom_indexeddb_ipc_s
 LIBXUL_LIBRARY = 1
 
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/dom/indexedDB \
   -I$(topsrcdir)/content/events/src \
   $(NULL)
 
-DEFINES += -D_IMPL_NS_LAYOUT
-
 MOCHITEST_FILES = test_ipc.html
 
 # bug: 866734 - move XPCSHEL_TESTS to moz.build
 
 # Need to enable these tests sometime soon.
 #DISABLED_XPCSHELL_TESTS = unit
 
 # We're copying tests from another directory so this check is wrong for us.
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -2,19 +2,17 @@
 /* vim: set sw=4 ts=8 et tw=80 : */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_TabChild_h
 #define mozilla_dom_TabChild_h
 
-#ifndef _IMPL_NS_LAYOUT
 #include "mozilla/dom/PBrowserChild.h"
-#endif
 #ifdef DEBUG
 #include "PCOMContentPermissionRequestChild.h"
 #endif /* DEBUG */
 #include "nsIWebNavigation.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsEventDispatcher.h"
 #include "nsIWebBrowserChrome2.h"
--- a/dom/src/geolocation/Makefile.in
+++ b/dom/src/geolocation/Makefile.in
@@ -42,10 +42,8 @@ endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 LOCAL_INCLUDES  += -I$(topsrcdir)/dom/system/mac
 endif
 
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/dom/src/json/Makefile.in
+++ b/dom/src/json/Makefile.in
@@ -12,11 +12,9 @@ FAIL_ON_WARNINGS := 1
 include $(DEPTH)/config/autoconf.mk
 
 LIBXUL_LIBRARY = 1
 
 LOCAL_INCLUDES = \
 		-I$(srcdir)/../base \
 		-I$(topsrcdir)/content/events/src
 
-DEFINES += -D_IMPL_NS_LAYOUT
-
 include $(topsrcdir)/config/rules.mk
--- a/dom/src/jsurl/nsJSProtocolHandler.cpp
+++ b/dom/src/jsurl/nsJSProtocolHandler.cpp
@@ -192,29 +192,28 @@ nsresult nsJSThunk::EvaluateScript(nsICh
     }
 
     // Get the global object we should be running on.
     nsIScriptGlobalObject* global = GetGlobalObject(aChannel);
     if (!global) {
         return NS_ERROR_FAILURE;
     }
 
-    nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(global));
-
     // Sandboxed document check: javascript: URI's are disabled
     // in a sandboxed document unless 'allow-scripts' was specified.
     nsIDocument* doc = aOriginalInnerWindow->GetExtantDoc();
     if (doc && (doc->GetSandboxFlags() & SANDBOXED_SCRIPTS)) {
         return NS_ERROR_DOM_RETVAL_UNDEFINED;
     }
 
     // Push our popup control state
-    nsAutoPopupStatePusher popupStatePusher(win, aPopupState);
+    nsAutoPopupStatePusher popupStatePusher(aPopupState);
 
     // Make sure we still have the same inner window as we used to.
+    nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(global);
     nsPIDOMWindow *innerWin = win->GetCurrentInnerWindow();
 
     if (innerWin != aOriginalInnerWindow) {
         return NS_ERROR_UNEXPECTED;
     }
 
     nsCOMPtr<nsIScriptGlobalObject> innerGlobal = do_QueryInterface(innerWin);
 
--- a/dom/src/notification/Makefile.in
+++ b/dom/src/notification/Makefile.in
@@ -19,10 +19,8 @@ LOCAL_INCLUDES = \
   -I$(topsrcdir)/dom/ipc \
   -I$(topsrcdir)/content/base/src \
   -I$(topsrcdir)/content/events/src \
   $(NULL)
 
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/dom/src/offline/Makefile.in
+++ b/dom/src/offline/Makefile.in
@@ -13,11 +13,9 @@ include $(DEPTH)/config/autoconf.mk
 LIBXUL_LIBRARY = 1
 FAIL_ON_WARNINGS := 1
 
 LOCAL_INCLUDES = \
 		-I$(topsrcdir)/dom/base \
 		-I$(topsrcdir)/content/base/src \
 		-I$(topsrcdir)/content/events/src
 
-DEFINES += -D_IMPL_NS_LAYOUT
-
 include $(topsrcdir)/config/rules.mk
--- a/dom/src/storage/Makefile.in
+++ b/dom/src/storage/Makefile.in
@@ -14,17 +14,15 @@ include $(DEPTH)/config/autoconf.mk
 LIBRARY_NAME   = jsdomstorage_s
 MSVC_ENABLE_PGO := 1
 LIBXUL_LIBRARY = 1
 
 LOCAL_INCLUDES = \
                 -I$(topsrcdir)/dom/base \
 		-I$(topsrcdir)/content/events/src
 
-DEFINES += -D_IMPL_NS_LAYOUT
-
 ifdef ENABLE_TESTS
 DEFINES += -DDOM_STORAGE_TESTS
 endif
 
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
--- a/editor/libeditor/html/Makefile.in
+++ b/editor/libeditor/html/Makefile.in
@@ -15,18 +15,16 @@ LIBXUL_LIBRARY	= 1
 
 
 # Building the full blown HTML Editor  so add its source files and objects:
 
 ifdef ENABLE_EDITOR_API_LOG
 DEFINES += -DENABLE_EDITOR_API_LOG
 endif
 
-DEFINES += -D_IMPL_NS_LAYOUT
-
 include $(topsrcdir)/config/rules.mk
 
 INCLUDES        += -I$(topsrcdir)/editor/libeditor/base \
                    -I$(topsrcdir)/editor/libeditor/text \
                    -I$(topsrcdir)/editor/txmgr/src \
                    -I$(topsrcdir)/content/base/src \
                    -I$(topsrcdir)/layout/style \
                    $(NULL)
--- a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp
+++ b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp
@@ -961,27 +961,20 @@ nsWindowWatcher::OpenWindowInternal(nsID
     nsCOMPtr<nsIDocShellTreeOwner> newTreeOwner;
     newDocShellItem->GetTreeOwner(getter_AddRefs(newTreeOwner));
     nsCOMPtr<nsIWebBrowserChrome> newChrome(do_GetInterface(newTreeOwner));
 
     // Throw an exception here if no web browser chrome is available,
     // we need that to show a modal window.
     NS_ENSURE_TRUE(newChrome, NS_ERROR_NOT_AVAILABLE);
 
-    nsCOMPtr<nsPIDOMWindow> modalContentWindow;
-
     // Dispatch dialog events etc, but we only want to do that if
     // we're opening a modal content window (the helper classes are
     // no-ops if given no window), for chrome dialogs we don't want to
     // do any of that (it's done elsewhere for us).
-
-    if (windowIsModalContentDialog) {
-      modalContentWindow = do_QueryInterface(*_retval);
-    }
-
     nsAutoWindowStateHelper windowStateHelper(aParent);
 
     if (!windowStateHelper.DefaultEnabled()) {
       // Default to cancel not opening the modal window.
       NS_RELEASE(*_retval);
 
       return NS_OK;
     }
@@ -995,17 +988,17 @@ nsWindowWatcher::OpenWindowInternal(nsID
         if (parentWidget) {
           parentWidget->SetModal(true);
         }
       }
     } else { 
       // Reset popup state while opening a modal dialog, and firing
       // events about the dialog, to prevent the current state from
       // being active the whole time a modal dialog is open.
-      nsAutoPopupStatePusher popupStatePusher(modalContentWindow, openAbused);
+      nsAutoPopupStatePusher popupStatePusher(openAbused);
   
       newChrome->ShowAsModal();
     }
   }
 
   return NS_OK;
 }
 
--- a/js/xpconnect/src/Makefile.in
+++ b/js/xpconnect/src/Makefile.in
@@ -167,10 +167,8 @@ GARBAGE += \
 		event_impl_gen.conf \
 		xpidl_debug \
 		$(MDDEPDIR)/dom_qsgen.pp \
 		$(MDDEPDIR)/dombindingsgen.pp \
 		$(MDDEPDIR)/dictionary_helper_gen.pp \
 		$(MDDEPDIR)/event_impl_gen.pp \
 		$(wildcard $(topsrcdir)/other-licenses/ply/ply/*.pyc) \
 		$(NULL)
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/layout/base/Makefile.in
+++ b/layout/base/Makefile.in
@@ -36,17 +36,16 @@ LOCAL_INCLUDES += \
 		-I$(srcdir)/../../content/svg/content/src \
 		-I$(topsrcdir)/xpcom/ds \
 		-I$(srcdir)/../svg \
 		-I$(srcdir)/../mathml \
 		$(NULL)
 
 CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)
 
-DEFINES += -D_IMPL_NS_LAYOUT
 DEFINES += -DHB_DONT_DEFINE_STDINT
 
 ifndef MOZ_XUL
 nsIBoxObject.idl: %: $(topsrcdir)/layout/xul/base/public/%
 	$(INSTALL) $^ .
 nsPIBoxObject.h: %: $(topsrcdir)/layout/xul/base/public/%
 	$(INSTALL) $^ .
 nsBoxObject.cpp: %: $(topsrcdir)/layout/xul/base/src/%
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -298,17 +298,17 @@ public:
    * Set the document accessible for this pres shell.
    */
   void SetDocAccessible(mozilla::a11y::DocAccessible* aDocAccessible)
   {
     mDocAccessible = aDocAccessible;
   }
 #endif
 
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
   nsStyleSet* StyleSet() const { return mStyleSet; }
 
   nsCSSFrameConstructor* FrameConstructor() const { return mFrameConstructor; }
 
   nsFrameManager* FrameManager() const {
     // reinterpret_cast is valid since nsFrameManager does not add
     // any members over nsFrameManagerBase.
     return reinterpret_cast<nsFrameManager*>
@@ -332,17 +332,17 @@ public:
    * you need to do that, call FlushPendingNotifications to flush out style
    * reresolves.
    * // XXXbz why do we have this on the interface anyway?  The only consumer
    * is calling AddOverrideStyleSheet/RemoveOverrideStyleSheet, and I think
    * those should just handle reconstructing style data...
    */
   virtual NS_HIDDEN_(void) ReconstructStyleDataExternal();
   NS_HIDDEN_(void) ReconstructStyleDataInternal();
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
   void ReconstructStyleData() { ReconstructStyleDataInternal(); }
 #else
   void ReconstructStyleData() { ReconstructStyleDataExternal(); }
 #endif
 
   /** Setup all style rules required to implement preferences
    * - used for background/text/link colors and link underlining
    *    may be extended for any prefs that are implemented via style rules
@@ -413,17 +413,17 @@ public:
    */
   virtual bool IsLayoutFlushObserver() = 0;
 
   /**
    * This calls through to the frame manager to get the root frame.
    */
   virtual NS_HIDDEN_(nsIFrame*) GetRootFrameExternal() const;
   nsIFrame* GetRootFrame() const {
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
     return mFrameManager->GetRootFrame();
 #else
     return GetRootFrameExternal();
 #endif
   }
 
   /*
    * Get root scroll frame from FrameManager()->GetRootFrame().
@@ -1021,29 +1021,29 @@ public:
                                                         nsIntPoint& aPoint,
                                                         nsIntRect* aScreenRect) = 0;
 
   void AddWeakFrameInternal(nsWeakFrame* aWeakFrame);
   virtual void AddWeakFrameExternal(nsWeakFrame* aWeakFrame);
 
   void AddWeakFrame(nsWeakFrame* aWeakFrame)
   {
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
     AddWeakFrameInternal(aWeakFrame);
 #else
     AddWeakFrameExternal(aWeakFrame);
 #endif
   }
 
   void RemoveWeakFrameInternal(nsWeakFrame* aWeakFrame);
   virtual void RemoveWeakFrameExternal(nsWeakFrame* aWeakFrame);
 
   void RemoveWeakFrame(nsWeakFrame* aWeakFrame)
   {
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
     RemoveWeakFrameInternal(aWeakFrame);
 #else
     RemoveWeakFrameExternal(aWeakFrame);
 #endif
   }
 
 #ifdef DEBUG
   nsIFrame* GetDrawEventTargetFrame() { return mDrawEventTargetFrame; }
@@ -1374,26 +1374,26 @@ protected:
    * This value is cached after computation, as the computation is somewhat
    * expensive.
    */
   void RecomputeFontSizeInflationEnabled();
 
 public:
   bool AddRefreshObserver(nsARefreshObserver* aObserver,
                             mozFlushType aFlushType) {
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
     return AddRefreshObserverInternal(aObserver, aFlushType);
 #else
     return AddRefreshObserverExternal(aObserver, aFlushType);
 #endif
   }
 
   bool RemoveRefreshObserver(nsARefreshObserver* aObserver,
                                mozFlushType aFlushType) {
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
     return RemoveRefreshObserverInternal(aObserver, aFlushType);
 #else
     return RemoveRefreshObserverExternal(aObserver, aFlushType);
 #endif
   }
 
   /**
    * Initialize and shut down static variables.
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -236,18 +236,18 @@ public:
   nsIDocument* Document() const
   {
       NS_ASSERTION(!mShell || !mShell->GetDocument() ||
                    mShell->GetDocument() == mDocument,
                    "nsPresContext doesn't have the same document as nsPresShell!");
       return mDocument;
   }
 
-#ifdef _IMPL_NS_LAYOUT
-  nsStyleSet* StyleSet() { return PresShell()->StyleSet(); }
+#ifdef MOZILLA_INTERNAL_API
+  nsStyleSet* StyleSet() { return GetPresShell()->StyleSet(); }
 
   nsFrameManager* FrameManager()
     { return PresShell()->FrameManager(); }
 
   nsCSSFrameConstructor* FrameConstructor()
     { return PresShell()->FrameConstructor(); }
 
   nsTransitionManager* TransitionManager() { return mTransitionManager; }
@@ -298,17 +298,17 @@ public:
   NS_HIDDEN_(void) CompatibilityModeChanged();
 
   /**
    * Access the image animation mode for this context
    */
   uint16_t     ImageAnimationMode() const { return mImageAnimationMode; }
   virtual NS_HIDDEN_(void) SetImageAnimationModeExternal(uint16_t aMode);
   NS_HIDDEN_(void) SetImageAnimationModeInternal(uint16_t aMode);
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
   void SetImageAnimationMode(uint16_t aMode)
   { SetImageAnimationModeInternal(aMode); }
 #else
   void SetImageAnimationMode(uint16_t aMode)
   { SetImageAnimationModeExternal(aMode); }
 #endif
 
   /** 
@@ -426,17 +426,17 @@ public:
   uint8_t FocusRingWidth() const { return mFocusRingWidth; }
   bool GetFocusRingOnAnything() const { return mFocusRingOnAnything; }
   uint8_t GetFocusRingStyle() const { return mFocusRingStyle; }
 
   NS_HIDDEN_(void) SetContainer(nsISupports* aContainer);
 
   virtual NS_HIDDEN_(already_AddRefed<nsISupports>) GetContainerExternal() const;
   NS_HIDDEN_(already_AddRefed<nsISupports>) GetContainerInternal() const;
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
   already_AddRefed<nsISupports> GetContainer() const
   { return GetContainerInternal(); }
 #else
   already_AddRefed<nsISupports> GetContainer() const
   { return GetContainerExternal(); }
 #endif
 
   // XXX this are going to be replaced with set/get container
@@ -706,17 +706,17 @@ public:
 #ifdef IBMBIDI
   /**
    *  Check if bidi enabled (set depending on the presence of RTL
    *  characters or when default directionality is RTL).
    *  If enabled, we should apply the Unicode Bidi Algorithm
    *
    *  @lina 07/12/2000
    */
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
   bool BidiEnabled() const { return BidiEnabledInternal(); }
 #else
   bool BidiEnabled() const { return BidiEnabledExternal(); }
 #endif
   virtual bool BidiEnabledExternal() const;
   bool BidiEnabledInternal() const;
 
   /**
@@ -838,17 +838,17 @@ public:
   // Is this presentation in a chrome docshell?
   bool IsChrome() const
   {
     return mIsChromeIsCached ? mIsChrome : IsChromeSlow();
   }
 
   virtual void InvalidateIsChromeCacheExternal();
   void InvalidateIsChromeCacheInternal() { mIsChromeIsCached = false; }
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
   void InvalidateIsChromeCache()
   { InvalidateIsChromeCacheInternal(); }
 #else
   void InvalidateIsChromeCache()
   { InvalidateIsChromeCacheExternal(); }
 #endif
 
   // Public API for native theme code to get style internals.
@@ -868,17 +868,17 @@ public:
   // This method should be used instead of directly accessing mPaintFlashing,
   // as that value may be out of date when mPaintFlashingInitialized is false.
   bool GetPaintFlashing() const;
 
   bool             SupressingResizeReflow() const { return mSupressResizeReflow; }
   
   virtual NS_HIDDEN_(gfxUserFontSet*) GetUserFontSetExternal();
   NS_HIDDEN_(gfxUserFontSet*) GetUserFontSetInternal();
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
   gfxUserFontSet* GetUserFontSet() { return GetUserFontSetInternal(); }
 #else
   gfxUserFontSet* GetUserFontSet() { return GetUserFontSetExternal(); }
 #endif
 
   void FlushUserFontSet();
   void RebuildUserFontSet(); // asynchronously
 
--- a/layout/build/Makefile.in
+++ b/layout/build/Makefile.in
@@ -339,9 +339,8 @@ LOCAL_INCLUDES	+= -I$(topsrcdir)/dom/blu
 endif #}
 
 ifdef MOZ_WEBSPEECH #{
 LOCAL_INCLUDES	+= -I$(topsrcdir)/content/media/webspeech/synth
 endif #}
 
 LOCAL_INCLUDES	+= -I$(topsrcdir)/dom/camera
 
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/layout/forms/Makefile.in
+++ b/layout/forms/Makefile.in
@@ -22,9 +22,8 @@ LOCAL_INCLUDES	= \
 		-I$(srcdir)/../xul/base/src \
 		-I$(srcdir)/../../content/base/src \
 		-I$(srcdir)/../../content/html/content/src \
 		-I$(srcdir)/../../editor/libeditor/base \
 		-I$(srcdir)/../../editor/libeditor/text \
 		-I$(srcdir)/../../editor/txmgr/src \
 		$(NULL)
 
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/layout/generic/Makefile.in
+++ b/layout/generic/Makefile.in
@@ -50,9 +50,8 @@ CXXFLAGS += $(MOZ_QT_CFLAGS)
 endif
 
 libs::
 	$(INSTALL) $(RESOURCES_HTML) $(DIST)/bin/res/html
 
 install::
 	$(SYSINSTALL) $(IFLAGS1) $(RESOURCES_HTML) $(DESTDIR)$(mozappdir)/res/html
 
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/layout/generic/nsBlockFrame.h
+++ b/layout/generic/nsBlockFrame.h
@@ -381,26 +381,24 @@ protected:
   {
 #ifdef DEBUG
   InitDebugFlags();
 #endif
   }
   virtual ~nsBlockFrame();
 
 #ifdef DEBUG
-#ifdef _IMPL_NS_LAYOUT
   already_AddRefed<nsStyleContext> GetFirstLetterStyle(nsPresContext* aPresContext)
   {
     return aPresContext->StyleSet()->
       ProbePseudoElementStyle(mContent->AsElement(),
                               nsCSSPseudoElements::ePseudo_firstLetter,
                               mStyleContext);
   }
 #endif
-#endif
 
   NS_DECLARE_FRAME_PROPERTY(LineCursorProperty, nullptr)
   nsLineBox* GetLineCursor() {
     return (GetStateBits() & NS_BLOCK_HAS_LINE_CURSOR) ?
       static_cast<nsLineBox*>(Properties().Get(LineCursorProperty())) : nullptr;
   }
 
   nsLineBox* NewLineBox(nsIFrame* aFrame, bool aIsBlock) {
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -787,17 +787,17 @@ public:
   #define STYLE_STRUCT(name_, checkdata_cb_)                                  \
     const nsStyle##name_ * Style##name_ () const {                            \
       NS_ASSERTION(mStyleContext, "No style context found!");                 \
       return mStyleContext->Style##name_ ();                                  \
     }
   #include "nsStyleStructList.h"
   #undef STYLE_STRUCT
 
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
   /** Also forward GetVisitedDependentColor to the style context */
   nscolor GetVisitedDependentColor(nsCSSProperty aProperty)
     { return mStyleContext->GetVisitedDependentColor(aProperty); }
 #endif
 
   /**
    * These methods are to access any additional style contexts that
    * the frame may be holding. These are contexts that are children
@@ -3254,17 +3254,17 @@ private:
         shell->AddWeakFrame(this);
       } else {
         mFrame = nullptr;
       }
     }
   }
 
   void Init(nsIFrame* aFrame) {
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
     InitInternal(aFrame);
 #else
     InitExternal(aFrame);
 #endif
   }
 
   nsWeakFrame*  mPrev;
   nsIFrame*     mFrame;
--- a/layout/inspector/src/Makefile.in
+++ b/layout/inspector/src/Makefile.in
@@ -15,10 +15,8 @@ FAIL_ON_WARNINGS = 1
 
 LOCAL_INCLUDES	+= \
 		-I$(srcdir)/../../style \
 		-I$(topsrcdir)/content/base/src \
 		-I$(topsrcdir)/content/xbl/src \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/layout/mathml/Makefile.in
+++ b/layout/mathml/Makefile.in
@@ -54,9 +54,8 @@ math_properties = mathfont.properties
 $(DIST)/bin/res/fonts/$(math_properties) $(DESTDIR)$(mozappdir)/res/fonts/$(math_properties): $(math_properties) Makefile
 	test -d $(@D) || $(NSINSTALL) -D $(@D)
 	rm -f $@
 	$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py --marker=% $(DEFINES) $(ACDEFINES) $< > $@
 
 libs:: $(DIST)/bin/res/fonts/$(math_properties)
 install:: $(DESTDIR)$(mozappdir)/res/fonts/$(math_properties)
 
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/layout/printing/Makefile.in
+++ b/layout/printing/Makefile.in
@@ -14,9 +14,8 @@ FAIL_ON_WARNINGS = 1
 
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES += \
 		-I$(srcdir)/../base \
 		-I$(srcdir)/../../content/base/src \
 		$(NULL)
 
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/layout/style/Declaration.h
+++ b/layout/style/Declaration.h
@@ -11,18 +11,18 @@
 #ifndef mozilla_css_Declaration_h
 #define mozilla_css_Declaration_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/MemoryReporting.h"
 
 // This header is in EXPORTS because it's used in several places in content/,
 // but it's not really a public interface.
-#ifndef _IMPL_NS_LAYOUT
-#error "This file should only be included within the layout library"
+#ifndef MOZILLA_INTERNAL_API
+#error "This file should only be included within libxul"
 #endif
 
 #include "nsCSSDataBlock.h"
 #include "nsCSSProperty.h"
 #include "nsCSSProps.h"
 #include "nsStringFwd.h"
 #include "nsTArray.h"
 #include <stdio.h>
--- a/layout/style/Makefile.in
+++ b/layout/style/Makefile.in
@@ -50,9 +50,8 @@ GARBAGE	+= \
 	$(NULL)
 
 libs:: $(_FILES)
 	$(INSTALL) $^ $(DIST)/bin/res
 
 install:: $(_FILES)
 	$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/res
 
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/layout/style/nsStyleSet.h
+++ b/layout/style/nsStyleSet.h
@@ -455,17 +455,17 @@ class nsStyleSet
   // BeginReconstruct and EndReconstruct, but in case of bugs that cause
   // style contexts to exist too long, may last longer.
   nsTArray<nsRuleNode*> mOldRuleTrees;
 
   // whether font feature values lookup object needs initialization
   nsRefPtr<gfxFontFeatureValueSet> mFontFeatureValuesLookup;
 };
 
-#ifdef _IMPL_NS_LAYOUT
+#ifdef MOZILLA_INTERNAL_API
 inline
 void nsRuleNode::AddRef()
 {
   if (mRefCnt++ == 0 && !IsRoot()) {
     mPresContext->StyleSet()->RuleNodeInUse();
   }
 }
 
--- a/layout/style/test/Makefile.in
+++ b/layout/style/test/Makefile.in
@@ -233,17 +233,17 @@ MOCHITEST_FILES =	test_acid3_test46.html
 MOCHITEST_BROWSER_FILES = \
 		browser_bug453896.js \
 		bug453896_iframe.html \
 		media_queries_iframe.html \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
-DEFINES += -DMOZILLA_INTERNAL_API -D_IMPL_NS_LAYOUT
+DEFINES += -DMOZILLA_INTERNAL_API
 
 # FIXME: We don't seem to do auto-generated dependencies here.
 host_ListCSSProperties.$(OBJ_SUFFIX): $(srcdir)/../nsCSSPropList.h
 TestCSSPropertyLookup.$(OBJ_SUFFIX): $(srcdir)/../nsCSSProps.h $(srcdir)/../nsCSSKeywords.h
 
 css_properties.js: host_ListCSSProperties$(HOST_BIN_SUFFIX) css_properties_like_longhand.js Makefile
 	$(RM) $@
 	./host_ListCSSProperties$(HOST_BIN_SUFFIX) > $@
--- a/layout/svg/Makefile.in
+++ b/layout/svg/Makefile.in
@@ -29,9 +29,8 @@ LOCAL_INCLUDES	= \
 
 libs::
 	$(INSTALL) $(srcdir)/svg.css $(DIST)/bin/res
 
 install::
 	$(SYSINSTALL) $(IFLAGS1) $(srcdir)/svg.css $(DESTDIR)$(mozappdir)/res
 
 
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/layout/tables/Makefile.in
+++ b/layout/tables/Makefile.in
@@ -11,17 +11,17 @@ VPATH		= @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 MSVC_ENABLE_PGO := 1
 LIBXUL_LIBRARY	= 1
 FAIL_ON_WARNINGS = 1
 
 include $(topsrcdir)/config/rules.mk
 
-DEFINES         += -DDEBUG_TABLE_STRATEGY_off -D_IMPL_NS_LAYOUT
+DEFINES         += -DDEBUG_TABLE_STRATEGY_off
 
 LOCAL_INCLUDES	= \
 		-I$(srcdir)/../base \
 		-I$(srcdir)/../generic \
 		-I$(srcdir)/../style \
 		-I$(srcdir)/../xul/base/src \
 		-I$(srcdir)/../../content/html/content/src \
 		-I$(srcdir)/../../content/base/src \
--- a/layout/xul/base/src/Makefile.in
+++ b/layout/xul/base/src/Makefile.in
@@ -20,10 +20,8 @@ LOCAL_INCLUDES	= \
 		-I$(srcdir) \
 		-I$(srcdir)/../../../base \
 		-I$(srcdir)/../../../../content/base/src \
 		-I$(srcdir)/../../../../content/events/src \
 		-I$(srcdir)/../../../generic \
 		-I$(srcdir)/../../../style \
 		$(NULL)
 
-DEFINES += -D_IMPL_NS_LAYOUT
-
--- a/layout/xul/grid/Makefile.in
+++ b/layout/xul/grid/Makefile.in
@@ -17,10 +17,8 @@ LOCAL_INCLUDES	= \
 		-I$(srcdir) \
 		-I$(srcdir)/../base/src \
 		-I$(srcdir)/../../generic \
 		-I$(srcdir)/../../style \
 		-I$(srcdir)/../../forms \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/layout/xul/tree/Makefile.in
+++ b/layout/xul/tree/Makefile.in
@@ -20,10 +20,8 @@ LOCAL_INCLUDES	= \
 		-I$(srcdir)/../base/src \
 		-I$(srcdir)/../../base \
 		-I$(srcdir)/../../generic \
 		-I$(srcdir)/../../style \
 		-I$(srcdir)/../../forms \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
-
-DEFINES += -D_IMPL_NS_LAYOUT
--- a/view/src/Makefile.in
+++ b/view/src/Makefile.in
@@ -9,17 +9,15 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MSVC_ENABLE_PGO := 1
 LIBXUL_LIBRARY	= 1
 FAIL_ON_WARNINGS := 1
 
-DEFINES += -D_IMPL_NS_LAYOUT
-
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES  = \
                 -I$(srcdir)/../../content/events/src/ \
                 $(NULL)
 
 CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)