Bug 1156632 - Remove unused forward class declarations - patch 1 - dom/base, r=ehsan
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 22 Apr 2015 08:29:15 +0200
changeset 259370 73917a03e7347846cbc9a9f5da14a4c50f04fcde
parent 259369 25db40a4dd8ec36cecf48b46774f3f9b88ed3331
child 259371 29bf41172acdd5a120955f63983a6625dff84f5a
push id8007
push userraliiev@mozilla.com
push dateMon, 11 May 2015 19:23:16 +0000
treeherdermozilla-aurora@e2ce1aac996e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1156632
milestone40.0a1
Bug 1156632 - Remove unused forward class declarations - patch 1 - dom/base, r=ehsan
dom/base/DirectionalityUtils.h
dom/base/Element.h
dom/base/File.h
dom/base/ImportManager.h
dom/base/ShadowRoot.h
dom/base/ThirdPartyUtil.h
dom/base/URL.h
dom/base/WebSocket.h
dom/base/nsContentAreaDragDrop.h
dom/base/nsContentCreatorFunctions.h
dom/base/nsContentSink.h
dom/base/nsContentUtils.h
dom/base/nsDOMClassInfo.h
dom/base/nsDocument.h
dom/base/nsFrameLoader.h
dom/base/nsFrameMessageManager.h
dom/base/nsGenericDOMDataNode.h
dom/base/nsHostObjectProtocolHandler.h
dom/base/nsIAttribute.h
dom/base/nsIDOMScriptObjectFactory.h
dom/base/nsIDocument.h
dom/base/nsIDocumentObserver.h
dom/base/nsINode.h
dom/base/nsIScriptContext.h
dom/base/nsImageLoadingContent.h
dom/base/nsJSEnvironment.h
dom/base/nsMappedAttributes.h
dom/base/nsNameSpaceManager.h
dom/base/nsNodeUtils.h
dom/base/nsPIDOMWindow.h
dom/base/nsReferencedElement.h
dom/base/nsScriptNameSpaceManager.h
dom/base/nsTextFragment.h
dom/base/nsWindowRoot.h
dom/base/nsWrapperCache.h
dom/base/nsXMLContentSerializer.h
--- a/dom/base/DirectionalityUtils.h
+++ b/dom/base/DirectionalityUtils.h
@@ -5,18 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef DirectionalityUtils_h___
 #define DirectionalityUtils_h___
 
 #include "nscore.h"
 
 class nsIContent;
