Bug 919325 - Minimize the #includes in content/ IDL files; r=bzbarsky
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 22 Sep 2013 19:23:30 -0400
changeset 148220 aee35ffedb611db15dd4c24d1791b1054629b146
parent 148219 d72b3d939bbc88b7f1101d6897740302d8c95d71
child 148221 3a21097df258672510a448368e226bb37ed23d1b
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbzbarsky
bugs919325
milestone27.0a1
Bug 919325 - Minimize the #includes in content/ IDL files; r=bzbarsky
content/base/public/nsIContentPolicy.idl
content/base/public/nsIDOMDataChannel.idl
content/base/public/nsIDOMFile.idl
content/base/public/nsIDOMFileList.idl
content/base/public/nsISelectionController.idl
content/base/public/nsISelectionPrivate.idl
content/events/public/nsIEventListenerService.idl
content/html/content/src/HTMLInputElement.cpp
content/html/content/src/HTMLTextAreaElement.cpp
content/html/content/src/nsTextEditorState.cpp
content/media/webvtt/nsIWebVTTParserWrapper.idl
content/xslt/public/nsIXSLTException.idl
content/xslt/public/nsIXSLTProcessor.idl
content/xslt/public/txIEXSLTRegExFunctions.idl
content/xslt/public/txIFunctionEvaluationContext.idl
content/xslt/public/txIXPathObject.idl
content/xul/content/src/nsXULElement.cpp
content/xul/document/public/nsIControllers.idl
content/xul/document/src/nsXULControllers.cpp
content/xul/templates/public/nsIXULTemplateBuilder.idl
content/xul/templates/public/nsIXULTemplateQueryProcessor.idl
dom/base/nsGlobalWindow.cpp
dom/base/nsWindowRoot.cpp
--- a/content/base/public/nsIContentPolicy.idl
+++ b/content/base/public/nsIContentPolicy.idl
@@ -1,19 +1,19 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ft=cpp tw=78 sw=2 et ts=8 : */
 /* 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/. */
 
 #include "nsISupports.idl"
-#include "nsIPrincipal.idl"
 
 interface nsIURI;
 interface nsIDOMNode;
+interface nsIPrincipal;
 
 /**
  * The type of nsIContentPolicy::TYPE_*
  */
 typedef unsigned long nsContentPolicyType;
 
 /**
  * Interface for content policy mechanism.  Implementations of this
--- a/content/base/public/nsIDOMDataChannel.idl
+++ b/content/base/public/nsIDOMDataChannel.idl
@@ -1,14 +1,12 @@
 /* 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/. */
 
-#include "domstubs.idl"
-
 #include "nsIDOMEventTarget.idl"
 
 %{C++
 #ifdef GetBinaryType
 // Windows apparently has a #define for GetBinaryType...
 #undef GetBinaryType
 #endif
 %}
