Bug 1053190 - Reduce unnecessary inclusion of nsINode.h in headers; r=ehsan
authorAryeh Gregor <ayg@aryeh.name>
Mon, 18 Aug 2014 17:44:50 +0300
changeset 221777 6030bd4e48f85f0cef6a59051a2ee18c3779580d
parent 221776 d4f36554d461217e30b9c77b5be4f91e3c23a910
child 221778 85b3a50cd5517261be03306c4141c7d943425e09
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1053190
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1053190 - Reduce unnecessary inclusion of nsINode.h in headers; r=ehsan
accessible/base/nsCoreUtils.h
content/base/public/nsCopySupport.h
content/base/public/nsINodeList.h
content/base/src/Attr.h
content/base/src/ChildIterator.h
content/base/src/Link.h
content/base/src/nsContentList.h
content/base/src/nsElementFrameLoaderOwner.cpp
content/base/src/nsGenericDOMDataNode.h
content/base/src/nsTraversal.h
content/base/src/nsXMLHttpRequest.h
content/html/content/src/HTMLTrackElement.h
content/svg/content/src/SVGIFrameElement.h
content/svg/content/src/SVGIRect.h
dom/events/AsyncEventDispatcher.h
dom/nfc/MozNDEFRecord.h
dom/src/notification/DesktopNotification.h
gfx/layers/apz/util/APZCCallbackHelper.cpp
gfx/layers/apz/util/APZCCallbackHelper.h
gfx/layers/apz/util/ActiveElementManager.cpp
js/xpconnect/src/xpcprivate.h
layout/forms/nsColorControlFrame.cpp
layout/forms/nsTextControlFrame.h
layout/generic/nsIAnonymousContentCreator.h
layout/style/nsStyleStructInlines.h
layout/svg/SVGTextFrame.h
layout/xul/tree/nsTreeContentView.cpp
layout/xul/tree/nsTreeUtils.cpp
parser/html/nsHtml5TreeOpExecutor.h
widget/android/APZCCallbackHandler.cpp
--- a/accessible/base/nsCoreUtils.h
+++ b/accessible/base/nsCoreUtils.h
@@ -2,17 +2,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/. */
 
 #ifndef nsCoreUtils_h_
 #define nsCoreUtils_h_
 
 #include "nsIContent.h"
-#include "nsIDocument.h"
+#include "nsIDocument.h" // for GetShell()
 #include "nsIPresShell.h"
 
 #include "nsPoint.h"
 #include "nsTArray.h"
 
 class nsRange;
 class nsIBoxObject;
 class nsIFrame;
--- a/content/base/public/nsCopySupport.h
+++ b/content/base/public/nsCopySupport.h
@@ -2,18 +2,18 @@
 /* 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 nsCopySupport_h__
 #define nsCopySupport_h__
 
 #include "nscore.h"
-#include "nsINode.h"
 
+class nsINode;
 class nsISelection;
 class nsIDocument;
 class nsIImageLoadingContent;
 class nsIContent;
 class nsITransferable;
 class nsACString;
 class nsAString;
 class nsIPresShell;
--- a/content/base/public/nsINodeList.h
+++ b/content/base/public/nsINodeList.h
@@ -3,17 +3,19 @@
  * 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 nsINodeList_h___
 #define nsINodeList_h___
 
 #include "nsIDOMNodeList.h"
 #include "nsWrapperCache.h"
-#include "nsIContent.h"
+
+class nsIContent;
+class nsINode;
 
 // IID for the nsINodeList interface
 #define NS_INODELIST_IID \
 { 0xadb5e54c, 0x6e96, 0x4102, \
  { 0x8d, 0x40, 0xe0, 0x12, 0x3d, 0xcf, 0x48, 0x7a } }
 
 /**
  * An internal interface for a reasonably fast indexOf.
--- a/content/base/src/Attr.h
+++ b/content/base/src/Attr.h
@@ -14,17 +14,18 @@
 #include "nsIAttribute.h"
 #include "nsIDOMAttr.h"
 #include "nsIDOMText.h"
 #include "nsIDOMNodeList.h"
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsStubMutationObserver.h"
-#include "nsIDocument.h"
+
+class nsIDocument;
 
 namespace mozilla {
 class EventChainPreVisitor;
 namespace dom {
 
 // Attribute helper class used to wrap up an attribute with a dom
 // object that implements nsIDOMAttr and nsIDOMNode
 class Attr MOZ_FINAL : public nsIAttribute,
--- a/content/base/src/ChildIterator.h
+++ b/content/base/src/ChildIterator.h
@@ -13,17 +13,20 @@
  * Iterates over the children on a node. If a child is an insertion point,
  * iterates over the children inserted there instead, or the default content
  * if no children are inserted there.
  *
  * The FlattenedChildIterator expands any anonymous content bound from an XBL
  * binding's <xbl:content> element.
  */
 