-class nsIDocument;
-class nsINode;
 class nsAString;
 class nsAttrValue;
 class nsTextNode;
 
 namespace mozilla {
 namespace dom {
 class Element;
 } // namespace dom
--- a/dom/base/Element.h
+++ b/dom/base/Element.h
@@ -32,26 +32,21 @@
 #include "mozilla/dom/DOMRect.h"
 #include "nsAttrValue.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/dom/BindingDeclarations.h"
 #include "mozilla/dom/WindowBinding.h"
 #include "mozilla/dom/ElementBinding.h"
 #include "Units.h"
 
-class nsIDOMEventListener;
 class nsIFrame;
 class nsIDOMMozNamedAttrMap;
-class nsIDOMCSSStyleDeclaration;
 class nsIURI;
-class nsIControllers;
-class nsEventChainVisitor;
 class nsIScrollableFrame;
 class nsAttrValueOrString;
-class ContentUnbinder;
 class nsContentList;
 class nsDOMSettableTokenList;
 class nsDOMTokenList;
 struct nsRect;
 class nsFocusManager;
 class nsGlobalWindow;
 class nsICSSDeclaration;
 class nsISMILAttr;
--- a/dom/base/File.h
+++ b/dom/base/File.h
@@ -24,20 +24,18 @@
 #include "nsIFile.h"
 #include "nsIMutable.h"
 #include "nsIXMLHttpRequest.h"
 #include "nsString.h"
 #include "nsTemporaryFileInputStream.h"
 #include "nsWrapperCache.h"
 #include "nsWeakReference.h"
 
-class nsDOMMultipartFile;
 class nsIFile;
 class nsIInputStream;
-class nsIClassInfo;
 
 #define FILEIMPL_IID \
   { 0xbccb3275, 0x6778, 0x4ac5, \
     { 0xaf, 0x03, 0x90, 0xed, 0x37, 0xad, 0xdf, 0x5d } }
 
 namespace mozilla {
 namespace dom {
 
--- a/dom/base/ImportManager.h
+++ b/dom/base/ImportManager.h
@@ -44,17 +44,16 @@
 #include "nsIDOMEventListener.h"
 #include "nsIStreamListener.h"
 #include "nsIWeakReferenceUtils.h"
 #include "nsRefPtrHashtable.h"
 #include "nsScriptLoader.h"
 #include "nsURIHashKey.h"
 
 class nsIDocument;
-class nsIChannel;
 class nsIPrincipal;
 class nsINode;
 class AutoError;
 
 namespace mozilla {
 namespace dom {
 
 class ImportManager;
--- a/dom/base/ShadowRoot.h
+++ b/dom/base/ShadowRoot.h
@@ -10,20 +10,17 @@
 #include "mozilla/dom/StyleSheetList.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsTHashtable.h"
 #include "nsDocument.h"
 
 class nsIAtom;
 class nsIContent;
-class nsIDocument;
-class nsPIDOMWindow;
 class nsXBLPrototypeBinding;
-class nsTagNameMapEntry;
 
 namespace mozilla {
 namespace dom {
 
 class Element;
 class HTMLContentElement;
 class HTMLShadowElement;
 class ShadowRootStyleSheetList;
--- a/dom/base/ThirdPartyUtil.h
+++ b/dom/base/ThirdPartyUtil.h
@@ -7,18 +7,16 @@
 
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "mozIThirdPartyUtil.h"
 #include "nsIEffectiveTLDService.h"
 #include "mozilla/Attributes.h"
 
 class nsIURI;
-class nsIChannel;
-class nsIDOMWindow;
 
 class ThirdPartyUtil final : public mozIThirdPartyUtil
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_MOZITHIRDPARTYUTIL
 
   nsresult Init();
--- a/dom/base/URL.h
+++ b/dom/base/URL.h
@@ -6,18 +6,16 @@
 #define URL_h___
 
 #include "mozilla/dom/BindingDeclarations.h"
 #include "mozilla/dom/URLSearchParams.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsAutoPtr.h"
 #include "nsString.h"
 
-class nsIDOMBlob;
-class nsIPrincipal;
 class nsISupports;
 class nsIURI;
 
 namespace mozilla {
 
 class ErrorResult;
 class DOMMediaStream;
 
--- a/dom/base/WebSocket.h
+++ b/dom/base/WebSocket.h
@@ -23,20 +23,16 @@
 #define DEFAULT_WS_SCHEME_PORT  80
 #define DEFAULT_WSS_SCHEME_PORT 443
 
 class nsIInputStream;
 
 namespace mozilla {
 namespace dom {
 
-namespace workers {
-class WorkerPrivate;
-}
-
 class File;
 
 class WebSocketImpl;
 
 class WebSocket final : public DOMEventTargetHelper
 {
   friend class WebSocketImpl;
 
--- a/dom/base/nsContentAreaDragDrop.h
+++ b/dom/base/nsContentAreaDragDrop.h
@@ -7,25 +7,21 @@
 #define nsContentAreaDragDrop_h__
 
 
 #include "nsCOMPtr.h"
 
 #include "nsIDOMEventListener.h"
 #include "nsITransferable.h"
 
-class nsIDOMNode;
 class nsPIDOMWindow;
-class nsIDOMDragEvent;
 class nsISelection;
 class nsITransferable;
 class nsIContent;
-class nsIURI;
 class nsIFile;
-class nsISimpleEnumerator;
 
 namespace mozilla {
 namespace dom {
 class DataTransfer;
 }
 }
 
 //
--- a/dom/base/nsContentCreatorFunctions.h
+++ b/dom/base/nsContentCreatorFunctions.h
@@ -10,20 +10,18 @@
 #include "nsCOMPtr.h"
 #include "mozilla/dom/FromParser.h"
 
 /**
  * Functions to create content, to be used only inside Gecko
  * (mozilla/content and mozilla/layout).
  */
 
-class nsAString;
 class nsIContent;
 class imgRequestProxy;
-class nsNodeInfoManager;
 class nsGenericHTMLElement;
 
 namespace mozilla {
 namespace dom {
 class Element;
 class NodeInfo;
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/nsContentSink.h
+++ b/dom/base/nsContentSink.h
@@ -26,21 +26,19 @@
 #include "prlog.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsThreadUtils.h"
 
 class nsIDocument;
 class nsIURI;
 class nsIChannel;
 class nsIDocShell;
-class nsIParser;
 class nsIAtom;
 class nsIChannel;
 class nsIContent;
-class nsViewManager;
 class nsNodeInfoManager;
 class nsScriptLoader;
 class nsIApplicationCache;
 
 namespace mozilla {
 namespace css {
 class Loader;
 }
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -46,62 +46,55 @@ class imgLoader;
 class imgRequestProxy;
 class nsAutoScriptBlockerSuppressNodeRemoved;
 class nsHtml5StringParser;
 class nsIChannel;
 class nsIConsoleService;
 class nsIContent;
 class nsIContentPolicy;
 class nsIContentSecurityPolicy;
-class nsIDocShell;
 class nsIDocument;
 class nsIDocumentLoaderFactory;
-class nsIDocumentObserver;
 class nsIDOMDocument;
 class nsIDOMDocumentFragment;
 class nsIDOMEvent;
-class nsIDOMHTMLFormElement;
 class nsIDOMHTMLInputElement;
 class nsIDOMKeyEvent;
 class nsIDOMNode;
-class nsIDOMScriptObjectFactory;
 class nsIDOMWindow;
 class nsIDragSession;
 class nsIEditor;
 class nsIFragmentContentSink;
 class nsIFrame;
 class nsIImageLoadingContent;
 class nsIInterfaceRequestor;
 class nsIIOService;
-class nsIJSRuntimeService;
 class nsILineBreaker;
 class nsIMessageBroadcaster;
 class nsNameSpaceManager;
 class nsIObserver;
 class nsIParser;
 class nsIParserService;
 class nsIPresShell;
 class nsIPrincipal;
 class nsIRequest;
 class nsIRunnable;
 class nsIScriptContext;
-class nsIScriptGlobalObject;
 class nsIScriptSecurityManager;
 class nsIStringBundle;
 class nsIStringBundleService;
 class nsISupportsArray;
 class nsISupportsHashKey;
 class nsIURI;
 class nsIWidget;
 class nsIWordBreaker;
 class nsIXPConnect;
 class nsNodeInfoManager;
 class nsPIDOMWindow;
 class nsPresContext;
-class nsScriptObjectTracer;
 class nsStringBuffer;
 class nsStringHashKey;
 class nsTextFragment;
 class nsView;
 class nsViewportInfo;
 class nsWrapperCache;
 class nsAttrValue;
 class nsITransferable;
--- a/dom/base/nsDOMClassInfo.h
+++ b/dom/base/nsDOMClassInfo.h
@@ -13,21 +13,18 @@
 #include "nsIDOMScriptObjectFactory.h"
 #include "js/Id.h"
 #include "nsIXPConnect.h"
 
 #ifdef XP_WIN
 #undef GetClassName
 #endif
 
-class nsContentList;
-class nsDocument;
 struct nsGlobalNameStruct;
 class nsGlobalWindow;
-class nsIScriptSecurityManager;
 
 struct nsDOMClassInfoData;
 
 typedef nsIClassInfo* (*nsDOMClassInfoConstructorFnc)
   (nsDOMClassInfoData* aData);
 
 typedef nsresult (*nsDOMConstructorFunc)(nsISupports** aNewObject);
 
--- a/dom/base/nsDocument.h
+++ b/dom/base/nsDocument.h
@@ -71,27 +71,22 @@
 
 #define XML_DECLARATION_BITS_DECLARATION_EXISTS   (1 << 0)
 #define XML_DECLARATION_BITS_ENCODING_EXISTS      (1 << 1)
 #define XML_DECLARATION_BITS_STANDALONE_EXISTS    (1 << 2)
 #define XML_DECLARATION_BITS_STANDALONE_YES       (1 << 3)
 
 
 class nsDOMStyleSheetSetList;
-class nsIOutputStream;
 class nsDocument;
-class nsIDTD;
 class nsIRadioVisitor;
 class nsIFormControl;
 struct nsRadioGroupStruct;
 class nsOnloadBlocker;
 class nsUnblockOnloadEvent;
-class nsChildContentList;
-class nsHTMLStyleSheet;
-class nsHTMLCSSStyleSheet;
 class nsDOMNavigationTiming;
 class nsWindowSizes;
 class nsHtml5TreeOpExecutor;
 class nsDocumentOnStack;
 class nsPointerLockPermissionRequest;
 class nsISecurityConsoleMessage;
 class nsPIBoxObject;
 
--- a/dom/base/nsFrameLoader.h
+++ b/dom/base/nsFrameLoader.h
@@ -45,19 +45,16 @@ struct StructuredCloneData;
 namespace layout {
 class RenderFrameParent;
 }
 }
 
 #if defined(MOZ_WIDGET_GTK)
 typedef struct _GtkWidget GtkWidget;
 #endif
-#ifdef MOZ_WIDGET_QT
-class QX11EmbedContainer;
-#endif
 
 class nsFrameLoader final : public nsIFrameLoader,
                             public nsStubMutationObserver,
                             public mozilla::dom::ipc::MessageManagerCallback
 {
   friend class AutoResetInShow;
   typedef mozilla::dom::PBrowserParent PBrowserParent;
   typedef mozilla::dom::TabParent TabParent;
--- a/dom/base/nsFrameMessageManager.h
+++ b/dom/base/nsFrameMessageManager.h
@@ -119,18 +119,16 @@ protected:
 
 StructuredCloneData UnpackClonedMessageDataForParent(const ClonedMessageData& aData);
 StructuredCloneData UnpackClonedMessageDataForChild(const ClonedMessageData& aData);
 
 } // namespace ipc
 } // namespace dom
 } // namespace mozilla
 
-class nsAXPCNativeCallContext;
-
 struct nsMessageListenerInfo
 {
   bool operator==(const nsMessageListenerInfo& aOther) const
   {
     return &aOther == this;
   }
 
   // Exactly one of mStrongListener and mWeakListener must be non-null.
--- a/dom/base/nsGenericDOMDataNode.h
+++ b/dom/base/nsGenericDOMDataNode.h
@@ -18,22 +18,17 @@
 #include "nsError.h"
 #include "mozilla/dom/Element.h"
 #include "nsCycleCollectionParticipant.h"
 
 #include "nsISMILAttr.h"
 #include "mozilla/dom/ShadowRoot.h"
 
 class nsIDocument;
-class nsIDOMAttr;
-class nsIDOMEventListener;
-class nsIDOMNodeList;
-class nsIFrame;
 class nsIDOMText;
-class nsURI;
 
 #define DATA_NODE_FLAG_BIT(n_) NODE_FLAG_BIT(NODE_TYPE_SPECIFIC_BITS_OFFSET + (n_))
 
 // Data node specific flags
 enum {
   // This bit is set to indicate that if the text node changes to
   // non-whitespace, we may need to create a frame for it. This bit must
   // not be set on nodes that already have a frame.
--- a/dom/base/nsHostObjectProtocolHandler.h
+++ b/dom/base/nsHostObjectProtocolHandler.h
@@ -12,17 +12,16 @@
 #include "nsIInputStream.h"
 
 #define BLOBURI_SCHEME "blob"
 #define MEDIASTREAMURI_SCHEME "mediastream"
 #define MEDIASOURCEURI_SCHEME "mediasource"
 #define FONTTABLEURI_SCHEME "moz-fonttable"
 #define RTSPURI_SCHEME "rtsp"
 
-class nsIDOMBlob;
 class nsIPrincipal;
 
 namespace mozilla {
 class DOMMediaStream;
 namespace dom {
 class FileImpl;
 class MediaSource;
 }
--- a/dom/base/nsIAttribute.h
+++ b/dom/base/nsIAttribute.h
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsIAttribute_h___
 #define nsIAttribute_h___
 
 #include "nsINode.h"
 
 class nsDOMAttributeMap;
-class nsIContent;
 
 #define NS_IATTRIBUTE_IID  \
 { 0x233a9c4d, 0xb27f, 0x4662, \
     { 0xbd, 0x90, 0xba, 0xd6, 0x2e, 0x76, 0xc8, 0xe1 } }
 
 class nsIAttribute : public nsINode
 {
 public:
--- a/dom/base/nsIDOMScriptObjectFactory.h
+++ b/dom/base/nsIDOMScriptObjectFactory.h
@@ -9,20 +9,16 @@
 #include "nsISupports.h"
 #include "nsIDOMClassInfo.h"
 #include "nsString.h"
 
 #define NS_IDOM_SCRIPT_OBJECT_FACTORY_IID \
 { 0x2a50e17c, 0x46ff, 0x4150, \
   { 0xbb, 0x46, 0xd8, 0x07, 0xb3, 0x36, 0xde, 0xab } }
 
-class nsIScriptContext;
-class nsIScriptGlobalObject;
-class nsIDOMEventListener;
-
 typedef nsXPCClassInfo* (*nsDOMClassInfoExternalConstructorFnc)
   (const char* aName);
 
 class nsIDOMScriptObjectFactory : public nsISupports {
 public:  
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOM_SCRIPT_OBJECT_FACTORY_IID)
 
   NS_IMETHOD_(nsISupports *) GetClassInfoInstance(nsDOMClassInfoID aID) = 0;
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -44,17 +44,16 @@ class nsIAtom;
 class nsIBFCacheEntry;
 class nsIChannel;
 class nsIContent;
 class nsIContentSink;
 class nsIDocShell;
 class nsIDocumentEncoder;
 class nsIDocumentObserver;
 class nsIDOMDocument;
-class nsIDOMDocumentFragment;
 class nsIDOMDocumentType;
 class nsIDOMElement;
 class nsIDOMNodeFilter;
 class nsIDOMNodeList;
 class nsIHTMLCollection;
 class nsILayoutHistoryState;
 class nsILoadContext;
 class nsIObjectLoadingContent;
@@ -114,17 +113,16 @@ class DOMImplementation;
 class DOMStringList;
 class Element;
 struct ElementRegistrationOptions;
 class Event;
 class EventTarget;
 class FontFaceSet;
 class FrameRequestCallback;
 class ImportManager;
-class OverfillCallback;
 class HTMLBodyElement;
 struct LifecycleCallbackArgs;
 class Link;
 class MediaQueryList;
 class GlobalObject;
 class NodeFilter;
 class NodeIterator;
 class ProcessingInstruction;
--- a/dom/base/nsIDocumentObserver.h
+++ b/dom/base/nsIDocumentObserver.h
@@ -4,21 +4,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsIDocumentObserver_h___
 #define nsIDocumentObserver_h___
 
 #include "mozilla/EventStates.h"
 #include "nsISupports.h"
 #include "nsIMutationObserver.h"
 
-class nsIAtom;
 class nsIContent;
 class nsIStyleSheet;
 class nsIStyleRule;
-class nsString;
 class nsIDocument;
 
 #define NS_IDOCUMENT_OBSERVER_IID \
 { 0x900bc4bc, 0x8b6c, 0x4cba, \
  { 0x82, 0xfa, 0x56, 0x8a, 0x80, 0xff, 0xfd, 0x3e } }
 
 typedef uint32_t nsUpdateType;
 
--- a/dom/base/nsINode.h
+++ b/dom/base/nsINode.h
@@ -43,17 +43,16 @@ class nsIEditor;
 class nsIFrame;
 class nsIMutationObserver;
 class nsINode;
 class nsIPresShell;
 class nsIPrincipal;
 class nsIURI;
 class nsNodeSupportsWeakRefTearoff;
 class nsNodeWeakReference;
-class nsXPCClassInfo;
 class nsDOMMutationObserver;
 
 namespace mozilla {
 class EventListenerManager;
 namespace dom {
 /**
  * @return true if aChar is what the DOM spec defines as 'space character'.
  * http://dom.spec.whatwg.org/#space-character
@@ -68,17 +67,16 @@ inline bool IsSpaceCharacter(char aChar)
 }
 struct BoxQuadOptions;
 struct ConvertCoordinateOptions;
 class DOMPoint;
 class DOMQuad;
 class DOMRectReadOnly;
 class Element;
 class EventHandlerNonNull;
-class OnErrorEventHandlerNonNull;
 template<typename T> class Optional;
 class Text;
 class TextOrElementOrDocument;
 struct DOMPointInit;
 } // namespace dom
 } // namespace mozilla
 
 #define NODE_FLAG_BIT(n_) \
--- a/dom/base/nsIScriptContext.h
+++ b/dom/base/nsIScriptContext.h
@@ -9,26 +9,16 @@
 #include "nscore.h"
 #include "nsStringGlue.h"
 #include "nsISupports.h"
 #include "nsCOMPtr.h"
 #include "jspubtd.h"
 #include "js/GCAPI.h"
 
 class nsIScriptGlobalObject;
-class nsIScriptSecurityManager;
-class nsIPrincipal;
-class nsIAtom;
-class nsIArray;
-class nsIVariant;
-class nsIObjectInputStream;
-class nsIObjectOutputStream;
-class nsIScriptObjectPrincipal;
-class nsIDOMWindow;
-class nsIURI;
 
 #define NS_ISCRIPTCONTEXT_IID \
 { 0x901f0d5e, 0x217a, 0x45fa, \
   { 0x9a, 0xca, 0x45, 0x0f, 0xe7, 0x2f, 0x10, 0x9a } }
 
 class nsIOffThreadScriptReceiver;
 
 /**
--- a/dom/base/nsImageLoadingContent.h
+++ b/dom/base/nsImageLoadingContent.h
@@ -22,18 +22,16 @@
 #include "nsIRequest.h"
 #include "mozilla/ErrorResult.h"
 #include "nsAutoPtr.h"
 #include "nsIContentPolicy.h"
 #include "mozilla/dom/BindingDeclarations.h"
 
 class nsIURI;
 class nsIDocument;
-class imgILoader;
-class nsIIOService;
 class nsPresContext;
 class nsIContent;
 class imgRequestProxy;
 
 #ifdef LoadImage
 // Undefine LoadImage to prevent naming conflict with Windows.
 #undef LoadImage
 #endif
--- a/dom/base/nsJSEnvironment.h
+++ b/dom/base/nsJSEnvironment.h
@@ -14,19 +14,17 @@
 #include "nsIXPConnect.h"
 #include "nsIArray.h"
 #include "mozilla/Attributes.h"
 #include "nsPIDOMWindow.h"
 #include "nsThreadUtils.h"
 #include "xpcpublic.h"
 
 class nsICycleCollectorListener;
-class nsIXPConnectJSObjectHolder;
 class nsScriptNameSpaceManager;
-class nsCycleCollectionNoteRootCallback;
 
 namespace JS {
 class AutoValueVector;
 }
 
 namespace mozilla {
 template <class> class Maybe;
 struct CycleCollectorResults;
@@ -168,18 +166,16 @@ private:
   // context does. It is eventually collected by the cycle collector.
   nsCOMPtr<nsIScriptGlobalObject> mGlobalObjectRef;
 
   static void JSOptionChangedCallback(const char *pref, void *data);
 
   static bool DOMOperationCallback(JSContext *cx);
 };
 
-class nsIJSRuntimeService;
-class nsIPrincipal;
 class nsPIDOMWindow;
 
 namespace mozilla {
 namespace dom {
 
 void StartupJSEnvironment();
 void ShutdownJSEnvironment();
 
--- a/dom/base/nsMappedAttributes.h
+++ b/dom/base/nsMappedAttributes.h
@@ -14,17 +14,16 @@
 #include "nsAttrAndChildArray.h"
 #include "nsMappedAttributeElement.h"
 #include "nsIStyleRule.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/MemoryReporting.h"
 
 class nsIAtom;
 class nsHTMLStyleSheet;
-class nsRuleWalker;
 
 class nsMappedAttributes final : public nsIStyleRule
 {
 public:
   nsMappedAttributes(nsHTMLStyleSheet* aSheet,
                      nsMapRuleToAttributesFunc aMapRuleFunc);
 
   // Do not return null.
--- a/dom/base/nsNameSpaceManager.h
+++ b/dom/base/nsNameSpaceManager.h
@@ -6,17 +6,16 @@
 #ifndef nsNameSpaceManager_h___
 #define nsNameSpaceManager_h___
 
 #include "nsDataHashtable.h"
 #include "nsTArray.h"
 
 #include "mozilla/StaticPtr.h"
 
-class nsIAtom;
 class nsAString;
 
 class nsNameSpaceKey : public PLDHashEntryHdr
 {
 public:
   typedef const nsAString* KeyType;
   typedef const nsAString* KeyTypePointer;
 
--- a/dom/base/nsNodeUtils.h
+++ b/dom/base/nsNodeUtils.h
@@ -7,18 +7,16 @@
 #define nsNodeUtils_h___
 
 #include "nsIContent.h"          // for use in inline function (ParentChainChanged)
 #include "nsIMutationObserver.h" // for use in inline function (ParentChainChanged)
 #include "js/TypeDecls.h"
 #include "nsCOMArray.h"
 
 struct CharacterDataChangeInfo;
-class nsIVariant;
-class nsIDOMNode;
 template<class E> class nsCOMArray;
 class nsCycleCollectionTraversalCallback;
 namespace mozilla {
 namespace dom {
 class Animation;
 }
 }
 
--- a/dom/base/nsPIDOMWindow.h
+++ b/dom/base/nsPIDOMWindow.h
@@ -20,17 +20,16 @@
 #define DOM_WINDOW_FROZEN_TOPIC "dom-window-frozen"
 #define DOM_WINDOW_THAWED_TOPIC "dom-window-thawed"
 
 class nsIArray;
 class nsIContent;
 class nsIDocShell;
 class nsIDocument;
 class nsIIdleObserver;
-class nsIPrincipal;
 class nsIScriptTimeoutHandler;
 class nsIURI;
 class nsPerformance;
 class nsPIWindowRoot;
 class nsXBLPrototypeHandler;
 struct nsTimeout;
 
 namespace mozilla {
--- a/dom/base/nsReferencedElement.h
+++ b/dom/base/nsReferencedElement.h
@@ -10,17 +10,16 @@
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/Element.h"
 #include "nsIAtom.h"
 #include "nsIDocument.h"
 #include "nsThreadUtils.h"
 #include "nsAutoPtr.h"
 
 class nsIURI;
-class nsCycleCollectionCallback;
 
 /**
  * Class to track what element is referenced by a given ID.
  * 
  * To use it, call Reset() to set it up to watch a given URI. Call get()
  * anytime to determine the referenced element (which may be null if
  * the element isn't found). When the element changes, ElementChanged
  * will be called, so subclass this class if you want to receive that
--- a/dom/base/nsScriptNameSpaceManager.h
+++ b/dom/base/nsScriptNameSpaceManager.h
@@ -74,21 +74,17 @@ struct nsGlobalNameStruct
   union {
     mozilla::dom::DefineInterface mDefineDOMInterface; // for window
     mozilla::dom::ConstructNavigatorProperty mConstructNavigatorProperty; // for navigator
   };
   // May be null if enabled unconditionally
   mozilla::dom::ConstructorEnabled* mConstructorEnabled;
 };
 
-
-class nsIScriptContext;
 class nsICategoryManager;
-class GlobalNameMapEntry;
-
 
 class nsScriptNameSpaceManager : public nsIObserver,
                                  public nsSupportsWeakReference,
                                  public nsIMemoryReporter
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
--- a/dom/base/nsTextFragment.h
+++ b/dom/base/nsTextFragment.h
@@ -14,17 +14,16 @@
 #include "mozilla/Attributes.h"
 #include "mozilla/MemoryReporting.h"
 
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsISupportsImpl.h"
 
 class nsString;
-class nsCString;
 
 // XXX should this normalize the code to keep a \u0000 at the end?
 
 // XXX nsTextFragmentPool?
 
 /**
  * A fragment of text. If mIs2b is 1 then the m2b pointer is valid
  * otherwise the m1b pointer is valid. If m1b is used then each byte
--- a/dom/base/nsWindowRoot.h
+++ b/dom/base/nsWindowRoot.h
@@ -3,25 +3,19 @@
  * 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 nsWindowRoot_h__
 #define nsWindowRoot_h__
 
 class nsPIDOMWindow;
-class nsIDOMEventListener;
 class nsIDOMEvent;
 class nsIGlobalObject;
 
-namespace mozilla {
-class EventChainPostVisitor;
-class EventChainPreVisitor;
-} // namespace mozilla
-
 #include "mozilla/Attributes.h"
 #include "mozilla/EventListenerManager.h"
 #include "nsIDOMEventTarget.h"
 #include "nsPIWindowRoot.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsAutoPtr.h"
 #include "nsTHashtable.h"
 #include "nsHashKeys.h"
--- a/dom/base/nsWrapperCache.h
+++ b/dom/base/nsWrapperCache.h
@@ -18,17 +18,16 @@ namespace mozilla {
 namespace dom {
 class TabChildGlobal;
 class ProcessGlobal;
 } // namespace dom
 } // namespace mozilla
 class SandboxPrivate;
 class nsInProcessTabChildGlobal;
 class nsWindowRoot;
-class XPCWrappedNativeScope;
 
 #define NS_WRAPPERCACHE_IID \
 { 0x6f3179a1, 0x36f7, 0x4a5c, \
   { 0x8c, 0xf1, 0xad, 0xc8, 0x7c, 0xde, 0x3e, 0x87 } }
 
 /**
  * Class to store the wrapper for an object. This can only be used with objects
  * that only have one non-security wrapper at a time (for an XPCWrappedNative
--- a/dom/base/nsXMLContentSerializer.h
+++ b/dom/base/nsXMLContentSerializer.h
@@ -18,17 +18,16 @@
 #include "nsCOMPtr.h"
 #include "nsTArray.h"
 #include "nsString.h"
 
 #define kIndentStr NS_LITERAL_STRING("  ")
 #define kEndTag NS_LITERAL_STRING("</")
 
 class nsIAtom;
-class nsIDOMNode;
 class nsINode;
 
 class nsXMLContentSerializer : public nsIContentSerializer {
  public:
   nsXMLContentSerializer();
 
   NS_DECL_ISUPPORTS