--- a/content/base/public/nsIDOMFile.idl
+++ b/content/base/public/nsIDOMFile.idl
@@ -1,14 +1,14 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
-#include "domstubs.idl"
+#include "nsISupports.idl"
 
 %{C++
 namespace mozilla {
 namespace dom {
 namespace indexedDB {
 class FileInfo;
 class FileManager;
 }
--- a/content/base/public/nsIDOMFileList.idl
+++ b/content/base/public/nsIDOMFileList.idl
@@ -1,14 +1,14 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
-#include "domstubs.idl"
+#include "nsISupports.idl"
 
 interface nsIDOMFile;
 
 [scriptable, uuid(283aa7b2-da81-4c72-aea2-9797b440fe34)]
 interface nsIDOMFileList : nsISupports
 {
   readonly attribute unsigned long length;
   nsIDOMFile item(in unsigned long index);
--- a/content/base/public/nsISelectionController.idl
+++ b/content/base/public/nsISelectionController.idl
@@ -1,16 +1,14 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
 
-#include "nsISupports.idl"
-#include "nsISelection.idl"
 #include "nsISelectionDisplay.idl"
 
 %{C++
 typedef short SelectionType;
 typedef short SelectionRegion;
 %}
 
 interface nsIContent;
--- a/content/base/public/nsISelectionPrivate.idl
+++ b/content/base/public/nsISelectionPrivate.idl
@@ -1,30 +1,28 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
-#include "nsISupports.idl"
-#include "nsISelectionListener.idl"
 #include "nsISelection.idl"
 
 interface nsRange;
 interface nsIDOMNode;
 interface nsISelectionListener;
 interface nsIContent;
 interface nsINode;
 
 %{C++
 class nsIFrame;
 struct nsTextRangeStyle;
 struct nsPoint;
 struct ScrollAxis;
+template<class T> class nsTArray;
 #include "nsDirection.h"
-#include "nsTArray.h"
 #include "nsIPresShell.h" // TODO: Remove this include
 %}
 
 [ptr] native nsIFrame(nsIFrame);
 [ptr] native RangeArray(nsTArray<nsRange*>);
 [ref] native constTextRangeStyleRef(const nsTextRangeStyle);
 [ref] native nsPointRef(nsPoint);
 native nsDirection(nsDirection);
--- a/content/events/public/nsIEventListenerService.idl
+++ b/content/events/public/nsIEventListenerService.idl
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
-#include "nsIDOMEventListener.idl"
+#include "nsISupports.idl"
 
+interface nsIDOMEventListener;
 interface nsIDOMEventTarget;
 
 /**
  * An instance of this interface describes how an event listener
  * was added to an event target.
  */
 [scriptable, uuid(c4776eb7-05bc-49ce-a0ca-6213a346d53a)]
 interface nsIEventListenerInfo : nsISupports
--- a/content/html/content/src/HTMLInputElement.cpp
+++ b/content/html/content/src/HTMLInputElement.cpp
@@ -96,16 +96,17 @@
 
 #include "nsIIDNService.h"
 
 #include <limits>
 
 #include "nsIColorPicker.h"
 #include "nsIStringEnumerator.h"
 #include "HTMLSplitOnSpacesTokenizer.h"
+#include "nsIController.h"
 
 // input type=date
 #include "js/Date.h"
 
 NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Input)
 
 // XXX align=left, hspace, vspace, border? other nav4 attrs
 
--- a/content/html/content/src/HTMLTextAreaElement.cpp
+++ b/content/html/content/src/HTMLTextAreaElement.cpp
@@ -33,16 +33,17 @@
 #include "nsLinebreakConverter.h"
 #include "nsMappedAttributes.h"
 #include "nsPIDOMWindow.h"
 #include "nsPresContext.h"
 #include "nsPresState.h"
 #include "nsReadableUtils.h"
 #include "nsStyleConsts.h"
 #include "nsTextEditorState.h"
+#include "nsIController.h"
 
 static NS_DEFINE_CID(kXULControllersCID,  NS_XULCONTROLLERS_CID);
 
 #define NS_NO_CONTENT_DISPATCH (1 << 0)
 
 NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(TextArea)
 
 namespace mozilla {
--- a/content/html/content/src/nsTextEditorState.cpp
+++ b/content/html/content/src/nsTextEditorState.cpp
@@ -36,16 +36,17 @@
 #include "nsIEditor.h"
 #include "nsTextEditRules.h"
 #include "mozilla/Selection.h"
 #include "nsEventListenerManager.h"
 #include "nsContentUtils.h"
 #include "nsCxPusher.h"
 #include "mozilla/Preferences.h"
 #include "nsTextNode.h"
+#include "nsIController.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 static NS_DEFINE_CID(kTextEditorCID, NS_TEXTEDITOR_CID);
 
 static nsINativeKeyBindings *sNativeInputBindings = nullptr;
 static nsINativeKeyBindings *sNativeTextAreaBindings = nullptr;
--- a/content/media/webvtt/nsIWebVTTParserWrapper.idl
+++ b/content/media/webvtt/nsIWebVTTParserWrapper.idl
@@ -1,15 +1,17 @@
 /* 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/. */
 
 #include "nsISupports.idl"
-#include "nsIWebVTTListener.idl"
-#include "nsIDOMHTMLElement.idl"
+
+interface nsIDOMHTMLElement;
+interface nsIWebVTTListener;
+interface nsIDOMWindow;
 
 /**
  * Interface for a wrapper of a JS WebVTT parser (vtt.js).
  */
 [scriptable, uuid(1604a67f-3b72-4027-bcba-6dddd5be6b10)]
 interface nsIWebVTTParserWrapper : nsISupports
 {
   /**
--- a/content/xslt/public/nsIXSLTException.idl
+++ b/content/xslt/public/nsIXSLTException.idl
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
 #include "nsIException.idl"
-#include "domstubs.idl"
+
+interface nsIDOMNode;
 
 [scriptable, uuid(e06dfaea-92d5-47f7-a800-c5f5404d8771)]
 interface nsIXSLTException : nsIException {
     /**
      * The node in the stylesheet that triggered the exception.
      */
     readonly attribute nsIDOMNode styleNode;
 
--- a/content/xslt/public/nsIXSLTProcessor.idl
+++ b/content/xslt/public/nsIXSLTProcessor.idl
@@ -1,14 +1,13 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
-#include "nsISupports.idl"
 #include "domstubs.idl"
 
 interface nsIVariant;
 
 [scriptable, uuid(4a91aeb3-4100-43ee-a21e-9866268757c5)]
 interface nsIXSLTProcessor : nsISupports
 {
     /**
--- a/content/xslt/public/txIEXSLTRegExFunctions.idl
+++ b/content/xslt/public/txIEXSLTRegExFunctions.idl
@@ -1,15 +1,17 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
-#include "txIFunctionEvaluationContext.idl"
-#include "txINodeSet.idl"
+#include "nsISupports.idl"
+
+interface txIFunctionEvaluationContext;
+interface txINodeSet;
 
 [scriptable, uuid(c180e993-aced-4839-95a0-ecd5ff138be9)]
 interface txIEXSLTRegExFunctions : nsISupports
 {
     txINodeSet match(in txIFunctionEvaluationContext aContext,
                      in DOMString aString, in DOMString aRegEx,
                      in DOMString aFlags);
     DOMString replace(in DOMString aString, in DOMString aRegEx,
--- a/content/xslt/public/txIFunctionEvaluationContext.idl
+++ b/content/xslt/public/txIFunctionEvaluationContext.idl
@@ -1,15 +1,16 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
-#include "domstubs.idl"
+#include "nsISupports.idl"
 
+interface nsIDOMNode;
 interface txINodeSet;
 
 [scriptable, uuid(0ecbb00c-6a78-11d9-9791-000a95dc234c)]
 interface txIFunctionEvaluationContext : nsISupports
 {
     readonly attribute uint32_t position;
     readonly attribute uint32_t size;
     readonly attribute nsIDOMNode contextNode;
--- a/content/xslt/public/txIXPathObject.idl
+++ b/content/xslt/public/txIXPathObject.idl
@@ -1,14 +1,14 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
-#include "domstubs.idl"
+#include "nsISupports.idl"
 
 %{ C++
 class txAExprResult;
 %}
 
 [ptr] native txAExprResultPtr(txAExprResult);
 
 [scriptable, uuid(67706346-dece-4c9b-9fc2-57cf19071014)]
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -84,16 +84,17 @@
 #include "nsNodeUtils.h"
 #include "nsFrameLoader.h"
 #include "prlog.h"
 #include "rdf.h"
 #include "nsIControllers.h"
 #include "nsAttrValueOrString.h"
 #include "nsAttrValueInlines.h"
 #include "mozilla/Attributes.h"
+#include "nsIController.h"
 #include <algorithm>
 
 // The XUL doc interface
 #include "nsIDOMXULDocument.h"
 
 #include "nsReadableUtils.h"
 #include "nsIFrame.h"
 #include "nsNodeInfoManager.h"
--- a/content/xul/document/public/nsIControllers.idl
+++ b/content/xul/document/public/nsIControllers.idl
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
-#include "nsIController.idl"
+#include "nsISupports.idl"
 
+interface nsIController;
 interface nsIDOMXULCommandDispatcher;
 
 [scriptable, uuid(f36e3ec1-9197-4ad8-8d4c-d3b1927fd6df)]
 interface nsIControllers : nsISupports
 {
 	nsIController getControllerForCommand(in string command);
 
 	void insertControllerAt(in unsigned long index, in nsIController controller);
--- a/content/xul/document/src/nsXULControllers.cpp
+++ b/content/xul/document/src/nsXULControllers.cpp
@@ -11,16 +11,17 @@
 */
 
 #include "nsString.h"
 
 #include "nsIControllers.h"
 #include "nsIDOMElement.h"
 #include "nsXULControllers.h"
 #include "nsDOMClassInfoID.h"
+#include "nsIController.h"
 
 //----------------------------------------------------------------------
 
 nsXULControllers::nsXULControllers()
 : mCurControllerID(0)
 {
 }
 
--- a/content/xul/templates/public/nsIXULTemplateBuilder.idl
+++ b/content/xul/templates/public/nsIXULTemplateBuilder.idl
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
 #include "domstubs.idl"
-#include "nsISupports.idl"
 
 interface nsIAtom;
 interface nsIContent;
 interface nsIXULBuilderListener;
 interface nsIXULTemplateResult;
 interface nsIXULTemplateRuleFilter;
 interface nsIXULTemplateQueryProcessor;
 interface nsIRDFResource;
--- a/content/xul/templates/public/nsIXULTemplateQueryProcessor.idl
+++ b/content/xul/templates/public/nsIXULTemplateQueryProcessor.idl
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
 #include "domstubs.idl"
-#include "nsISupports.idl"
 
 interface nsIAtom;
 interface nsIArray;
 interface nsISimpleEnumerator;
 interface nsIXULTemplateResult;
 interface nsIXULTemplateRuleFilter;
 interface nsIXULTemplateBuilder;
 
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -29,16 +29,17 @@
 #include "nsArrayUtils.h"
 #include "nsIDOMWindowCollection.h"
 #include "nsDOMWindowList.h"
 #include "nsIDOMWakeLock.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIPermissionManager.h"
 #include "nsIScriptContext.h"
 #include "nsIScriptTimeoutHandler.h"
+#include "nsIController.h"
 
 #ifdef XP_WIN
 // Thanks so much, Microsoft! :(
 #ifdef GetClassName
 #undef GetClassName
 #endif // GetClassName
 #ifdef CreateEvent
 #undef CreateEvent
--- a/dom/base/nsWindowRoot.cpp
+++ b/dom/base/nsWindowRoot.cpp
@@ -14,16 +14,17 @@
 #include "nsEventDispatcher.h"
 #include "nsGUIEvent.h"
 #include "nsGlobalWindow.h"
 #include "nsFocusManager.h"
 #include "nsIContent.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLTextAreaElement.h"
 #include "nsIControllers.h"
+#include "nsIController.h"
 
 #include "nsCycleCollectionParticipant.h"
 
 #ifdef MOZ_XUL
 #include "nsIDOMXULElement.h"
 #endif
 
 using namespace mozilla;