-#include "nsIContent.h"
+#include <stdint.h>
+#include "nsAutoPtr.h"
+
+class nsIContent;
 
 namespace mozilla {
 namespace dom {
 
 // This class iterates normal DOM child nodes of a given DOM node with
 // <xbl:children> nodes replaced by the elements that have been filtered into that
 // insertion point. Any bindings on the given element are ignored for purposes
 // of determining which insertion point children are filtered into. The iterator
--- a/content/base/src/Link.h
+++ b/content/base/src/Link.h
@@ -9,17 +9,17 @@
  */
 
 #ifndef mozilla_dom_Link_h__
 #define mozilla_dom_Link_h__
 
 #include "mozilla/IHistory.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/dom/URLSearchParams.h"
-#include "nsIContent.h"
+#include "nsIContent.h" // for nsLinkState
 
 namespace mozilla {
 
 class EventStates;
 
 namespace dom {
 
 class Element;
--- a/content/base/src/nsContentList.h
+++ b/content/base/src/nsContentList.h
@@ -22,16 +22,17 @@
 #include "nsINodeList.h"
 #include "nsStubMutationObserver.h"
 #include "nsIAtom.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsNameSpaceManager.h"
 #include "nsWrapperCache.h"
 #include "nsHashKeys.h"
 #include "mozilla/HashFunctions.h"
+#include "mozilla/dom/NameSpaceConstants.h"
 
 namespace mozilla {
 namespace dom {
 class Element;
 }
 }
 
 
--- a/content/base/src/nsElementFrameLoaderOwner.cpp
+++ b/content/base/src/nsElementFrameLoaderOwner.cpp
@@ -12,16 +12,18 @@
 #include "nsContentUtils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/ErrorResult.h"
 #include "nsIAppsService.h"
 #include "nsServiceManagerUtils.h"
 #include "mozIApplication.h"
 #include "nsIPermissionManager.h"
 #include "GeckoProfiler.h"
+#include "nsIDocument.h"
+#include "nsPIDOMWindow.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsElementFrameLoaderOwner::~nsElementFrameLoaderOwner()
 {
   if (mFrameLoader) {
     mFrameLoader->Destroy();
--- a/content/base/src/nsGenericDOMDataNode.h
+++ b/content/base/src/nsGenericDOMDataNode.h
@@ -15,19 +15,19 @@
 #include "nsIContent.h"
 
 #include "nsTextFragment.h"
 #include "nsError.h"
 #include "mozilla/dom/Element.h"
 #include "nsCycleCollectionParticipant.h"
 
 #include "nsISMILAttr.h"
-#include "nsIDocument.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_))
--- a/content/base/src/nsTraversal.h
+++ b/content/base/src/nsTraversal.h
@@ -7,17 +7,17 @@
 /*
  * Implementation of DOM Traversal's nsIDOMTreeWalker
  */
 
 #ifndef nsTraversal_h___
 #define nsTraversal_h___
 
 #include "nsCOMPtr.h"
-#include "nsIDocument.h"
+#include "nsIDocument.h" // for NodeFilterHolder
 #include "mozilla/dom/CallbackObject.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/dom/NodeFilterBinding.h"
 #include "nsIDOMNodeFilter.h"
 
 class nsINode;
 
 class nsTraversal
--- a/content/base/src/nsXMLHttpRequest.h
+++ b/content/base/src/nsXMLHttpRequest.h
@@ -9,17 +9,16 @@
 
 #include "mozilla/Attributes.h"
 #include "nsIXMLHttpRequest.h"
 #include "nsISupportsUtils.h"
 #include "nsString.h"
 #include "nsIURI.h"
 #include "nsIHttpChannel.h"
 #include "nsIDocument.h"
-#include "nsIContent.h"
 #include "nsIStreamListener.h"
 #include "nsWeakReference.h"
 #include "nsIChannelEventSink.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIHttpHeaderVisitor.h"
 #include "nsIProgressEventSink.h"
 #include "nsJSUtils.h"
--- a/content/html/content/src/HTMLTrackElement.h
+++ b/content/html/content/src/HTMLTrackElement.h
@@ -7,22 +7,23 @@
 #define mozilla_dom_HTMLTrackElement_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/HTMLMediaElement.h"
 #include "mozilla/dom/TextTrack.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
-#include "nsIContent.h"
-#include "nsIDocument.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIHttpChannel.h"
 
+class nsIContent;
+class nsIDocument;
+
 namespace mozilla {
 namespace dom {
 
 class WebVTTListener;
 
 class HTMLTrackElement MOZ_FINAL : public nsGenericHTMLElement
 {
 public:
--- a/content/svg/content/src/SVGIFrameElement.h
+++ b/content/svg/content/src/SVGIFrameElement.h
@@ -5,31 +5,31 @@
 
 #include "mozilla/dom/DOMString.h"
 #include "mozilla/dom/FromParser.h"
 #include "mozilla/dom/SVGGraphicsElement.h"
 #include "nsContentUtils.h"
 #include "nsDOMSettableTokenList.h"
 #include "nsFrameLoader.h"
 #include "nsElementFrameLoaderOwner.h"
-#include "nsIDocument.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMEventListener.h"
 #include "nsIFrameLoader.h"
 #include "nsIWebNavigation.h"
 #include "nsSVGElement.h"
 #include "nsSVGLength2.h"
 #include "SVGAnimatedPreserveAspectRatio.h"
 
 nsresult NS_NewSVGIFrameElement(nsIContent **aResult,
                                 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
                                 mozilla::dom::FromParser aFromParser);
 
 typedef mozilla::dom::SVGGraphicsElement SVGIFrameElementBase;
 
+class nsIDocument;
 class nsSVGIFrameFrame;
 
 namespace mozilla {
 namespace dom {
 class DOMSVGAnimatedPreserveAspectRatio;
 
 class SVGIFrameElement MOZ_FINAL : public SVGIFrameElementBase,
                                    public nsElementFrameLoaderOwner
--- a/content/svg/content/src/SVGIRect.h
+++ b/content/svg/content/src/SVGIRect.h
@@ -6,18 +6,18 @@
 #ifndef mozilla_dom_SVGIRect_h
 #define mozilla_dom_SVGIRect_h
 
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/dom/SVGRectBinding.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/ErrorResult.h"
 #include "nsWrapperCache.h"
-#include "nsIContent.h"
 
+class nsIContent;
 class nsSVGElement;
 
 namespace mozilla {
 namespace dom {
 
 class SVGIRect : public nsISupports,
                  public nsWrapperCache
 {
--- a/dom/events/AsyncEventDispatcher.h
+++ b/dom/events/AsyncEventDispatcher.h
@@ -5,20 +5,21 @@
 
 #ifndef mozilla_AsyncEventDispatcher_h_
 #define mozilla_AsyncEventDispatcher_h_
 
 #include "mozilla/Attributes.h"
 #include "nsCOMPtr.h"
 #include "nsIDocument.h"
 #include "nsIDOMEvent.h"
-#include "nsINode.h"
 #include "nsString.h"
 #include "nsThreadUtils.h"
 
+class nsINode;
+
 namespace mozilla {
 
 /**
  * Use nsAsyncDOMEvent to fire a DOM event that requires safe a stable DOM.
  * For example, you may need to fire an event from within layout, but
  * want to ensure that the event handler doesn't mutate the DOM at
  * the wrong time, in order to avoid resulting instability.
  */
--- a/dom/nfc/MozNDEFRecord.h
+++ b/dom/nfc/MozNDEFRecord.h
@@ -10,21 +10,20 @@
 #define mozilla_dom_MozNDEFRecord_h__
 
 #include "mozilla/Attributes.h"
 #include "mozilla/ErrorResult.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsWrapperCache.h"
 #include "jsapi.h"
 
-#include "nsIDocument.h"
-
 #include "mozilla/dom/TypedArray.h"
 #include "jsfriendapi.h"
 #include "js/GCAPI.h"
+#include "nsPIDOMWindow.h"
 
 struct JSContext;
 
 namespace mozilla {
 namespace dom {
 
 class MozNDEFRecord MOZ_FINAL : public nsISupports,
                                 public nsWrapperCache
--- a/dom/src/notification/DesktopNotification.h
+++ b/dom/src/notification/DesktopNotification.h
@@ -12,17 +12,16 @@
 #include "nsIObserver.h"
 #include "nsString.h"
 #include "nsWeakPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIDOMWindow.h"
 #include "nsIScriptObjectPrincipal.h"
 
 #include "nsIDOMEvent.h"
-#include "nsIDocument.h"
 
 #include "mozilla/Attributes.h"
 #include "mozilla/DOMEventTargetHelper.h"
 #include "mozilla/ErrorResult.h"
 #include "nsWrapperCache.h"
 
 
 namespace mozilla {
--- a/gfx/layers/apz/util/APZCCallbackHelper.cpp
+++ b/gfx/layers/apz/util/APZCCallbackHelper.cpp
@@ -5,16 +5,19 @@
 
 #include "APZCCallbackHelper.h"
 #include "gfxPrefs.h" // For gfxPrefs::LayersTilesEnabled, LayersTileWidth/Height
 #include "mozilla/Preferences.h"
 #include "nsIScrollableFrame.h"
 #include "nsLayoutUtils.h"
 #include "nsIDOMElement.h"
 #include "nsIInterfaceRequestorUtils.h"
+#include "nsIContent.h"
+#include "nsIDocument.h"
+#include "nsIDOMWindow.h"
 
 namespace mozilla {
 namespace layers {
 
 bool
 APZCCallbackHelper::HasValidPresShellId(nsIDOMWindowUtils* aUtils,
                                         const FrameMetrics& aMetrics)
 {
--- a/gfx/layers/apz/util/APZCCallbackHelper.h
+++ b/gfx/layers/apz/util/APZCCallbackHelper.h
@@ -2,20 +2,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_layers_APZCCallbackHelper_h
 #define mozilla_layers_APZCCallbackHelper_h
 
 #include "FrameMetrics.h"
-#include "nsIContent.h"
-#include "nsIDocument.h"
 #include "nsIDOMWindowUtils.h"
 
+class nsIContent;
+class nsIDocument;
+template<class T> struct already_AddRefed;
+
 namespace mozilla {
 namespace layers {
 
 /* This class contains some helper methods that facilitate implementing the
    GeckoContentController callback interface required by the AsyncPanZoomController.
    Since different platforms need to implement this interface in similar-but-
    not-quite-the-same ways, this utility class provides some helpful methods
    to hold code that can be shared across the different platform implementations.
--- a/gfx/layers/apz/util/ActiveElementManager.cpp
+++ b/gfx/layers/apz/util/ActiveElementManager.cpp
@@ -6,16 +6,17 @@
 #include "ActiveElementManager.h"
 #include "mozilla/EventStates.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "inIDOMUtils.h"
 #include "base/message_loop.h"
 #include "base/task.h"
 #include "mozilla/dom/Element.h"
+#include "nsIDocument.h"
 
 #define AEM_LOG(...)
 // #define AEM_LOG(...) printf_stderr("AEM: " __VA_ARGS__)
 
 namespace mozilla {
 namespace layers {
 
 static int32_t sActivationDelayMs = 100;
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -166,18 +166,16 @@
 #ifdef GetClassInfo
 #undef GetClassInfo
 #endif
 #ifdef GetClassName
 #undef GetClassName
 #endif
 #endif /* XP_WIN */
 
-#include "nsINode.h"
-
 /***************************************************************************/
 // default initial sizes for maps (hashtables)
 
 #define XPC_CONTEXT_MAP_LENGTH                   8
 #define XPC_JS_MAP_LENGTH                       32
 #define XPC_JS_CLASS_MAP_LENGTH                 32
 
 #define XPC_NATIVE_MAP_LENGTH                    8
--- a/layout/forms/nsColorControlFrame.cpp
+++ b/layout/forms/nsColorControlFrame.cpp
@@ -9,16 +9,17 @@
 #include "nsContentList.h"
 #include "nsContentUtils.h"
 #include "nsFormControlFrame.h"
 #include "nsGkAtoms.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMNode.h"
 #include "nsIFormControl.h"
 #include "nsStyleSet.h"
+#include "nsIDocument.h"
 
 using mozilla::dom::Element;
 
 nsColorControlFrame::nsColorControlFrame(nsStyleContext* aContext):
   nsColorControlFrameSuper(aContext)
 {
 }
 
--- a/layout/forms/nsTextControlFrame.h
+++ b/layout/forms/nsTextControlFrame.h
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsTextControlFrame_h___
 #define nsTextControlFrame_h___
 
 #include "mozilla/Attributes.h"
 #include "nsContainerFrame.h"
 #include "nsIAnonymousContentCreator.h"
+#include "nsIContent.h"
 #include "nsITextControlFrame.h"
 #include "nsITextControlElement.h"
 #include "nsIStatefulFrame.h"
 
 class nsISelectionController;
 class EditorInitializerEntryTracker;
 class nsTextEditorState;
 class nsIEditor;
--- a/layout/generic/nsIAnonymousContentCreator.h
+++ b/layout/generic/nsIAnonymousContentCreator.h
@@ -7,21 +7,21 @@
  * interface for rendering objects that manually create subtrees of
  * anonymous content
  */
 
 #ifndef nsIAnonymousContentCreator_h___
 #define nsIAnonymousContentCreator_h___
 
 #include "nsQueryFrame.h"
-#include "nsIContent.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/style/nsStyleStructInlines.h
+++ b/layout/style/nsStyleStructInlines.h
@@ -8,17 +8,17 @@
  * require more headers.
  */
 
 #ifndef nsStyleStructInlines_h_
 #define nsStyleStructInlines_h_
 
 #include "nsIFrame.h"
 #include "nsStyleStruct.h"
-#include "nsIContent.h"
+#include "nsIContent.h" // for GetParent()
 
 inline void
 nsStyleImage::SetSubImage(uint8_t aIndex, imgIContainer* aSubImage) const
 {
   const_cast<nsStyleImage*>(this)->mSubImages.ReplaceObjectAt(aSubImage, aIndex);
 }
 
 inline imgIContainer*
--- a/layout/svg/SVGTextFrame.h
+++ b/layout/svg/SVGTextFrame.h
@@ -7,17 +7,17 @@
 #define MOZILLA_SVGTEXTFRAME_H
 
 #include "mozilla/Attributes.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/gfx/2D.h"
 #include "gfxMatrix.h"
 #include "gfxRect.h"
 #include "gfxSVGGlyphs.h"
-#include "nsIContent.h"
+#include "nsIContent.h" // for GetContent
 #include "nsStubMutationObserver.h"
 #include "nsSVGPaintServerFrame.h"
 
 class nsDisplaySVGText;
 class nsRenderingContext;
 class SVGTextFrame;
 class nsTextFrame;
 
--- a/layout/xul/tree/nsTreeContentView.cpp
+++ b/layout/xul/tree/nsTreeContentView.cpp
@@ -11,16 +11,17 @@
 #include "ChildIterator.h"
 #include "nsDOMClassInfoID.h"
 #include "nsError.h"
 #include "nsIXULSortService.h"
 #include "nsContentUtils.h"
 #include "nsTreeBodyFrame.h"
 #include "mozilla/dom/Element.h"
 #include "nsServiceManagerUtils.h"
+#include "nsIDocument.h"
 
 using namespace mozilla;
 
 #define NS_ENSURE_NATIVE_COLUMN(_col)                                \
   nsRefPtr<nsTreeColumn> col = nsTreeBodyFrame::GetColumnImpl(_col); \
   if (!col) {                                                        \
     return NS_ERROR_INVALID_ARG;                                     \
   }
--- a/layout/xul/tree/nsTreeUtils.cpp
+++ b/layout/xul/tree/nsTreeUtils.cpp
@@ -5,16 +5,17 @@
 
 #include "nsReadableUtils.h"
 #include "nsTreeUtils.h"
 #include "ChildIterator.h"
 #include "nsCRT.h"
 #include "nsIAtom.h"
 #include "nsNameSpaceManager.h"
 #include "nsGkAtoms.h"
+#include "nsIContent.h"
 
 using namespace mozilla;
 
 nsresult
 nsTreeUtils::TokenizeProperties(const nsAString& aProperties, AtomArray & aPropertiesArray)
 {
   nsAString::const_iterator end;
   aProperties.EndReading(end);
--- a/parser/html/nsHtml5TreeOpExecutor.h
+++ b/parser/html/nsHtml5TreeOpExecutor.h
@@ -1,18 +1,16 @@
 /* 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 nsHtml5TreeOpExecutor_h
 #define nsHtml5TreeOpExecutor_h
 
 #include "nsIAtom.h"
-#include "nsIContent.h"
-#include "nsIDocument.h"
 #include "nsTraceRefcnt.h"
 #include "nsHtml5TreeOperation.h"
 #include "nsHtml5SpeculativeLoad.h"
 #include "nsTArray.h"
 #include "nsContentSink.h"
 #include "nsNodeInfoManager.h"
 #include "nsHtml5DocumentMode.h"
 #include "nsIScriptElement.h"
@@ -24,16 +22,18 @@
 #include "nsHashKeys.h"
 #include "mozilla/LinkedList.h"
 #include "nsHtml5DocumentBuilder.h"
 
 class nsHtml5Parser;
 class nsHtml5TreeBuilder;
 class nsHtml5Tokenizer;
 class nsHtml5StreamParser;
+class nsIContent;
+class nsIDocument;
 
 class nsHtml5TreeOpExecutor : public nsHtml5DocumentBuilder,
                               public nsIContentSink,
                               public nsAHtml5TreeOpSink,
                               public mozilla::LinkedListElement<nsHtml5TreeOpExecutor>
 {
   friend class nsHtml5FlushLoopGuard;
 
--- a/widget/android/APZCCallbackHandler.cpp
+++ b/widget/android/APZCCallbackHandler.cpp
@@ -9,16 +9,17 @@
 #include "nsAppShell.h"
 #include "nsLayoutUtils.h"
 #include "nsPrintfCString.h"
 #include "nsThreadUtils.h"
 #include "base/message_loop.h"
 #include "nsWindow.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "AndroidBridge.h"
+#include "nsIContent.h"
 
 using mozilla::layers::APZCCallbackHelper;
 using mozilla::layers::APZCTreeManager;
 using mozilla::layers::FrameMetrics;
 using mozilla::layers::ScrollableLayerGuid;
 
 namespace mozilla {
 namespace widget {