Bug 1156632 - Remove unused forward class declarations - patch 5 - rdf, parser, layout and something else, r=ehsan
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 22 Apr 2015 08:29:22 +0200
changeset 257628 d47f66ce3822cd4b95c99b3c0b123584486d119c
parent 257627 60a2001adf9acc476ecb1ceb5652618c70e56f50
child 257629 9e1d3ea762968d090fd4c945de5e3838c1bd3ec9
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-esr52@4c2175bb0420 [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 5 - rdf, parser, layout and something else, r=ehsan
accessible/atk/InterfaceInitFuncs.h
accessible/generic/Accessible.h
accessible/generic/DocAccessible.h
accessible/generic/ImageAccessible.h
accessible/html/HTMLSelectAccessible.h
accessible/html/HTMLTableAccessible.h
accessible/interfaces/nsIAccessibilityService.h
accessible/mac/RootAccessibleWrap.h
accessible/windows/msaa/nsWinUtils.h
accessible/xul/XULListboxAccessible.h
dom/xul/templates/nsContentTestNode.h
dom/xul/templates/nsRDFQuery.h
dom/xul/templates/nsRuleNetwork.h
editor/libeditor/PlaceholderTxn.h
editor/libeditor/nsEditor.h
editor/libeditor/nsHTMLCSSUtils.h
editor/libeditor/nsHTMLEditor.h
editor/libeditor/nsHTMLEditorEventListener.h
editor/libeditor/nsIAbsorbingTransaction.h
editor/libeditor/nsPlaintextEditor.h
editor/libeditor/nsTextEditUtils.h
editor/libeditor/nsWSRunObject.h
editor/txmgr/nsTransactionManager.h
embedding/browser/nsWebBrowser.h
embedding/components/find/nsFind.h
embedding/components/printingui/mac/nsPrintingPromptService.h
embedding/components/windowwatcher/nsWindowWatcher.h
extensions/spellcheck/src/mozInlineSpellChecker.h
layout/base/DisplayItemClip.h
layout/base/FrameLayerBuilder.h
layout/base/GeometryUtils.h
layout/base/SelectionCarets.h
layout/base/nsCSSFrameConstructor.h
layout/base/nsIDocumentViewerPrint.h
layout/base/nsIPresShell.h
layout/base/nsLayoutUtils.h
layout/base/nsPresContext.h
layout/base/nsPresShell.h
layout/base/nsRefreshDriver.h
layout/build/nsContentDLF.h
layout/forms/nsFileControlFrame.h
layout/forms/nsListControlFrame.h
layout/forms/nsProgressFrame.h
layout/forms/nsRangeFrame.h
layout/generic/ScrollbarActivity.h
layout/generic/TextOverflow.h
layout/generic/nsBlockFrame.h
layout/generic/nsBlockReflowContext.h
layout/generic/nsFrame.h
layout/generic/nsFrameSelection.h
layout/generic/nsGfxScrollFrame.h
layout/generic/nsHTMLParts.h
layout/generic/nsIAnonymousContentCreator.h
layout/generic/nsIFrame.h
layout/generic/nsPluginFrame.h
layout/generic/nsRubyFrame.h
layout/inspector/inLayoutUtils.h
layout/inspector/nsFontFace.h
layout/printing/nsPrintEngine.h
layout/style/AnimationCommon.h
layout/style/CSSStyleSheet.h
layout/style/CSSValue.h
layout/style/CounterStyleManager.h
layout/style/Loader.h
layout/style/Rule.h
layout/style/SVGAttrAnimationRuleProcessor.h
layout/style/StyleRule.h
layout/style/nsAnimationManager.h
layout/style/nsCSSRuleProcessor.h
layout/style/nsComputedDOMStyle.h
layout/style/nsFontFaceLoader.h
layout/style/nsICSSPseudoComparator.h
layout/style/nsIStyleRuleProcessor.h
layout/style/nsRuleNode.h
layout/style/nsRuleProcessorData.h
layout/style/nsStyleSet.h
layout/style/nsTransitionManager.h
layout/svg/nsCSSFilterInstance.h
layout/svg/nsISVGChildFrame.h
layout/svg/nsSVGContainerFrame.h
layout/svg/nsSVGFilterFrame.h
layout/svg/nsSVGFilterInstance.h
layout/svg/nsSVGForeignObjectFrame.h
layout/svg/nsSVGPathGeometryFrame.h
layout/svg/nsSVGPatternFrame.h
layout/svg/nsSVGUtils.h
layout/tables/SpanningCellSorter.h
layout/tables/nsCellMap.h
layout/tables/nsTableColFrame.h
layout/tables/nsTableFrame.h
layout/tables/nsTableRowGroupFrame.h
layout/xul/BoxObject.h
layout/xul/grid/nsGrid.h
layout/xul/grid/nsGridLayout2.h
layout/xul/grid/nsGridRow.h
layout/xul/nsBoxLayoutState.h
layout/xul/nsIScrollbarMediator.h
layout/xul/nsLeafBoxFrame.h
layout/xul/nsMenuFrame.h
layout/xul/nsMenuPopupFrame.h
layout/xul/nsResizerFrame.h
layout/xul/nsScrollbarButtonFrame.h
layout/xul/nsSliderFrame.h
parser/html/nsHtml5TreeBuilderCppSupplement.h
parser/html/nsHtml5TreeOpExecutor.h
parser/html/nsHtml5TreeOperation.h
parser/htmlparser/CNavDTD.h
parser/htmlparser/nsIDTD.h
parser/htmlparser/nsParser.h
parser/htmlparser/nsScanner.h
rdf/base/nsRDFXMLSerializer.h
rdf/base/rdfutil.h
testing/gtest/gtest/include/gtest/gtest.h
tools/profiler/GeckoProfilerImpl.h
tools/profiler/PseudoStack.h
tools/profiler/TableTicker.h
--- a/accessible/atk/InterfaceInitFuncs.h
+++ b/accessible/atk/InterfaceInitFuncs.h
@@ -12,18 +12,16 @@
 namespace mozilla {
 namespace a11y {
 
 class AccessibleWrap;
 
 } // namespace a11y
 } // namespace mozilla
 
-struct MaiUtilClass;
-
 extern "C" {
 void actionInterfaceInitCB(AtkActionIface* aIface);
 void componentInterfaceInitCB(AtkComponentIface* aIface);
 void documentInterfaceInitCB(AtkDocumentIface *aIface);
 void editableTextInterfaceInitCB(AtkEditableTextIface* aIface);
 void hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface *aIface);
 void hypertextInterfaceInitCB(AtkHypertextIface* aIface);
 void imageInterfaceInitCB(AtkImageIface* aIface);
--- a/accessible/generic/Accessible.h
+++ b/accessible/generic/Accessible.h
@@ -18,33 +18,31 @@
 #include "nsRect.h"
 
 struct nsRoleMapEntry;
 
 struct nsRect;
 class nsIFrame;
 class nsIAtom;
 class nsIPersistentProperties;
-class nsView;
 
 namespace mozilla {
 namespace a11y {
 
 class Accessible;
 class AccEvent;
 class AccGroupInfo;
 class ApplicationAccessible;
 class DocAccessible;
 class EmbeddedObjCollector;
 class HTMLImageMapAccessible;
 class HTMLLIAccessible;
 class HyperTextAccessible;
 class ImageAccessible;
 class KeyBinding;
-class MathMLAccessible;
 class ProxyAccessible;
 class Relation;
 class RootAccessible;
 class TableAccessible;
 class TableCellAccessible;
 class TextLeafAccessible;
 class XULLabelAccessible;
 class XULTreeAccessible;
--- a/accessible/generic/DocAccessible.h
+++ b/accessible/generic/DocAccessible.h
@@ -18,18 +18,16 @@
 #include "nsIEditor.h"
 #include "nsIObserver.h"
 #include "nsIScrollPositionListener.h"
 #include "nsITimer.h"
 #include "nsIWeakReference.h"
 
 class nsAccessiblePivot;
 
-class nsIScrollableView;
-
 const uint32_t kDefaultCacheLength = 128;
 
 namespace mozilla {
 namespace a11y {
 
 class DocManager;
 class NotificationController;
 class DocAccessibleChild;
--- a/accessible/generic/ImageAccessible.h
+++ b/accessible/generic/ImageAccessible.h
@@ -3,18 +3,16 @@
  * 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_a11y_ImageAccessible_h__
 #define mozilla_a11y_ImageAccessible_h__
 
 #include "BaseAccessibles.h"
 
-class nsGenericHTMLElement;
-
 namespace mozilla {
 namespace a11y {
 
 /* Accessible for supporting images
  * supports:
  * - gets name, role
  * - support basic state
  */
--- a/accessible/html/HTMLSelectAccessible.h
+++ b/accessible/html/HTMLSelectAccessible.h
@@ -3,18 +3,16 @@
  * 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_a11y_HTMLSelectAccessible_h__
 #define mozilla_a11y_HTMLSelectAccessible_h__
 
 #include "HTMLFormControlAccessible.h"
 
-class nsIMutableArray;
-
 namespace mozilla {
 namespace a11y {
 
 /**
   *  Selects, Listboxes and Comboboxes, are made up of a number of different
   *  widgets, some of which are shared between the two. This file contains
   *  all of the widgets for both of the Selects, for HTML only.
   *
--- a/accessible/html/HTMLTableAccessible.h
+++ b/accessible/html/HTMLTableAccessible.h
@@ -5,17 +5,16 @@
 
 #ifndef mozilla_a11y_HTMLTableAccessible_h__
 #define mozilla_a11y_HTMLTableAccessible_h__
 
 #include "HyperTextAccessibleWrap.h"
 #include "TableAccessible.h"
 #include "TableCellAccessible.h"
 
-class nsITableLayout;
 class nsITableCellLayout;
 
 namespace mozilla {
 namespace a11y {
 
 /**
  * HTML table cell accessible (html:td).
  */
--- a/accessible/interfaces/nsIAccessibilityService.h
+++ b/accessible/interfaces/nsIAccessibilityService.h
@@ -15,21 +15,17 @@
 namespace mozilla {
 namespace a11y {
 
 class Accessible;
 
 } // namespace a11y
 } // namespace mozilla
 
-class nsINode;
-class nsIContent;
-class nsIFrame;
 class nsIPresShell;
-class nsPluginFrame;
 
 // 0e7e6879-854b-4260-bc6e-525b5fb5cf34
 #define NS_IACCESSIBILITYSERVICE_IID \
 { 0x0e7e6879, 0x854b, 0x4260, \
  { 0xbc, 0x6e, 0x52, 0x5b, 0x5f, 0xb5, 0xcf, 0x34 } }
 
 class nsIAccessibilityService : public nsIAccessibleRetrieval
 {
--- a/accessible/mac/RootAccessibleWrap.h
+++ b/accessible/mac/RootAccessibleWrap.h
@@ -10,18 +10,16 @@
 #ifndef mozilla_a11y_RootAccessibleWrap_h__
 #define mozilla_a11y_RootAccessibleWrap_h__
 
 #include "RootAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
-struct objc_class;
-
 class RootAccessibleWrap : public RootAccessible
 {
 public:
   RootAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
                      nsIPresShell* aPresShell);
   virtual ~RootAccessibleWrap();
 
     Class GetNativeType ();
--- a/accessible/windows/msaa/nsWinUtils.h
+++ b/accessible/windows/msaa/nsWinUtils.h
@@ -9,17 +9,16 @@
 #define nsWinUtils_h_
 
 #include <windows.h>
 
 #include "nsIDOMCSSStyleDeclaration.h"
 #include "nsCOMPtr.h"
 #include "nsRefPtrHashtable.h"
 
-class nsIArray;
 class nsIContent;
 
 namespace mozilla {
 namespace a11y {
 
 class DocAccessible;
 
 const LPCWSTR kClassNameRoot = L"MozillaUIWindowClass";
--- a/accessible/xul/XULListboxAccessible.h
+++ b/accessible/xul/XULListboxAccessible.h
@@ -9,18 +9,16 @@
 #include "BaseAccessibles.h"
 #include "TableAccessible.h"
 #include "TableCellAccessible.h"
 #include "xpcAccessibleTable.h"
 #include "xpcAccessibleTableCell.h"
 #include "XULMenuAccessible.h"
 #include "XULSelectControlAccessible.h"
 
-class nsIWeakReference;
-
 namespace mozilla {
 namespace a11y {
 
 /**
  * XULColumAccessible are accessible for list and tree columns elements
  * (xul:treecols and xul:listcols).
  */
 class XULColumAccessible : public AccessibleWrap
--- a/dom/xul/templates/nsContentTestNode.h
+++ b/dom/xul/templates/nsContentTestNode.h
@@ -7,16 +7,18 @@
 #define nsContentTestNode_h__
 
 #include "mozilla/Attributes.h"
 #include "nscore.h"
 #include "nsRuleNetwork.h"
 #include "nsIAtom.h"
 #include "nsIDOMDocument.h"
 
+class nsXULTemplateQueryProcessorRDF;
+
 /**
  * The nsContentTestNode is always the top node in a query's rule network. It
  * exists so that Constrain can filter out resources that aren't part of a
  * result.
  */
 class nsContentTestNode : public TestNode
 {
 public:
--- a/dom/xul/templates/nsRDFQuery.h
+++ b/dom/xul/templates/nsRDFQuery.h
@@ -10,16 +10,18 @@
 #include "nsISimpleEnumerator.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/Attributes.h"
 
 #define NS_ITEMPLATERDFQUERY_IID \
   {0x8929ff60, 0x1c9c, 0x4d87, \
     { 0xac, 0x02, 0x09, 0x14, 0x15, 0x3b, 0x48, 0xc4 }}
 
+class nsXULTemplateQueryProcessorRDF;
+
 /**
  * A compiled query in the RDF query processor. This interface should not be
  * used directly outside of the RDF query processor.
  */
 class nsITemplateRDFQuery : public nsISupports
 {
 public:
     NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITEMPLATERDFQUERY_IID)
--- a/dom/xul/templates/nsRuleNetwork.h
+++ b/dom/xul/templates/nsRuleNetwork.h
@@ -33,17 +33,16 @@
 #include "nsCOMArray.h"
 #include "nsIAtom.h"
 #include "nsIDOMNode.h"
 #include "plhash.h"
 #include "pldhash.h"
 #include "nsIRDFNode.h"
 
 class nsXULTemplateResultSetRDF;
-class nsXULTemplateQueryProcessorRDF;
 
 //----------------------------------------------------------------------
 
 /**
  * A memory element that supports an instantiation. A memory element holds a
  * set of nodes involved in an RDF test such as <member> or <triple> test. A
  * memory element is created when a specific test matches. The query processor
  * maintains a map between the memory elements and the results they eventually
--- a/editor/libeditor/PlaceholderTxn.h
+++ b/editor/libeditor/PlaceholderTxn.h
@@ -10,18 +10,16 @@
 #include "nsEditorUtils.h"
 #include "nsIAbsorbingTransaction.h"
 #include "nsIDOMNode.h"
 #include "nsCOMPtr.h"
 #include "nsWeakPtr.h"
 #include "nsWeakReference.h"
 #include "nsAutoPtr.h"
 
-class nsHTMLEditor;
-
 namespace mozilla {
 namespace dom {
 class IMETextTxn;
 }
 }
 
 /**
  * An aggregate transaction that knows how to absorb all subsequent
--- a/editor/libeditor/nsEditor.h
+++ b/editor/libeditor/nsEditor.h
@@ -28,20 +28,17 @@
 #include "nscore.h"                     // for nsresult, nsAString, etc
 
 class AddStyleSheetTxn;
 class DeleteNodeTxn;
 class EditAggregateTxn;
 class RemoveStyleSheetTxn;
 class nsIAtom;
 class nsIContent;
-class nsIDOMCharacterData;
-class nsIDOMDataTransfer;
 class nsIDOMDocument;
-class nsIDOMElement;
 class nsIDOMEvent;
 class nsIDOMEventListener;
 class nsIDOMEventTarget;
 class nsIDOMKeyEvent;
 class nsIDOMNode;
 class nsIDocument;
 class nsIDocumentStateListener;
 class nsIEditActionListener;
--- a/editor/libeditor/nsHTMLCSSUtils.h
+++ b/editor/libeditor/nsHTMLCSSUtils.h
@@ -21,17 +21,16 @@ class nsINode;
 class nsString;
 namespace mozilla {
 namespace dom {
 class Element;
 }  // namespace dom
 }  // namespace mozilla
 
 class nsHTMLEditor;
-class nsIDOMWindow;
 
 typedef void (*nsProcessValueFunc)(const nsAString * aInputString, nsAString & aOutputString,
                                    const char * aDefaultValueString,
                                    const char * aPrependString, const char* aAppendString);
 
 class nsHTMLCSSUtils
 {
 public:
--- a/editor/libeditor/nsHTMLEditor.h
+++ b/editor/libeditor/nsHTMLEditor.h
@@ -38,21 +38,19 @@
 #include "nsAttrName.h"
 #include "nsStubMutationObserver.h"
 
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/Element.h"
 
 class nsIDOMKeyEvent;
 class nsITransferable;
-class nsIDocumentEncoder;
 class nsIClipboard;
 class TypeInState;
 class nsIContentFilter;
-class nsIURL;
 class nsILinkHandler;
 class nsTableOuterFrame;
 class nsIDOMRange;
 class nsRange;
 struct PropItem;
 
 namespace mozilla {
 namespace widget {
--- a/editor/libeditor/nsHTMLEditorEventListener.h
+++ b/editor/libeditor/nsHTMLEditorEventListener.h
@@ -6,17 +6,16 @@
 #ifndef nsHTMLEditorEventListener_h__
 #define nsHTMLEditorEventListener_h__
 
 #include "nsEditorEventListener.h"
 #include "nscore.h"
 
 class nsEditor;
 class nsHTMLEditor;
-class nsIDOMEvent;
 
 class nsHTMLEditorEventListener : public nsEditorEventListener
 {
 public:
   nsHTMLEditorEventListener() :
     nsEditorEventListener()
   {
   }
--- a/editor/libeditor/nsIAbsorbingTransaction.h
+++ b/editor/libeditor/nsIAbsorbingTransaction.h
@@ -15,17 +15,16 @@ Transaction interface to outside world
 #define NS_IABSORBINGTRANSACTION_IID \
 { /* a6cf9116-15b3-11d2-932e-00805f8add32 */ \
     0xa6cf9116, \
     0x15b3, \
     0x11d2, \
     {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }
 
 class nsSelectionState;
-class nsIEditor;
 class nsIAtom;
 
 /**
  * A transaction interface mixin - for transactions that can support. 
  * the placeholder absorbtion idiom. 
  */
 class nsIAbsorbingTransaction  : public nsISupports{
 public:
--- a/editor/libeditor/nsPlaintextEditor.h
+++ b/editor/libeditor/nsPlaintextEditor.h
@@ -11,21 +11,19 @@
 #include "nsEditor.h"
 #include "nsIEditor.h"
 #include "nsIEditorMailSupport.h"
 #include "nsIPlaintextEditor.h"
 #include "nsISupportsImpl.h"
 #include "nscore.h"
 
 class nsIContent;
-class nsIDOMDataTransfer;
 class nsIDOMDocument;
 class nsIDOMElement;
 class nsIDOMEvent;
-class nsIDOMEventTarget;
 class nsIDOMKeyEvent;
 class nsIDOMNode;
 class nsIDocumentEncoder;
 class nsIEditRules;
 class nsIOutputStream;
 class nsISelectionController;
 class nsITransferable;
 
--- a/editor/libeditor/nsTextEditUtils.h
+++ b/editor/libeditor/nsTextEditUtils.h
@@ -3,22 +3,16 @@
  * 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 nsTextEditUtils_h__
 #define nsTextEditUtils_h__
 
 #include "nscore.h"
 
-namespace mozilla {
-namespace dom {
-class Element;
-} // namespace dom
-} // namespace mozilla
-
 class nsIDOMNode;
 class nsINode;
 class nsPlaintextEditor;
 
 class nsTextEditUtils
 {
 public:
   // from nsTextEditRules:
--- a/editor/libeditor/nsWSRunObject.h
+++ b/editor/libeditor/nsWSRunObject.h
@@ -9,17 +9,16 @@
 #include "nsCOMPtr.h"
 #include "nsIEditor.h" // for EDirection
 #include "nsINode.h"
 #include "nscore.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/Text.h"
 
 class nsHTMLEditor;
-class nsIDOMDocument;
 class nsIDOMNode;
 struct DOMPoint;
 
 // class nsWSRunObject represents the entire whitespace situation
 // around a given point.  It collects up a list of nodes that contain
 // whitespace and categorizes in up to 3 different WSFragments (detailed
 // below).  Each WSFragment is a collection of whitespace that is
 // either all insignificant, or that is significant.  A WSFragment could
--- a/editor/txmgr/nsTransactionManager.h
+++ b/editor/txmgr/nsTransactionManager.h
@@ -13,17 +13,16 @@
 #include "nsISupportsImpl.h"
 #include "nsITransactionManager.h"
 #include "nsTransactionStack.h"
 #include "nsWeakReference.h"
 #include "nscore.h"
 
 class nsITransaction;
 class nsITransactionListener;
-class nsTransactionItem;
 
 /** implementation of a transaction manager object.
  *
  */
 class nsTransactionManager final : public nsITransactionManager
                                  , public nsSupportsWeakReference
 {
 private:
--- a/embedding/browser/nsWebBrowser.h
+++ b/embedding/browser/nsWebBrowser.h
@@ -36,18 +36,16 @@
 #include "nsIWindowWatcher.h"
 #include "nsIPrintSettings.h"
 #include "nsEmbedStream.h"
 #include "nsIWidgetListener.h"
 
 #include "nsTArray.h"
 #include "nsWeakPtr.h"
 
-class nsIContentViewerFile;
-
 class nsWebBrowserInitInfo
 {
 public:
   //nsIBaseWindow Stuff
   int32_t                 x;
   int32_t                 y;
   int32_t                 cx;
   int32_t                 cy;
--- a/embedding/components/find/nsFind.h
+++ b/embedding/components/find/nsFind.h
@@ -11,17 +11,16 @@
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMRange.h"
 #include "nsIContentIterator.h"
 #include "nsIWordBreaker.h"
 
-class nsIAtom;
 class nsIContent;
 
 #define NS_FIND_CONTRACTID "@mozilla.org/embedcomp/rangefind;1"
 
 #define NS_FIND_CID \
  {0x471f4944, 0x1dd2, 0x11b2, {0x87, 0xac, 0x90, 0xbe, 0x0a, 0x51, 0xd6, 0x09}}
 
 class nsFindContentIterator;
--- a/embedding/components/printingui/mac/nsPrintingPromptService.h
+++ b/embedding/components/printingui/mac/nsPrintingPromptService.h
@@ -16,20 +16,16 @@
 #include "nsIPrintingPromptService.h"
 #include "nsPIPromptService.h"
 #include "nsIWindowWatcher.h"
 
 // Printing Progress Includes
 #include "nsPrintProgress.h"
 #include "nsIWebProgressListener.h"
 
-
-class nsIDOMWindow;
-class nsIDialogParamBlock;
-
 class nsPrintingPromptService: public nsIPrintingPromptService,
                                public nsIWebProgressListener
 {
 public:
   nsPrintingPromptService();
 
   nsresult Init();
 
--- a/embedding/components/windowwatcher/nsWindowWatcher.h
+++ b/embedding/components/windowwatcher/nsWindowWatcher.h
@@ -18,20 +18,17 @@
 #include "nsITabParent.h"
 #include "nsPIWindowWatcher.h"
 #include "nsTArray.h"
 
 class  nsIURI;
 class  nsIDocShellTreeItem;
 class  nsIDocShellTreeOwner;
 class nsPIDOMWindow;
-class  nsIWebBrowserChrome;
-class  nsString;
 class  nsWatcherWindowEnumerator;
-class  nsIScriptContext;
 class  nsPromptService;
 struct nsWatcherWindowEntry;
 struct SizeSpec;
 
 class nsWindowWatcher :
       public nsIWindowWatcher,
       public nsPIWindowWatcher,
       public nsIPromptFactory
--- a/extensions/spellcheck/src/mozInlineSpellChecker.h
+++ b/extensions/spellcheck/src/mozInlineSpellChecker.h
@@ -19,17 +19,16 @@
 #include "mozISpellI18NUtil.h"
 #include "nsCycleCollectionParticipant.h"
 
 // X.h defines KeyPress
 #ifdef KeyPress
 #undef KeyPress
 #endif
 
-class nsIDOMMouseEventListener;
 class mozInlineSpellWordUtil;
 class mozInlineSpellChecker;
 class mozInlineSpellResume;
 class InitEditorSpellCheckCallback;
 class UpdateCurrentDictionaryCallback;
 class mozInlineSpellResume;
 
 class mozInlineSpellStatus
--- a/layout/base/DisplayItemClip.h
+++ b/layout/base/DisplayItemClip.h
@@ -7,17 +7,16 @@
 #define DISPLAYITEMCLIP_H_
 
 #include "mozilla/RefPtr.h"
 #include "nsRect.h"
 #include "nsTArray.h"
 #include "nsStyleConsts.h"
 
 class gfxContext;
-class nsDisplayItem;
 class nsPresContext;
 class nsRegion;
 
 namespace mozilla {
 namespace gfx {
 class DrawTarget;
 class Path;
 }
--- a/layout/base/FrameLayerBuilder.h
+++ b/layout/base/FrameLayerBuilder.h
@@ -45,18 +45,16 @@ private:
 public:
   NS_INLINE_DECL_REFCOUNTING(RefCountedRegion)
 
   RefCountedRegion() : mIsInfinite(false) {}
   nsRegion mRegion;
   bool mIsInfinite;
 };
 
-struct NewLayerEntry;
-
 struct ContainerLayerParameters {
   ContainerLayerParameters()
     : mXScale(1)
     , mYScale(1)
     , mLayerContentsVisibleRect(nullptr)
     , mBackgroundColor(NS_RGBA(0,0,0,0))
     , mInTransformedSubtree(false)
     , mInActiveTransformedSubtree(false)
--- a/layout/base/GeometryUtils.h
+++ b/layout/base/GeometryUtils.h
@@ -11,17 +11,16 @@
 #include "nsCOMPtr.h"
 
 /**
  * This file defines utility functions for converting between layout
  * coordinate systems.
  */
 
 class nsINode;
-class nsIDocument;
 
 namespace mozilla {
 
 namespace dom {
 struct BoxQuadOptions;
 struct ConvertCoordinateOptions;
 class DOMQuad;
 class DOMRectReadOnly;
--- a/layout/base/SelectionCarets.h
+++ b/layout/base/SelectionCarets.h
@@ -13,26 +13,21 @@
 #include "nsISelectionListener.h"
 #include "nsWeakPtr.h"
 #include "nsWeakReference.h"
 #include "Units.h"
 #include "mozilla/dom/SelectionStateChangedEvent.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/WeakPtr.h"
 
-class nsCanvasFrame;
 class nsDocShell;
 class nsFrameSelection;
 class nsIContent;
-class nsIDocument;
-class nsIFrame;
 class nsIPresShell;
 class nsITimer;
-class nsIWidget;
-class nsPresContext;
 
 namespace mozilla {
 
 namespace dom {
 class Selection;
 }
 
 /**
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -19,31 +19,28 @@
 #include "nsCounterManager.h"
 #include "nsCSSPseudoElements.h"
 #include "nsIAnonymousContentCreator.h"
 #include "nsFrameManager.h"
 #include "nsIDocument.h"
 #include "ScrollbarStyles.h"
 
 struct nsFrameItems;
-struct nsAbsoluteItems;
 class nsStyleContext;
 struct nsStyleDisplay;
-class nsIDOMHTMLSelectElement;
 struct nsGenConInitializer;
 
 class nsContainerFrame;
 class nsFirstLineFrame;
 class nsICSSAnonBoxPseudo;
 class nsPageContentFrame;
 struct PendingBinding;
 class nsGenericDOMDataNode;
 
 class nsFrameConstructorState;
-class nsFrameConstructorSaveState;
 
 namespace mozilla {
 
 class RestyleManager;
 
 namespace dom {
 
 class FlattenedChildIterator;
--- a/layout/base/nsIDocumentViewerPrint.h
+++ b/layout/base/nsIDocumentViewerPrint.h
@@ -6,17 +6,16 @@
 #define nsIDocumentViewerPrint_h___
 
 #include "nsISupports.h"
 
 class nsIDocument;
 class nsStyleSet;
 class nsIPresShell;
 class nsPresContext;
-class nsIWidget;
 class nsViewManager;
 
 // {c6f255cf-cadd-4382-b57f-cd2a9874169b}
 #define NS_IDOCUMENT_VIEWER_PRINT_IID \
 { 0xc6f255cf, 0xcadd, 0x4382, \
   { 0xb5, 0x7f, 0xcd, 0x2a, 0x98, 0x74, 0x16, 0x9b } }
 
 /**
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -89,17 +89,16 @@ class nsAPostRefreshObserver;
 #ifdef ACCESSIBILITY
 class nsAccessibilityService;
 namespace mozilla {
 namespace a11y {
 class DocAccessible;
 } // namespace a11y
 } // namespace mozilla
 #endif
-class nsIWidget;
 struct nsArenaMemoryStats;
 class nsITimer;
 
 typedef short SelectionType;
 
 namespace mozilla {
 class EventStates;
 
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -29,17 +29,16 @@
 #include "mozilla/gfx/2D.h"
 #include "Units.h"
 #include "mozilla/ToString.h"
 #include "nsHTMLReflowMetrics.h"
 
 #include <limits>
 #include <algorithm>
 
-class nsIFormControlFrame;
 class nsPresContext;
 class nsIContent;
 class nsIAtom;
 class nsIScrollableFrame;
 class nsIDOMEvent;
 class nsRegion;
 class nsDisplayListBuilder;
 class nsDisplayItem;
@@ -75,17 +74,16 @@ class HTMLImageElement;
 class HTMLCanvasElement;
 class HTMLVideoElement;
 } // namespace dom
 namespace gfx {
 struct RectCornerRadii;
 } // namespace gfx
 namespace layers {
 class Layer;
-class ClientLayerManager;
 }
 }
 
 namespace mozilla {
 
 struct DisplayPortPropertyData {
   DisplayPortPropertyData(const nsRect& aRect, uint32_t aPriority)
     : mRect(aRect)
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -34,37 +34,32 @@
 #include "mozilla/TimeStamp.h"
 #include "mozilla/AppUnits.h"
 #include "prclist.h"
 #include "nsThreadUtils.h"
 #include "ScrollbarStyles.h"
 #include "nsIMessageManager.h"
 #include "mozilla/RestyleLogging.h"
 
-class nsBidiPresUtils;
 class nsAString;
 class nsIPrintSettings;
 class nsDocShell;
 class nsIDocShell;
 class nsIDocument;
 class nsILanguageAtomService;
 class nsITheme;
 class nsIContent;
 class nsIFrame;
 class nsFrameManager;
 class nsILinkHandler;
 class nsIAtom;
-class nsICSSPseudoComparator;
-struct nsStyleBackground;
-struct nsStyleBorder;
 class nsIRunnable;
 class gfxUserFontEntry;
 class gfxUserFontSet;
 class gfxTextPerfMetrics;
-struct nsFontFaceRuleContainer;
 class nsPluginFrame;
 class nsTransitionManager;
 class nsAnimationManager;
 class nsRefreshDriver;
 class nsIWidget;
 class nsDeviceContext;
 class gfxMissingFontRecorder;
 
--- a/layout/base/nsPresShell.h
+++ b/layout/base/nsPresShell.h
@@ -33,17 +33,16 @@
 #include "nsContentUtils.h" // For AddScriptBlocker().
 #include "nsRefreshDriver.h"
 #include "TouchManager.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/MemoryReporting.h"
 
 class nsRange;
-class nsIDragService;
 
 struct RangePaintInfo;
 struct nsCallbackEventRequest;
 #ifdef MOZ_REFLOW_PERF
 class ReflowCountMgr;
 #endif
 
 class nsPresShellEventCB;
--- a/layout/base/nsRefreshDriver.h
+++ b/layout/base/nsRefreshDriver.h
@@ -23,17 +23,16 @@
 #include "mozilla/Maybe.h"
 #include "GeckoProfiler.h"
 #include "mozilla/layers/TransactionIdAllocator.h"
 
 class nsPresContext;
 class nsIPresShell;
 class nsIDocument;
 class imgIRequest;
-class nsIRunnable;
 
 namespace mozilla {
 class RefreshDriverTimer;
 namespace layout {
 class VsyncChild;
 }
 }
 
--- a/layout/build/nsContentDLF.h
+++ b/layout/build/nsContentDLF.h
@@ -6,18 +6,16 @@
 #ifndef nsContentDLF_h__
 #define nsContentDLF_h__
 
 #include "nsIDocumentLoaderFactory.h"
 #include "nsMimeTypes.h"
 
 class nsIChannel;
 class nsIContentViewer;
-class nsIFile;
-class nsIInputStream;
 class nsILoadGroup;
 class nsIStreamListener;
 
 #define CONTENT_DLF_CONTRACTID "@mozilla.org/content/document-loader-factory;1"
 #define PLUGIN_DLF_CONTRACTID "@mozilla.org/content/plugin/document-loader-factory;1"
 
 class nsContentDLF : public nsIDocumentLoaderFactory
 {
--- a/layout/forms/nsFileControlFrame.h
+++ b/layout/forms/nsFileControlFrame.h
@@ -8,17 +8,16 @@
 
 #include "mozilla/Attributes.h"
 #include "nsBlockFrame.h"
 #include "nsIFormControlFrame.h"
 #include "nsIDOMEventListener.h"
 #include "nsIAnonymousContentCreator.h"
 #include "nsCOMPtr.h"
 
-class nsTextControlFrame;
 class nsIDOMDataTransfer;
 
 class nsFileControlFrame : public nsBlockFrame,
                            public nsIFormControlFrame,
                            public nsIAnonymousContentCreator
 {
 public:
   explicit nsFileControlFrame(nsStyleContext* aContext);
--- a/layout/forms/nsListControlFrame.h
+++ b/layout/forms/nsListControlFrame.h
@@ -24,18 +24,16 @@
 #include "nsAutoPtr.h"
 #include "nsSelectsAreaFrame.h"
 
 // X.h defines KeyPress
 #ifdef KeyPress
 #undef KeyPress
 #endif
 
-class nsIDOMHTMLSelectElement;
-class nsIDOMHTMLOptionsCollection;
 class nsIComboboxControlFrame;
 class nsPresContext;
 class nsListEventListener;
 
 namespace mozilla {
 namespace dom {
 class HTMLOptionElement;
 class HTMLOptionsCollection;
--- a/layout/forms/nsProgressFrame.h
+++ b/layout/forms/nsProgressFrame.h
@@ -6,18 +6,16 @@
 #ifndef nsProgressFrame_h___
 #define nsProgressFrame_h___
 
 #include "mozilla/Attributes.h"
 #include "nsContainerFrame.h"
 #include "nsIAnonymousContentCreator.h"
 #include "nsCOMPtr.h"
 
-class nsBaseContentList;
-
 class nsProgressFrame : public nsContainerFrame,
                         public nsIAnonymousContentCreator
 {
   typedef mozilla::dom::Element Element;
 
 public:
   NS_DECL_QUERYFRAME_TARGET(nsProgressFrame)
   NS_DECL_QUERYFRAME
--- a/layout/forms/nsRangeFrame.h
+++ b/layout/forms/nsRangeFrame.h
@@ -9,17 +9,16 @@
 #include "mozilla/Attributes.h"
 #include "mozilla/Decimal.h"
 #include "mozilla/EventForwards.h"
 #include "nsContainerFrame.h"
 #include "nsIAnonymousContentCreator.h"
 #include "nsIDOMEventListener.h"
 #include "nsCOMPtr.h"
 
-class nsBaseContentList;
 class nsDisplayRangeFocusRing;
 
 class nsRangeFrame : public nsContainerFrame,
                      public nsIAnonymousContentCreator
 {
   friend nsIFrame*
   NS_NewRangeFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
--- a/layout/generic/ScrollbarActivity.h
+++ b/layout/generic/ScrollbarActivity.h
@@ -10,17 +10,16 @@
 #include "nsCOMPtr.h"
 #include "nsIDOMEventListener.h"
 #include "mozilla/TimeStamp.h"
 #include "nsRefreshDriver.h"
 
 class nsIContent;
 class nsIScrollbarMediator;
 class nsITimer;
-class nsIAtom;
 
 namespace mozilla {
 namespace layout {
 
 /**
  * ScrollbarActivity
  *
  * This class manages scrollbar behavior that imitates the native Mac OS X
--- a/layout/generic/TextOverflow.h
+++ b/layout/generic/TextOverflow.h
@@ -8,17 +8,16 @@
 #define TextOverflow_h_
 
 #include "nsDisplayList.h"
 #include "nsTHashtable.h"
 #include "mozilla/Likely.h"
 #include <algorithm>
 
 class nsIScrollableFrame;
-class gfxTextRun;
 class nsLineBox;
 
 namespace mozilla {
 namespace css {
 
 /**
  * A class for rendering CSS3 text-overflow.
  * Usage:
--- a/layout/generic/nsBlockFrame.h
+++ b/layout/generic/nsBlockFrame.h
@@ -39,17 +39,16 @@ enum LineReflowStatus {
   // The line did not fit in the available vertical space. Try pushing it to
   // the next page or column if it's not the first line on the current page/column.
   LINE_REFLOW_TRUNCATED
 };
 
 class nsBlockReflowState;
 class nsBlockInFlowLineIterator;
 class nsBulletFrame;
-class nsFirstLineFrame;
 
 /**
  * Some invariants:
  * -- The overflow out-of-flows list contains the out-of-
  * flow frames whose placeholders are in the overflow list.
  * -- A given piece of content has at most one placeholder
  * frame in a block's normal child list.
  * -- While a block is being reflowed, and from then until
--- a/layout/generic/nsBlockReflowContext.h
+++ b/layout/generic/nsBlockReflowContext.h
@@ -11,18 +11,16 @@
 
 #include "nsIFrame.h"
 #include "nsHTMLReflowMetrics.h"
 
 class nsBlockReflowState;
 struct nsHTMLReflowState;
 class nsLineBox;
 class nsPresContext;
-class nsLineLayout;
-struct nsBlockHorizontalAlign;
 
 /**
  * An encapsulation of the state and algorithm for reflowing block frames.
  */
 class nsBlockReflowContext {
 public:
   nsBlockReflowContext(nsPresContext* aPresContext,
                        const nsHTMLReflowState& aParentRS);
--- a/layout/generic/nsFrame.h
+++ b/layout/generic/nsFrame.h
@@ -92,17 +92,16 @@
   void* class::operator new(size_t sz, nsIPresShell* aShell)      \
   { return aShell->AllocateFrame(nsQueryFrame::class##_id, sz); } \
   nsQueryFrame::FrameIID class::GetFrameId()                      \
   { return nsQueryFrame::class##_id; }
 
 //----------------------------------------------------------------------
 
 struct nsBoxLayoutMetrics;
-class nsDisplayBackgroundImage;
 struct nsRect;
 
 /**
  * Implementation of a simple frame that's not splittable and has no
  * child frames.
  *
  * Sets the NS_FRAME_SYNCHRONIZE_FRAME_AND_VIEW bit, so the default
  * behavior is to keep the frame and view position and size in sync.
--- a/layout/generic/nsFrameSelection.h
+++ b/layout/generic/nsFrameSelection.h
@@ -15,17 +15,16 @@
 #include "nsISelectionListener.h"
 #include "nsITableCellLayout.h"
 #include "nsIDOMElement.h"
 #include "WordMovementType.h"
 #include "CaretAssociationHint.h"
 #include "nsBidiPresUtils.h"
 
 class nsRange;
-class nsTableOuterFrame;
 
 // IID for the nsFrameSelection interface
 // 3c6ae2d0-4cf1-44a1-9e9d-2411867f19c6
 #define NS_FRAME_SELECTION_IID      \
 { 0x3c6ae2d0, 0x4cf1, 0x44a1, \
   { 0x9e, 0x9d, 0x24, 0x11, 0x86, 0x7f, 0x19, 0xc6 } }
 
 #define BIDI_LEVEL_UNDEFINED 0x80
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -22,17 +22,16 @@
 #include "nsExpirationTracker.h"
 #include "TextOverflow.h"
 #include "ScrollVelocityQueue.h"
 
 class nsPresContext;
 class nsIPresShell;
 class nsIContent;
 class nsIAtom;
-class nsIScrollFrameInternal;
 class nsPresState;
 class nsIScrollPositionListener;
 struct ScrollReflowState;
 
 namespace mozilla {
 namespace layers {
 class Layer;
 }
--- a/layout/generic/nsHTMLParts.h
+++ b/layout/generic/nsHTMLParts.h
@@ -9,24 +9,22 @@
 #define nsHTMLParts_h___
 
 #include "nscore.h"
 #include "nsISupports.h"
 #include "nsIFrame.h"
 class nsIAtom;
 class nsNodeInfoManager;
 class nsIContent;
-class nsIContentIterator;
 class nsIDocument;
 class nsIFrame;
 class nsIHTMLContentSink;
 class nsIFragmentContentSink;
 class nsStyleContext;
 class nsIURI;
-class nsString;
 class nsIPresShell;
 class nsIChannel;
 class nsTableColFrame;
 
 // These are all the block specific frame bits, they are copied from
 // the prev-in-flow to a newly created next-in-flow, except for the
 // NS_BLOCK_FLAGS_NON_INHERITED_MASK bits below.
 #define NS_BLOCK_FLAGS_MASK (NS_BLOCK_MARGIN_ROOT              | \
--- a/layout/generic/nsIAnonymousContentCreator.h
+++ b/layout/generic/nsIAnonymousContentCreator.h
@@ -10,17 +10,16 @@
 
 #ifndef nsIAnonymousContentCreator_h___
 #define nsIAnonymousContentCreator_h___
 
 #include "nsQueryFrame.h"
 #include "nsStyleContext.h"
 #include "nsTArrayForwardDeclare.h"
 
-class nsBaseContentList;
 class nsIContent;
 class nsIFrame;
 
 /**
  * Any source for anonymous content can implement this interface to provide it.
  * HTML frames like nsFileControlFrame currently use this.
  *
  * @see nsCSSFrameConstructor
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -54,24 +54,22 @@
  *    then you must make sure that its view (or its child frame's views) are re-positioned
  *    as well. It's reasonable to not position the view until after all reflowing the
  *    entire line, for example, but the frame should still be positioned and sized (and
  *    the view sized) during the reflow (i.e., before sending the DidReflow() notification)
  * 5. the view system handles moving of widgets, i.e., it's not our problem
  */
 
 struct nsHTMLReflowState;
-class nsHTMLReflowCommand;
 class nsIAtom;
 class nsPresContext;
 class nsIPresShell;
 class nsRenderingContext;
 class nsView;
 class nsIWidget;
-class nsIDOMRange;
 class nsISelectionController;
 class nsBoxLayoutState;
 class nsBoxLayout;
 class nsILineIterator;
 class nsDisplayListBuilder;
 class nsDisplayListSet;
 class nsDisplayList;
 class gfxSkipChars;
--- a/layout/generic/nsPluginFrame.h
+++ b/layout/generic/nsPluginFrame.h
@@ -24,17 +24,16 @@
 #undef GetClassName
 #undef GetBinaryType
 #undef RemoveDirectory
 #endif
 
 class nsPresContext;
 class nsRootPresContext;
 class nsDisplayPlugin;
-class nsIOSurface;
 class PluginBackgroundSink;
 class nsPluginInstanceOwner;
 
 namespace mozilla {
 namespace layers {
 class ImageContainer;
 class Layer;
 class LayerManager;
--- a/layout/generic/nsRubyFrame.h
+++ b/layout/generic/nsRubyFrame.h
@@ -7,17 +7,16 @@
 /* rendering object for CSS "display: ruby" */
 
 #ifndef nsRubyFrame_h___
 #define nsRubyFrame_h___
 
 #include "nsInlineFrame.h"
 
 class nsRubyBaseContainerFrame;
-class nsRubyTextContainerFrame;
 
 typedef nsInlineFrame nsRubyFrameSuper;
 
 /**
  * Factory function.
  * @return a newly allocated nsRubyFrame (infallible)
  */
 nsContainerFrame* NS_NewRubyFrame(nsIPresShell* aPresShell,
--- a/layout/inspector/inLayoutUtils.h
+++ b/layout/inspector/inLayoutUtils.h
@@ -5,20 +5,16 @@
 
 #ifndef __inLayoutUtils_h__
 #define __inLayoutUtils_h__
 
 class nsIDocument;
 class nsIDOMDocument;
 class nsIDOMElement;
 class nsIDOMNode;
-class nsIDOMWindow;
-class nsIFrame;
-class nsIPresShell;
-class nsISupports;
 
 namespace mozilla {
 class EventStateManager;
 }
 
 class inLayoutUtils
 {
 public:
--- a/layout/inspector/nsFontFace.h
+++ b/layout/inspector/nsFontFace.h
@@ -5,17 +5,16 @@
 #ifndef __nsFontFace_h__
 #define __nsFontFace_h__
 
 #include "nsIDOMFontFace.h"
 #include "nsAutoPtr.h"
 
 class gfxFontEntry;
 class gfxFontGroup;
-class nsCSSFontFaceRule;
 
 class nsFontFace : public nsIDOMFontFace
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMFONTFACE
 
   nsFontFace(gfxFontEntry*      aFontEntry,
--- a/layout/printing/nsPrintEngine.h
+++ b/layout/printing/nsPrintEngine.h
@@ -20,23 +20,21 @@
 
 // Interfaces
 #include "nsIDOMWindow.h"
 #include "nsIObserver.h"
 
 // Classes
 class nsPagePrintTimer;
 class nsIDocShell;
-class nsDeviceContext;
 class nsIDocument;
 class nsIDocumentViewerPrint;
 class nsPrintObject;
 class nsIDocShell;
 class nsIPageSequenceFrame;
-class nsIWeakReference;
 
 //------------------------------------------------------------------------
 // nsPrintEngine Class
 //
 //------------------------------------------------------------------------
 class nsPrintEngine final : public nsIObserver,
                             public nsIWebProgressListener,
                             public nsSupportsWeakReference
--- a/layout/style/AnimationCommon.h
+++ b/layout/style/AnimationCommon.h
@@ -23,17 +23,16 @@
 #include "mozilla/Assertions.h"
 #include "mozilla/FloatingPoint.h"
 #include "nsCSSPseudoElements.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsCSSPropertySet.h"
 
 class nsIFrame;
 class nsPresContext;
-class nsStyleChangeList;
 
 namespace mozilla {
 
 class RestyleTracker;
 struct AnimationCollection;
 
 namespace css {
 
--- a/layout/style/CSSStyleSheet.h
+++ b/layout/style/CSSStyleSheet.h
@@ -24,17 +24,16 @@
 #include "nsString.h"
 #include "mozilla/CORSMode.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsWrapperCache.h"
 #include "mozilla/net/ReferrerPolicy.h"
 
 class CSSRuleListImpl;
 class nsCSSRuleProcessor;
-class nsICSSRuleList;
 class nsIPrincipal;
 class nsIURI;
 class nsMediaList;
 class nsMediaQueryResultCacheKey;
 class nsPresContext;
 class nsXMLNameSpaceMap;
 
 namespace mozilla {
--- a/layout/style/CSSValue.h
+++ b/layout/style/CSSValue.h
@@ -7,17 +7,16 @@
 /* DOM object representing values in DOM computed style */
 
 #ifndef mozilla_dom_CSSValue_h_
 #define mozilla_dom_CSSValue_h_
 
 #include "nsWrapperCache.h"
 #include "nsStringFwd.h"
 
-class nsIDOMCSSValue;
 class nsROCSSPrimitiveValue;
 namespace mozilla {
 class ErrorResult;
 }
 
 namespace mozilla {
 namespace dom {
 
--- a/layout/style/CounterStyleManager.h
+++ b/layout/style/CounterStyleManager.h
@@ -12,17 +12,16 @@
 
 #include "nsStyleConsts.h"
 
 #include "mozilla/Attributes.h"
 
 #include "nsCSSValue.h"
 
 class nsPresContext;
-class nsCSSCounterStyleRule;
 
 namespace mozilla {
 
 class WritingMode;
 
 typedef int32_t CounterValue;
 
 class CounterStyleManager;
--- a/layout/style/Loader.h
+++ b/layout/style/Loader.h
@@ -18,24 +18,21 @@
 #include "nsTArray.h"
 #include "nsTObserverArray.h"
 #include "nsURIHashKey.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/CORSMode.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/net/ReferrerPolicy.h"
 
-class nsIAtom;
 class nsICSSLoaderObserver;
 class nsIContent;
 class nsIDocument;
-class nsCSSParser;
 class nsMediaList;
 class nsIStyleSheetLinkingElement;
-class nsCycleCollectionTraversalCallback;
 
 namespace mozilla {
 class CSSStyleSheet;
 namespace dom {
 class Element;
 }
 }
 
--- a/layout/style/Rule.h
+++ b/layout/style/Rule.h
@@ -8,17 +8,16 @@
 #ifndef mozilla_css_Rule_h___
 #define mozilla_css_Rule_h___
 
 #include "mozilla/CSSStyleSheet.h"
 #include "mozilla/MemoryReporting.h"
 #include "nsIStyleRule.h"
 #include "nsIDOMCSSRule.h"
 
-class nsIStyleSheet;
 class nsIDocument;
 struct nsRuleData;
 template<class T> struct already_AddRefed;
 class nsHTMLCSSStyleSheet;
 
 namespace mozilla {
 namespace css {
 class GroupRule;
--- a/layout/style/SVGAttrAnimationRuleProcessor.h
+++ b/layout/style/SVGAttrAnimationRuleProcessor.h
@@ -9,17 +9,16 @@
  * attributes (attributes whose values are mapped into style)
  */
 
 #ifndef mozilla_SVGAttrAnimationRuleProcessor_h_
 #define mozilla_SVGAttrAnimationRuleProcessor_h_
 
 #include "nsIStyleRuleProcessor.h"
 
-class nsIDocument;
 class nsRuleWalker;
 
 namespace mozilla {
 
 namespace dom {
 class Element;
 }
 
--- a/layout/style/StyleRule.h
+++ b/layout/style/StyleRule.h
@@ -17,17 +17,16 @@
 
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsCSSPseudoElements.h"
 #include "nsCSSPseudoClasses.h"
 
 class nsIAtom;
 struct nsCSSSelectorList;
-class nsCSSCompressedDataBlock;
 
 namespace mozilla {
 class CSSStyleSheet;
 } // namespace mozilla
 
 struct nsAtomList {
 public:
   explicit nsAtomList(nsIAtom* aAtom);
--- a/layout/style/nsAnimationManager.h
+++ b/layout/style/nsAnimationManager.h
@@ -8,17 +8,16 @@
 #include "mozilla/Attributes.h"
 #include "mozilla/ContentEvents.h"
 #include "AnimationCommon.h"
 #include "nsCSSPseudoElements.h"
 #include "mozilla/dom/Animation.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/TimeStamp.h"
 
-class nsCSSKeyframesRule;
 class nsStyleContext;
 
 namespace mozilla {
 namespace css {
 class Declaration;
 } /* namespace css */
 namespace dom {
 class Promise;
--- a/layout/style/nsCSSRuleProcessor.h
+++ b/layout/style/nsCSSRuleProcessor.h
@@ -17,18 +17,20 @@
 #include "mozilla/MemoryReporting.h"
 #include "nsIStyleRuleProcessor.h"
 #include "nsTArray.h"
 #include "nsAutoPtr.h"
 #include "nsRuleWalker.h"
 #include "mozilla/UniquePtr.h"
 
 struct CascadeEnumData;
+struct ElementDependentRuleProcessorData;
 struct nsCSSSelector;
 struct nsCSSSelectorList;
+struct nsFontFaceRuleContainer;
 struct RuleCascadeData;
 struct TreeMatchContext;
 class nsCSSKeyframesRule;
 class nsCSSPageRule;
 class nsCSSFontFeatureValuesRule;
 class nsCSSCounterStyleRule;
 
 namespace mozilla {
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -29,43 +29,22 @@ class Element;
 
 struct nsComputedStyleMap;
 class nsIFrame;
 class nsIPresShell;
 class nsDOMCSSValueList;
 struct nsMargin;
 class nsROCSSPrimitiveValue;
 struct nsStyleBackground;
-struct nsStyleBorder;
-struct nsStyleContent;
-struct nsStyleColumn;
-struct nsStyleColor;
 class nsStyleCoord;
 class nsStyleCorners;
-struct nsStyleDisplay;
 struct nsStyleFilter;
-struct nsStyleFont;
 class nsStyleGradient;
 struct nsStyleImage;
-struct nsStyleList;
-struct nsStyleMargin;
-struct nsStyleOutline;
-struct nsStylePadding;
-struct nsStylePosition;
-struct nsStyleQuotes;
 class nsStyleSides;
-struct nsStyleSVG;
-struct nsStyleSVGReset;
-struct nsStyleTable;
-struct nsStyleText;
-struct nsStyleTextReset;
-class nsStyleTimingFunction;
-struct nsStyleUIReset;
-struct nsStyleVisibility;
-struct nsStyleXUL;
 struct nsTimingFunction;
 class gfx3DMatrix;
 
 class nsComputedDOMStyle final : public nsDOMCSSDeclaration
 {
 public:
   typedef nsCSSProps::KTableValue KTableValue;
 
--- a/layout/style/nsFontFaceLoader.h
+++ b/layout/style/nsFontFaceLoader.h
@@ -13,17 +13,16 @@
 #include "nsCOMPtr.h"
 #include "nsIStreamLoader.h"
 #include "nsIChannel.h"
 #include "gfxUserFontSet.h"
 #include "nsHashKeys.h"
 #include "nsTHashtable.h"
 #include "nsCSSRules.h"
 
-class nsPresContext;
 class nsIPrincipal;
 
 class nsFontFaceLoader : public nsIStreamLoaderObserver
 {
 public:
   nsFontFaceLoader(gfxUserFontEntry* aFontToLoad, nsIURI* aFontURI,
                    mozilla::dom::FontFaceSet* aFontFaceSet,
                    nsIChannel* aChannel);
--- a/layout/style/nsICSSPseudoComparator.h
+++ b/layout/style/nsICSSPseudoComparator.h
@@ -3,17 +3,16 @@
  * 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/. */
 
 /* internal interface for implementing complex pseudo-classes */
 
 #ifndef nsICSSPseudoComparator_h___
 #define nsICSSPseudoComparator_h___
 
-class nsIAtom;
 struct nsCSSSelector;
 
 class nsICSSPseudoComparator
 {
 public:
   virtual bool PseudoMatches(nsCSSSelector* aSelector)=0;
 };
 
--- a/layout/style/nsIStyleRuleProcessor.h
+++ b/layout/style/nsIStyleRuleProcessor.h
@@ -12,17 +12,16 @@
 #ifndef nsIStyleRuleProcessor_h___
 #define nsIStyleRuleProcessor_h___
 
 #include "mozilla/MemoryReporting.h"
 #include "nsISupports.h"
 #include "nsChangeHint.h"
 
 struct RuleProcessorData;
-struct ElementDependentRuleProcessorData;
 struct ElementRuleProcessorData;
 struct PseudoElementRuleProcessorData;
 struct AnonBoxRuleProcessorData;
 #ifdef MOZ_XUL
 struct XULTreeRuleProcessorData;
 #endif
 struct StateRuleProcessorData;
 struct PseudoElementStateRuleProcessorData;
--- a/layout/style/nsRuleNode.h
+++ b/layout/style/nsRuleNode.h
@@ -15,17 +15,16 @@
 #include "nsStyleStruct.h"
 
 class nsStyleContext;
 struct nsRuleData;
 class nsIStyleRule;
 struct nsCSSValueList;
 class nsCSSPropertySet;
 class nsCSSValue;
-struct nsCSSRect;
 
 class nsStyleCoord;
 struct nsCSSValuePairList;
 
 template <nsStyleStructID MinIndex, nsStyleStructID Count>
 class FixedStyleStructArray
 {
 private:
--- a/layout/style/nsRuleProcessorData.h
+++ b/layout/style/nsRuleProcessorData.h
@@ -18,21 +18,19 @@
 #include "nsNthIndexCache.h"
 #include "nsILoadContext.h"
 #include "nsIDocument.h"
 #include "mozilla/AutoRestore.h"
 #include "mozilla/BloomFilter.h"
 #include "mozilla/EventStates.h"
 #include "mozilla/GuardObjects.h"
 
-class nsAttrValue;
 class nsIAtom;
 class nsIContent;
 class nsICSSPseudoComparator;
-class nsIStyleSheet;
 struct TreeMatchContext;
 
 /**
  * An AncestorFilter is used to keep track of ancestors so that we can
  * quickly tell that a particular selector is not relevant to a given
  * element.
  */
 class MOZ_STACK_CLASS AncestorFilter {
--- a/layout/style/nsStyleSet.h
+++ b/layout/style/nsStyleSet.h
@@ -21,23 +21,24 @@
 #include "nsRuleNode.h"
 #include "nsTArray.h"
 #include "nsCOMArray.h"
 #include "nsAutoPtr.h"
 #include "nsIStyleRule.h"
 #include "nsCSSPseudoElements.h"
 
 class gfxFontFeatureValueSet;
-class nsCSSFontFaceRule;
 class nsCSSKeyframesRule;
 class nsCSSFontFeatureValuesRule;
 class nsCSSPageRule;
 class nsCSSCounterStyleRule;
+class nsICSSPseudoComparator;
 class nsRuleWalker;
 struct ElementDependentRuleProcessorData;
+struct nsFontFaceRuleContainer;
 struct TreeMatchContext;
 
 namespace mozilla {
 class EventStates;
 } // namespace mozilla
 
 class nsEmptyStyleRule final : public nsIStyleRule
 {
--- a/layout/style/nsTransitionManager.h
+++ b/layout/style/nsTransitionManager.h
@@ -13,17 +13,16 @@
 #include "mozilla/dom/Animation.h"
 #include "mozilla/dom/KeyframeEffect.h"
 #include "AnimationCommon.h"
 #include "nsCSSPseudoElements.h"
 
 class nsStyleContext;
 class nsPresContext;
 class nsCSSPropertySet;
-struct ElementDependentRuleProcessorData;
 
 namespace mozilla {
 struct StyleTransition;
 }
 
 /*****************************************************************************
  * Per-Element data                                                          *
  *****************************************************************************/
--- a/layout/svg/nsCSSFilterInstance.h
+++ b/layout/svg/nsCSSFilterInstance.h
@@ -8,17 +8,16 @@
 
 #include "FilterSupport.h"
 #include "gfxMatrix.h"
 #include "gfxRect.h"
 #include "mozilla/gfx/Point.h"
 #include "mozilla/gfx/Types.h"
 #include "nsColor.h"
 
-class nsIFrame;
 struct nsStyleFilter;
 template<class T> class nsTArray;
 
 /**
  * This class helps nsFilterInstance build its filter graph. It turns a CSS
  * filter function (e.g. blur(3px)) from the style system into a
  * FilterPrimitiveDescription connected to the filter graph.
  */
--- a/layout/svg/nsISVGChildFrame.h
+++ b/layout/svg/nsISVGChildFrame.h
@@ -9,17 +9,16 @@
 #include "gfxRect.h"
 #include "nsQueryFrame.h"
 
 class gfxContext;
 class gfxMatrix;
 class nsIFrame;
 class SVGBBox;
 
-struct nsPoint;
 struct nsRect;
 
 namespace mozilla {
 class SVGAnimatedLengthList;
 class SVGAnimatedNumberList;
 class SVGLengthList;
 class SVGNumberList;
 class SVGUserUnitList;
--- a/layout/svg/nsSVGContainerFrame.h
+++ b/layout/svg/nsSVGContainerFrame.h
@@ -16,17 +16,16 @@
 #include "nsSVGUtils.h"
 
 class gfxContext;
 class nsFrameList;
 class nsIContent;
 class nsIPresShell;
 class nsStyleContext;
 
-struct nsPoint;
 struct nsRect;
 
 typedef nsContainerFrame nsSVGContainerFrameBase;
 
 /**
  * Base class for SVG container frames. Frame sub-classes that do not
  * display their contents directly (such as the frames for <marker> or
  * <pattern>) just inherit this class. Frame sub-classes that do or can
--- a/layout/svg/nsSVGFilterFrame.h
+++ b/layout/svg/nsSVGFilterFrame.h
@@ -12,17 +12,16 @@
 #include "nsSVGContainerFrame.h"
 #include "nsSVGUtils.h"
 
 class nsIAtom;
 class nsIContent;
 class nsIFrame;
 class nsIPresShell;
 class nsStyleContext;
-class nsSVGIntegerPair;
 class nsSVGLength2;
 
 struct nsRect;
 
 namespace mozilla {
 namespace dom {
 class SVGFilterElement;
 }
--- a/layout/svg/nsSVGFilterInstance.h
+++ b/layout/svg/nsSVGFilterInstance.h
@@ -8,17 +8,16 @@
 
 #include "gfxMatrix.h"
 #include "gfxRect.h"
 #include "nsSVGFilters.h"
 #include "nsSVGNumber2.h"
 #include "nsSVGNumberPair.h"
 #include "nsTArray.h"
 
-class nsIFrame;
 class nsSVGFilterFrame;
 struct nsStyleFilter;
 
 namespace mozilla {
 namespace dom {
 class SVGFilterElement;
 }
 }
--- a/layout/svg/nsSVGForeignObjectFrame.h
+++ b/layout/svg/nsSVGForeignObjectFrame.h
@@ -9,17 +9,16 @@
 #include "mozilla/Attributes.h"
 #include "nsContainerFrame.h"
 #include "nsIPresShell.h"
 #include "nsISVGChildFrame.h"
 #include "nsRegion.h"
 #include "nsSVGUtils.h"
 
 class gfxContext;
-class nsSVGOuterSVGFrame;
 
 typedef nsContainerFrame nsSVGForeignObjectFrameBase;
 
 class nsSVGForeignObjectFrame : public nsSVGForeignObjectFrameBase,
                                 public nsISVGChildFrame
 {
   friend nsContainerFrame*
   NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
--- a/layout/svg/nsSVGPathGeometryFrame.h
+++ b/layout/svg/nsSVGPathGeometryFrame.h
@@ -25,17 +25,16 @@ class gfxContext;
 class nsDisplaySVGPathGeometry;
 class nsIAtom;
 class nsIFrame;
 class nsIPresShell;
 class nsStyleContext;
 class nsSVGMarkerFrame;
 class nsSVGMarkerProperty;
 
-struct nsPoint;
 struct nsRect;
 
 typedef nsFrame nsSVGPathGeometryFrameBase;
 
 class nsSVGPathGeometryFrame : public nsSVGPathGeometryFrameBase,
                                public nsISVGChildFrame
 {
   typedef mozilla::gfx::DrawTarget DrawTarget;
--- a/layout/svg/nsSVGPatternFrame.h
+++ b/layout/svg/nsSVGPatternFrame.h
@@ -7,20 +7,17 @@
 #define __NS_SVGPATTERNFRAME_H__
 
 #include "mozilla/Attributes.h"
 #include "gfxMatrix.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/RefPtr.h"
 #include "nsSVGPaintServerFrame.h"
 
-class gfxASurface;
-class gfxContext;
 class nsIFrame;
-class nsSVGElement;
 class nsSVGLength2;
 class nsSVGPathGeometryFrame;
 class nsSVGViewBox;
 
 namespace mozilla {
 class SVGAnimatedPreserveAspectRatio;
 class nsSVGAnimatedTransformList;
 } // namespace mozilla
--- a/layout/svg/nsSVGUtils.h
+++ b/layout/svg/nsSVGUtils.h
@@ -23,50 +23,43 @@
 #include "nsID.h"
 #include "nsISupportsBase.h"
 #include "nsMathUtils.h"
 #include "nsStyleStruct.h"
 #include "mozilla/Constants.h"
 #include <algorithm>
 
 class gfxContext;
-class gfxPattern;
 class nsFrameList;
 class nsIContent;
 class nsIDocument;
 class nsIFrame;
 class nsPresContext;
 class nsStyleContext;
-class nsStyleCoord;
-class nsSVGClipPathFrame;
 class nsSVGDisplayContainerFrame;
 class nsSVGElement;
 class nsSVGEnum;
 class nsSVGLength2;
 class nsSVGOuterSVGFrame;
 class nsSVGPathGeometryFrame;
 class nsTextFrame;
 class gfxTextContextPaint;
 
 struct nsStyleSVG;
 struct nsStyleSVGPaint;
 struct nsRect;
-struct nsPoint;
 
 namespace mozilla {
-class SVGAnimatedPreserveAspectRatio;
-class SVGPreserveAspectRatio;
 namespace dom {
 class Element;
 class UserSpaceMetrics;
 } // namespace dom
 namespace gfx {
 class DrawTarget;
 class GeneralPattern;
-class SourceSurface;
 }
 } // namespace mozilla
 
 // maximum dimension of an offscreen surface - choose so that
 // the surface size doesn't overflow a 32-bit signed int using
 // 4 bytes per pixel; in line with gfxASurface::CheckSurfaceSize
 // In fact Macs can't even manage that
 #define NS_SVG_OFFSCREEN_MAX_DIMENSION 4096
--- a/layout/tables/SpanningCellSorter.h
+++ b/layout/tables/SpanningCellSorter.h
@@ -10,18 +10,16 @@
 /*
  * Code to sort cells by their colspan, used by BasicTableLayoutStrategy.
  */
 
 #include "pldhash.h"
 #include "nsDebug.h"
 #include "StackArena.h"
 
-class nsIPresShell;
-
 /**
  * The SpanningCellSorter is responsible for accumulating lists of cells
  * with colspans so that those cells can later be enumerated, sorted
  * from lowest number of columns spanned to highest.  It does not use a
  * stable sort (in fact, it currently reverses).
  */
 class MOZ_STACK_CLASS SpanningCellSorter {
 public:
--- a/layout/tables/nsCellMap.h
+++ b/layout/tables/nsCellMap.h
@@ -12,17 +12,16 @@
 #include "nsCOMPtr.h"
 #include "nsAlgorithm.h"
 #include "nsAutoPtr.h"
 #include "nsRect.h"
 #include <algorithm>
 
 #undef DEBUG_TABLE_CELLMAP
 
-class nsTableColFrame;
 class nsTableCellFrame;
 class nsTableRowFrame;
 class nsTableRowGroupFrame;
 class nsTableFrame;
 class nsCellMap;
 class nsPresContext;
 class nsCellMapColumnIterator;
 
--- a/layout/tables/nsTableColFrame.h
+++ b/layout/tables/nsTableColFrame.h
@@ -6,18 +6,16 @@
 #define nsTableColFrame_h__
 
 #include "mozilla/Attributes.h"
 #include "celldata.h"
 #include "nscore.h"
 #include "nsContainerFrame.h"
 #include "nsTArray.h"
 
-class nsTableCellFrame;
-
 enum nsTableColType {
   eColContent            = 0, // there is real col content associated
   eColAnonymousCol       = 1, // the result of a span on a col
   eColAnonymousColGroup  = 2, // the result of a span on a col group
   eColAnonymousCell      = 3  // the result of a cell alone
 };
 
 class nsTableColFrame : public nsSplittableFrame {
--- a/layout/tables/nsTableFrame.h
+++ b/layout/tables/nsTableFrame.h
@@ -16,25 +16,23 @@
 #include "nsTableColGroupFrame.h"
 #include "nsCellMap.h"
 #include "nsGkAtoms.h"
 #include "nsDisplayList.h"
 
 class nsTableCellFrame;
 class nsTableCellMap;
 class nsTableColFrame;
-class nsColGroupFrame;
 class nsTableRowGroupFrame;
 class nsTableRowFrame;
 class nsTableColGroupFrame;
 class nsITableLayoutStrategy;
 class nsStyleContext;
 
 struct nsTableReflowState;
-struct nsStylePosition;
 struct BCPropertyData;
 
 static inline bool IS_TABLE_CELL(nsIAtom* frameType) {
   return nsGkAtoms::tableCellFrame == frameType ||
     nsGkAtoms::bcTableCellFrame == frameType;
 }
 
 static inline bool FrameHasBorderOrBackground(nsIFrame* f) {
--- a/layout/tables/nsTableRowGroupFrame.h
+++ b/layout/tables/nsTableRowGroupFrame.h
@@ -10,17 +10,16 @@
 #include "nsContainerFrame.h"
 #include "nsIAtom.h"
 #include "nsILineIterator.h"
 #include "nsTablePainter.h"
 #include "nsTArray.h"
 
 class nsTableFrame;
 class nsTableRowFrame;
-class nsTableCellFrame;
 
 struct nsRowGroupReflowState {
   const nsHTMLReflowState& reflowState;  // Our reflow state
 
   nsTableFrame* tableFrame;
 
   // The available size (computed from the parent)
   nsSize availSize;
--- a/layout/xul/BoxObject.h
+++ b/layout/xul/BoxObject.h
@@ -15,17 +15,16 @@
 #include "nsAutoPtr.h"
 #include "nsHashKeys.h"
 #include "nsInterfaceHashtable.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsWrapperCache.h"
 #include "nsRect.h"
 
 class nsIFrame;
-class nsIDocShell;
 class nsIPresShell;
 
 namespace mozilla {
 namespace dom {
 
 class Element;
 
 class BoxObject : public nsPIBoxObject,
--- a/layout/xul/grid/nsGrid.h
+++ b/layout/xul/grid/nsGrid.h
@@ -6,18 +6,16 @@
 
 #ifndef nsGrid_h___
 #define nsGrid_h___
 
 #include "nsStackLayout.h"
 #include "nsIGridPart.h"
 #include "nsCOMPtr.h"
 
-class nsGridRowGroupLayout;
-class nsGridRowLayout;
 class nsBoxLayoutState;
 class nsGridCell;
 
 //#define DEBUG_grid 1
 
 /**
  * The grid data structure, i.e., the grid cellmap.
  */
--- a/layout/xul/grid/nsGridLayout2.h
+++ b/layout/xul/grid/nsGridLayout2.h
@@ -8,22 +8,20 @@
 #define nsGridLayout2_h___
 
 #include "mozilla/Attributes.h"
 #include "nsStackLayout.h"
 #include "nsIGridPart.h"
 #include "nsCoord.h"
 #include "nsGrid.h"
 
-class nsIPresContext;
 class nsGridRowGroupLayout;
 class nsGridRowLayout;
 class nsGridRow;
 class nsBoxLayoutState;
-class nsGridCell;
 
 /**
  * The nsBoxLayout implementation for a grid.
  */
 class nsGridLayout2 final : public nsStackLayout, 
                             public nsIGridPart
 {
 public:
--- a/layout/xul/grid/nsGridRow.h
+++ b/layout/xul/grid/nsGridRow.h
@@ -10,18 +10,16 @@
 
 **/
 
 #ifndef nsGridRow_h___
 #define nsGridRow_h___
 
 #include "nsCoord.h"
 
-class nsGridLayout2;
-class nsBoxLayoutState;
 class nsIFrame;
 
 /**
  * The row (or column) data structure in the grid cellmap.
  */
 class nsGridRow
 {
 public:
--- a/layout/xul/nsBoxLayoutState.h
+++ b/layout/xul/nsBoxLayoutState.h
@@ -13,21 +13,17 @@
 #ifndef nsBoxLayoutState_h___
 #define nsBoxLayoutState_h___
 
 #include "nsCOMPtr.h"
 #include "nsPresContext.h"
 #include "nsIPresShell.h"
 
 class nsRenderingContext;
-class nsCalculatedBoxInfo;
-class nsHTMLReflowMetrics;
 struct nsHTMLReflowState;
-class nsString;
-class nsHTMLReflowCommand;
 
 class MOZ_STACK_CLASS nsBoxLayoutState
 {
 public:
   explicit nsBoxLayoutState(nsPresContext* aPresContext,
                             nsRenderingContext* aRenderingContext = nullptr,
                             // see OuterReflowState() below
                             const nsHTMLReflowState* aOuterReflowState = nullptr,
--- a/layout/xul/nsIScrollbarMediator.h
+++ b/layout/xul/nsIScrollbarMediator.h
@@ -5,17 +5,16 @@
 
 #ifndef nsIScrollbarMediator_h___
 #define nsIScrollbarMediator_h___
 
 #include "nsQueryFrame.h"
 #include "nsCoord.h"
 
 class nsScrollbarFrame;
-class nsIDOMEventTarget;
 class nsIFrame;
 
 class nsIScrollbarMediator : public nsQueryFrame
 {
 public:
   NS_DECL_QUERYFRAME_TARGET(nsIScrollbarMediator)
 
   /**
--- a/layout/xul/nsLeafBoxFrame.h
+++ b/layout/xul/nsLeafBoxFrame.h
@@ -4,18 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsLeafBoxFrame_h___
 #define nsLeafBoxFrame_h___
 
 #include "mozilla/Attributes.h"
 #include "nsLeafFrame.h"
 #include "nsBox.h"
 
-class nsAccessKeyInfo;
-
 class nsLeafBoxFrame : public nsLeafFrame
 {
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   friend nsIFrame* NS_NewLeafBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
   virtual nsSize GetPrefSize(nsBoxLayoutState& aState) override;
--- a/layout/xul/nsMenuFrame.h
+++ b/layout/xul/nsMenuFrame.h
@@ -20,17 +20,16 @@
 #include "nsXULPopupManager.h"
 #include "nsITimer.h"
 #include "mozilla/Attributes.h"
 
 nsIFrame* NS_NewMenuFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame* NS_NewMenuItemFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 class nsIContent;
-class nsMenuBarFrame;
 
 #define NS_STATE_ACCELTEXT_IS_DERIVED  NS_STATE_BOX_CHILD_RESERVED
 
 // the type of menuitem
 enum nsMenuType {
   // a normal menuitem where a command is carried out when activated
   eMenuType_Normal = 0,
   // a menuitem with a checkmark that toggles when activated
--- a/layout/xul/nsMenuPopupFrame.h
+++ b/layout/xul/nsMenuPopupFrame.h
@@ -120,17 +120,16 @@ enum FlipType {
 //  nsMenuPopupFrame.h, nsListControlFrame.cpp, listbox.xml, tree.xml
 //  need to find a good place to put them together.
 //  if someone changes one, please also change the other.
 
 #define CONTEXT_MENU_OFFSET_PIXELS 2
 
 nsIFrame* NS_NewMenuPopupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
-class nsViewManager;
 class nsView;
 class nsMenuPopupFrame;
 
 // this class is used for dispatching popupshown events asynchronously.
 class nsXULPopupShownEvent : public nsRunnable, public nsIDOMEventListener
 {
 public:
   nsXULPopupShownEvent(nsIContent *aPopup, nsPresContext* aPresContext)
--- a/layout/xul/nsResizerFrame.h
+++ b/layout/xul/nsResizerFrame.h
@@ -5,17 +5,16 @@
 #ifndef nsResizerFrame_h___
 #define nsResizerFrame_h___
 
 #include "mozilla/Attributes.h"
 #include "mozilla/EventForwards.h"
 #include "nsTitleBarFrame.h"
 
 class nsIBaseWindow;
-class nsMenuPopupFrame;
 
 class nsResizerFrame : public nsTitleBarFrame 
 {
 protected:
   struct Direction {
     int8_t mHorizontal;
     int8_t mVertical;
   };
--- a/layout/xul/nsScrollbarButtonFrame.h
+++ b/layout/xul/nsScrollbarButtonFrame.h
@@ -13,18 +13,16 @@
 #ifndef nsScrollbarButtonFrame_h___
 #define nsScrollbarButtonFrame_h___
 
 #include "mozilla/Attributes.h"
 #include "nsButtonBoxFrame.h"
 #include "nsITimer.h"
 #include "nsRepeatService.h"
 
-class nsSliderFrame;
-
 class nsScrollbarButtonFrame : public nsButtonBoxFrame
 {
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   explicit nsScrollbarButtonFrame(nsStyleContext* aContext):
     nsButtonBoxFrame(aContext), mCursorOnThis(false) {}
 
--- a/layout/xul/nsSliderFrame.h
+++ b/layout/xul/nsSliderFrame.h
@@ -9,17 +9,16 @@
 #include "mozilla/Attributes.h"
 #include "nsRepeatService.h"
 #include "nsBoxFrame.h"
 #include "nsIAtom.h"
 #include "nsCOMPtr.h"
 #include "nsITimer.h"
 #include "nsIDOMEventListener.h"
 
-class nsString;
 class nsITimer;
 class nsSliderFrame;
 
 nsIFrame* NS_NewSliderFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 class nsSliderMediator final : public nsIDOMEventListener
 {
 public:
--- a/parser/html/nsHtml5TreeBuilderCppSupplement.h
+++ b/parser/html/nsHtml5TreeBuilderCppSupplement.h
@@ -5,18 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsError.h"
 #include "nsIPresShell.h"
 #include "nsNodeUtils.h"
 #include "nsIFrame.h"
 #include "mozilla/Likely.h"
 
-class nsPresContext;
-
 nsHtml5TreeBuilder::nsHtml5TreeBuilder(nsHtml5OplessBuilder* aBuilder)
   : scriptingEnabled(false)
   , fragment(false)
   , contextName(nullptr)
   , contextNamespace(kNameSpaceID_None)
   , contextNode(nullptr)
   , formPointer(nullptr)
   , headPointer(nullptr)
--- a/parser/html/nsHtml5TreeOpExecutor.h
+++ b/parser/html/nsHtml5TreeOpExecutor.h
@@ -20,18 +20,16 @@
 #include "nsIURI.h"
 #include "nsTHashtable.h"
 #include "nsHashKeys.h"
 #include "mozilla/LinkedList.h"
 #include "nsHtml5DocumentBuilder.h"
 #include "mozilla/net/ReferrerPolicy.h"
 
 class nsHtml5Parser;
-class nsHtml5TreeBuilder;
-class nsHtml5Tokenizer;
 class nsHtml5StreamParser;
 class nsIContent;
 class nsIDocument;
 
 class nsHtml5TreeOpExecutor final : public nsHtml5DocumentBuilder,
                                     public nsIContentSink,
                                     public nsAHtml5TreeOpSink,
                                     public mozilla::LinkedListElement<nsHtml5TreeOpExecutor>
--- a/parser/html/nsHtml5TreeOperation.h
+++ b/parser/html/nsHtml5TreeOperation.h
@@ -7,17 +7,16 @@
 
 #include "nsHtml5DocumentMode.h"
 #include "nsHtml5HtmlAttributes.h"
 #include "nsXPCOMStrings.h"
 #include "mozilla/dom/FromParser.h"
 
 class nsIContent;
 class nsHtml5TreeOpExecutor;
-class nsHtml5StateSnapshot;
 class nsHtml5DocumentBuilder;
 
 enum eHtml5TreeOperation {
   eTreeOpUninitialized,
   // main HTML5 ops
   eTreeOpAppend,
   eTreeOpDetach,
   eTreeOpAppendChildrenToNewParent,
--- a/parser/htmlparser/CNavDTD.h
+++ b/parser/htmlparser/CNavDTD.h
@@ -6,19 +6,16 @@
 
 #ifndef NS_NAVHTMLDTD__
 #define NS_NAVHTMLDTD__
 
 #include "nsIDTD.h"
 #include "nsISupports.h"
 #include "nsCOMPtr.h"
 
-// This class is no longer useful.
-class nsIHTMLContentSink;
-
 #ifdef _MSC_VER
 #pragma warning( disable : 4275 )
 #endif
 
 class CNavDTD : public nsIDTD
 {
 #ifdef _MSC_VER
 #pragma warning( default : 4275 )
--- a/parser/htmlparser/nsIDTD.h
+++ b/parser/htmlparser/nsIDTD.h
@@ -41,18 +41,16 @@ enum nsDTDMode {
     eDTDMode_quirks,        //pre 4.0 versions
     eDTDMode_almost_standards,
     eDTDMode_full_standards,
     eDTDMode_autodetect,
     eDTDMode_fragment
 };
 
 
-class nsIParser;
-class nsIURI;
 class nsIContentSink;
 class CParserContext;
 
 class nsIDTD : public nsISupports
 {
 public:
 
     NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDTD_IID)
--- a/parser/htmlparser/nsParser.h
+++ b/parser/htmlparser/nsParser.h
@@ -49,17 +49,16 @@
 #include "nsITokenizer.h"
 #include "nsHTMLTags.h"
 #include "nsIContentSink.h"
 #include "nsCOMArray.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsWeakReference.h"
 
 class nsIDTD;
-class nsScanner;
 class nsIRunnable;
 
 #ifdef _MSC_VER
 #pragma warning( disable : 4275 )
 #endif
 
 
 class nsParser final : public nsIParser,
--- a/parser/htmlparser/nsScanner.h
+++ b/parser/htmlparser/nsScanner.h
@@ -20,18 +20,16 @@
 #define SCANNER
 
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsIParser.h"
 #include "nsIUnicodeDecoder.h"
 #include "nsScannerString.h"
 
-class nsParser;
-
 class nsReadEndCondition {
 public:
   const char16_t *mChars;
   char16_t mFilter;
   explicit nsReadEndCondition(const char16_t* aTerminateChars);
 private:
   nsReadEndCondition(const nsReadEndCondition& aOther); // No copying
   void operator=(const nsReadEndCondition& aOther); // No assigning
--- a/rdf/base/nsRDFXMLSerializer.h
+++ b/rdf/base/nsRDFXMLSerializer.h
@@ -11,17 +11,16 @@
 #include "nsIRDFXMLSerializer.h"
 #include "nsIRDFXMLSource.h"
 #include "nsNameSpaceMap.h"
 #include "nsXPIDLString.h"
 
 #include "nsDataHashtable.h"
 #include "rdfITripleVisitor.h"
 
-class nsString;
 class nsIOutputStream;
 class nsIRDFContainerUtils;
 
 /**
  * A helper class that can serialize RDF/XML from a
  * datasource. Implements both nsIRDFXMLSerializer and
  * nsIRDFXMLSource.
  */
--- a/rdf/base/rdfutil.h
+++ b/rdf/base/rdfutil.h
@@ -20,18 +20,16 @@
  */
 
 #ifndef rdfutil_h__
 #define rdfutil_h__
 
 
 class nsACString;
 class nsCString;
-class nsString;
-class nsIURI;
 
 nsresult
 rdf_MakeRelativeRef(const nsCSubstring& aBaseURI, nsCString& aURI);
 
 void
 rdf_FormatDate(PRTime aTime, nsACString &aResult);
 
 PRTime
--- a/testing/gtest/gtest/include/gtest/gtest.h
+++ b/testing/gtest/gtest/include/gtest/gtest.h
@@ -146,17 +146,16 @@ GTEST_DECLARE_string_(stream_result_to);
 const int kMaxStackTraceDepth = 100;
 
 namespace internal {
 
 class AssertHelper;
 class DefaultGlobalTestPartResultReporter;
 class ExecDeathTest;
 class NoExecDeathTest;
-class FinalSuccessChecker;
 class GTestFlagSaver;
 class TestResultAccessor;
 class TestEventListenersAccessor;
 class TestEventRepeater;
 class WindowsDeathTest;
 class UnitTestImpl* GetUnitTestImpl();
 void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
                                     const String& message);
--- a/tools/profiler/GeckoProfilerImpl.h
+++ b/tools/profiler/GeckoProfilerImpl.h
@@ -32,17 +32,16 @@
 #endif
 
 // Make sure that we can use std::min here without the Windows headers messing with us.
 #ifdef min
 #undef min
 #endif
 
 class TableTicker;
-class JSCustomObject;
 
 namespace mozilla {
 class TimeStamp;
 }
 
 extern mozilla::ThreadLocal<PseudoStack *> tlsPseudoStack;
 extern mozilla::ThreadLocal<TableTicker *> tlsTicker;
 extern mozilla::ThreadLocal<void *> tlsStackTop;
--- a/tools/profiler/PseudoStack.h
+++ b/tools/profiler/PseudoStack.h
@@ -70,18 +70,16 @@ static inline uint32_t sMin(uint32_t l, 
 class StackEntry : public js::ProfileEntry
 {
 };
 
 class ProfilerMarkerPayload;
 template<typename T>
 class ProfilerLinkedList;
 class JSStreamWriter;
-class JSCustomArray;
-class ThreadProfile;
 class ProfilerMarker {
   friend class ProfilerLinkedList<ProfilerMarker>;
 public:
   explicit ProfilerMarker(const char* aMarkerName,
          ProfilerMarkerPayload* aPayload = nullptr,
          float aTime = 0);
 
   ~ProfilerMarker();
--- a/tools/profiler/TableTicker.h
+++ b/tools/profiler/TableTicker.h
@@ -40,18 +40,16 @@ threadSelected(ThreadInfo* aInfo, const 
 
   return false;
 }
 
 extern mozilla::TimeStamp sLastTracerEvent;
 extern int sFrameNumber;
 extern int sLastFrameNumber;
 
-class BreakpadSampler;
-
 class TableTicker: public Sampler {
  public:
   TableTicker(double aInterval, int aEntrySize,
               const char** aFeatures, uint32_t aFeatureCount,
               const char** aThreadNameFilters, uint32_t aFilterCount)
     : Sampler(aInterval, true, aEntrySize)
     , mPrimaryThreadProfile(nullptr)
     , mBuffer(new ProfileBuffer(aEntrySize))