Bug 1516366 - Move nsOnloadBlocker and nsDocumentOnStack to nsDocument.cpp, and shrink nsDocument.h to the minimmum. r=smaug
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 26 Dec 2018 03:35:30 +0100
changeset 452151 16a7aabf4fea82d82f242d45a5915e30c6049494
parent 452150 1c324add4b92260e92eeaaff387ab27d5abe7736
child 452152 dc37a2bc9cda61ba2aed38f566146a24262e2020
push id35287
push usercsabou@mozilla.com
push dateSun, 30 Dec 2018 09:31:19 +0000
treeherdermozilla-central@19fc512f3c95 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1516366
milestone66.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 1516366 - Move nsOnloadBlocker and nsDocumentOnStack to nsDocument.cpp, and shrink nsDocument.h to the minimmum. r=smaug This needs to add a few of includes in other places which were relying on the massive (now gone) list in nsDocument.h. I also needed to move an AnimationTimeline destructor out of line because it relied on dom::Animation being defined, yet Animation.h includes AnimationTimeline.h, so include hell. Differential Revision: https://phabricator.services.mozilla.com/D15366
dom/animation/AnimationTimeline.cpp
dom/animation/AnimationTimeline.h
dom/base/Element.cpp
dom/base/FragmentOrElement.cpp
dom/base/nsDOMWindowUtils.cpp
dom/base/nsDocument.cpp
dom/base/nsDocument.h
dom/base/nsNodeUtils.cpp
dom/console/Console.cpp
dom/html/nsHTMLDocument.h
dom/xbl/nsXBLProtoImplField.cpp
dom/xbl/nsXBLProtoImplMethod.cpp
dom/xhr/XMLHttpRequestMainThread.cpp
dom/xul/XULDocument.cpp
image/VectorImage.cpp
xpfe/appshell/nsWebShellWindow.cpp
--- a/dom/animation/AnimationTimeline.cpp
+++ b/dom/animation/AnimationTimeline.cpp
@@ -6,16 +6,18 @@
 
 #include "AnimationTimeline.h"
 #include "mozilla/AnimationComparator.h"
 #include "mozilla/dom/Animation.h"
 
 namespace mozilla {
 namespace dom {
 
+AnimationTimeline::~AnimationTimeline() { mAnimationOrder.clear(); }
+
 NS_IMPL_CYCLE_COLLECTION_CLASS(AnimationTimeline)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AnimationTimeline)
   tmp->mAnimationOrder.clear();
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindow, mAnimations)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
--- a/dom/animation/AnimationTimeline.h
+++ b/dom/animation/AnimationTimeline.h
@@ -26,17 +26,17 @@ class Animation;
 
 class AnimationTimeline : public nsISupports, public nsWrapperCache {
  public:
   explicit AnimationTimeline(nsIGlobalObject* aWindow) : mWindow(aWindow) {
     MOZ_ASSERT(mWindow);
   }
 
  protected:
-  virtual ~AnimationTimeline() { mAnimationOrder.clear(); }
+  virtual ~AnimationTimeline();
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AnimationTimeline)
 
   nsIGlobalObject* GetParentObject() const { return mWindow; }
 
   // AnimationTimeline methods
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -14,16 +14,17 @@
 
 #include "AnimationCommon.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/StaticPrefs.h"
 #include "mozilla/dom/Animation.h"
 #include "mozilla/dom/Attr.h"
 #include "mozilla/dom/Flex.h"
 #include "mozilla/dom/Grid.h"
+#include "mozilla/dom/ScriptLoader.h"
 #include "mozilla/dom/Text.h"
 #include "mozilla/gfx/Matrix.h"
 #include "nsAtom.h"
 #include "nsDOMAttributeMap.h"
 #include "nsIContentInlines.h"
 #include "mozilla/dom/NodeInfo.h"
 #include "nsIDocumentInlines.h"
 #include "mozilla/dom/DocumentTimeline.h"
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -26,16 +26,17 @@
 #include "mozilla/TextEditor.h"
 #include "mozilla/TouchEvents.h"
 #include "mozilla/URLExtraData.h"
 #include "mozilla/dom/Attr.h"
 #include "nsDOMAttributeMap.h"
 #include "nsAtom.h"
 #include "mozilla/dom/NodeInfo.h"
 #include "mozilla/dom/Event.h"
+#include "mozilla/dom/ScriptLoader.h"
 #include "mozilla/dom/TouchEvent.h"
 #include "nsIDocumentInlines.h"
 #include "nsIDocumentEncoder.h"
 #include "nsIContentIterator.h"
 #include "nsFocusManager.h"
 #include "nsILinkHandler.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIURL.h"
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -4,16 +4,17 @@
  * 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 "nsDOMWindowUtils.h"
 
 #include "mozilla/layers/CompositorBridgeChild.h"
 #include "mozilla/layers/LayerTransactionChild.h"
 #include "nsPresContext.h"
+#include "nsContentList.h"
 #include "nsError.h"
 #include "nsQueryContentEventResult.h"
 #include "nsGlobalWindow.h"
 #include "nsIDocument.h"
 #include "nsFocusManager.h"
 #include "nsFrameManager.h"
 #include "nsRefreshDriver.h"
 #include "mozilla/dom/Animation.h"
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -38,43 +38,48 @@
 #include "nsILoadContext.h"
 #include "nsITextControlFrame.h"
 #include "nsNumberControlFrame.h"
 #include "nsUnicharUtils.h"
 #include "nsContentList.h"
 #include "nsCSSPseudoElements.h"
 #include "nsIObserver.h"
 #include "nsIBaseWindow.h"
+#include "nsILayoutHistoryState.h"
 #include "mozilla/css/Loader.h"
 #include "mozilla/css/ImageLoader.h"
 #include "nsDocShell.h"
 #include "nsDocShellLoadTypes.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsCOMArray.h"
 #include "nsQueryObject.h"
 #include "mozilla/Services.h"
 #include "nsScreen.h"
 #include "ChildIterator.h"
 
 #include "mozilla/AsyncEventDispatcher.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/EventListenerManager.h"
 #include "mozilla/EventStateManager.h"
 #include "mozilla/FullscreenChange.h"
+#include "mozilla/PendingAnimationTracker.h"
 
 #include "mozilla/dom/Attr.h"
 #include "mozilla/dom/BindingDeclarations.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/FeaturePolicy.h"
 #include "mozilla/dom/FramingChecker.h"
 #include "mozilla/dom/HTMLSharedElement.h"
 #include "mozilla/dom/Navigator.h"
+#include "mozilla/dom/Performance.h"
 #include "mozilla/dom/ServiceWorkerContainer.h"
+#include "mozilla/dom/ScriptLoader.h"
+#include "mozilla/dom/StyleSheetList.h"
 #include "mozilla/dom/SVGUseElement.h"
 #include "nsGenericHTMLElement.h"
 #include "mozilla/dom/CDATASection.h"
 #include "mozilla/dom/ProcessingInstruction.h"
 #include "nsDOMString.h"
 #include "nsNodeUtils.h"
 #include "nsLayoutUtils.h"  // for GetFrameForPoint
 #include "nsIFrame.h"
@@ -668,17 +673,27 @@ size_t nsIdentifierMapEntry::SizeOfExclu
 
 class SubDocMapEntry : public PLDHashEntryHdr {
  public:
   // Both of these are strong references
   Element* mKey;  // must be first, to look like PLDHashEntryStub
   nsIDocument* mSubDocument;
 };
 
-// nsOnloadBlocker implementation
+class nsOnloadBlocker final : public nsIRequest {
+ public:
+  nsOnloadBlocker() {}
+
+  NS_DECL_ISUPPORTS
+  NS_DECL_NSIREQUEST
+
+ private:
+  ~nsOnloadBlocker() {}
+};
+
 NS_IMPL_ISUPPORTS(nsOnloadBlocker, nsIRequest)
 
 NS_IMETHODIMP
 nsOnloadBlocker::GetName(nsACString& aResult) {
   aResult.AssignLiteral("about:document-onload-blocker");
   return NS_OK;
 }
 
@@ -7020,16 +7035,27 @@ already_AddRefed<Event> nsIDocument::Cre
   return ev.forget();
 }
 
 void nsIDocument::FlushPendingNotifications(FlushType aType) {
   mozilla::ChangesToFlush flush(aType, aType >= FlushType::Style);
   FlushPendingNotifications(flush);
 }
 
+class nsDocumentOnStack {
+ public:
+  explicit nsDocumentOnStack(nsIDocument* aDoc) : mDoc(aDoc) {
+    mDoc->IncreaseStackRefCnt();
+  }
+  ~nsDocumentOnStack() { mDoc->DecreaseStackRefCnt(); }
+
+ private:
+  nsIDocument* mDoc;
+};
+
 void nsIDocument::FlushPendingNotifications(mozilla::ChangesToFlush aFlush) {
   FlushType flushType = aFlush.mFlushType;
 
   nsDocumentOnStack dos(this);
 
   // We need to flush the sink for non-HTML documents (because the XML
   // parser still does insertion with deferred notifications).  We
   // also need to flush the sink if this is a layout-related flush, to
--- a/dom/base/nsDocument.h
+++ b/dom/base/nsDocument.h
@@ -8,115 +8,28 @@
  * Base class for all our document implementations.
  */
 
 #ifndef nsDocument_h___
 #define nsDocument_h___
 
 #include "nsIDocument.h"
 
-#include "jsfriendapi.h"
-#include "nsCOMPtr.h"
-#include "nsAutoPtr.h"
-#include "nsCRT.h"
-#include "nsTArray.h"
-#include "nsIdentifierMapEntry.h"
-#include "nsStubDocumentObserver.h"
-#include "nsIScriptGlobalObject.h"
-#include "nsIContent.h"
-#include "nsIPrincipal.h"
-#include "nsIParser.h"
-#include "nsBindingManager.h"
-#include "nsRefPtrHashtable.h"
-#include "nsJSThingHashtable.h"
-#include "nsILayoutHistoryState.h"
-#include "nsIRequest.h"
-#include "nsILoadGroup.h"
-#include "nsTObserverArray.h"
-#include "nsStubMutationObserver.h"
-#include "nsIChannel.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsContentList.h"
-#include "nsGkAtoms.h"
-#include "PLDHashTable.h"
-#include "nsDOMAttributeMap.h"
-#include "imgIRequest.h"
-#include "mozilla/EventStates.h"
-#include "mozilla/MemoryReporting.h"
-#include "mozilla/PendingAnimationTracker.h"
-#include "mozilla/dom/BoxObject.h"
-#include "mozilla/dom/DOMImplementation.h"
-#include "mozilla/dom/ScriptLoader.h"
-#include "mozilla/dom/StyleSheetList.h"
-#include "nsDataHashtable.h"
-#include "mozilla/TimeStamp.h"
-#include "mozilla/Attributes.h"
-#include "CustomElementRegistry.h"
-#include "mozilla/dom/Performance.h"
-#include "mozilla/Maybe.h"
-#include "nsIURIClassifier.h"
-
 #define XML_DECLARATION_BITS_DECLARATION_EXISTS (1 << 0)
 #define XML_DECLARATION_BITS_ENCODING_EXISTS (1 << 1)
 #define XML_DECLARATION_BITS_STANDALONE_EXISTS (1 << 2)
 #define XML_DECLARATION_BITS_STANDALONE_YES (1 << 3)
 
-class nsDOMStyleSheetSetList;
-class nsDocument;
-class nsIFormControl;
-class nsOnloadBlocker;
-class nsDOMNavigationTiming;
-class nsWindowSizes;
-class nsHtml5TreeOpExecutor;
-class nsDocumentOnStack;
-class nsISecurityConsoleMessage;
-
-namespace mozilla {
-class EventChainPreVisitor;
-namespace dom {
-class ImageTracker;
-struct LifecycleCallbacks;
-class CallbackFunction;
-class DOMIntersectionObserver;
-class Performance;
-}  // namespace dom
-}  // namespace mozilla
-
-class nsOnloadBlocker final : public nsIRequest {
- public:
-  nsOnloadBlocker() {}
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIREQUEST
-
- private:
-  ~nsOnloadBlocker() {}
-};
-
 // Base class for our document implementations.
 class nsDocument : public nsIDocument {
- public:
-  using mozilla::dom::DocumentOrShadowRoot::GetElementById;
-  using mozilla::dom::DocumentOrShadowRoot::GetElementsByClassName;
-  using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagName;
-  using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagNameNS;
+ protected:
 
   explicit nsDocument(const char* aContentType);
   virtual ~nsDocument();
 
- private:
-  // These are not implemented and not supported.
-  nsDocument(const nsDocument& aOther);
-  nsDocument& operator=(const nsDocument& aOther);
-};
-
-class nsDocumentOnStack {
- public:
-  explicit nsDocumentOnStack(nsIDocument* aDoc) : mDoc(aDoc) {
-    mDoc->IncreaseStackRefCnt();
-  }
-  ~nsDocumentOnStack() { mDoc->DecreaseStackRefCnt(); }
+  // Don't add stuff here, add to nsIDocument instead.
 
  private:
-  nsIDocument* mDoc;
+  nsDocument(const nsDocument& aOther) = delete;
+  nsDocument& operator=(const nsDocument& aOther) = delete;
 };
 
 #endif /* nsDocument_h___ */
--- a/dom/base/nsNodeUtils.cpp
+++ b/dom/base/nsNodeUtils.cpp
@@ -30,16 +30,17 @@
 #include "mozilla/dom/Animation.h"
 #include "mozilla/dom/HTMLImageElement.h"
 #include "mozilla/dom/HTMLMediaElement.h"
 #include "mozilla/dom/KeyframeEffect.h"
 #include "nsWrapperCacheInlines.h"
 #include "nsObjectLoadingContent.h"
 #include "nsDOMMutationObserver.h"
 #include "mozilla/dom/BindingUtils.h"
+#include "mozilla/dom/CustomElementRegistry.h"
 #include "mozilla/dom/HTMLTemplateElement.h"
 #include "mozilla/dom/ShadowRoot.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using mozilla::AutoJSContext;
 
 enum class IsRemoveNotification {
--- a/dom/console/Console.cpp
+++ b/dom/console/Console.cpp
@@ -10,16 +10,17 @@
 #include "ConsoleCommon.h"
 
 #include "mozilla/dom/BlobBinding.h"
 #include "mozilla/dom/DOMPrefs.h"
 #include "mozilla/dom/Exceptions.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/FunctionBinding.h"
 #include "mozilla/dom/Performance.h"
+#include "mozilla/dom/PromiseBinding.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/StructuredCloneHolder.h"
 #include "mozilla/dom/ToJSValue.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "mozilla/dom/WorkerRunnable.h"
 #include "mozilla/dom/WorkerScope.h"
 #include "mozilla/dom/WorkletGlobalScope.h"
 #include "mozilla/dom/WorkletImpl.h"
--- a/dom/html/nsHTMLDocument.h
+++ b/dom/html/nsHTMLDocument.h
@@ -2,16 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsHTMLDocument_h___
 #define nsHTMLDocument_h___
 
 #include "mozilla/Attributes.h"
+#include "nsContentList.h"
 #include "nsDocument.h"
 #include "nsIHTMLDocument.h"
 #include "nsIHTMLCollection.h"
 #include "nsIScriptElement.h"
 #include "nsTArray.h"
 
 #include "PLDHashTable.h"
 #include "nsIHttpChannel.h"
@@ -28,16 +29,18 @@ class nsILoadGroup;
 
 namespace mozilla {
 namespace dom {
 class HTMLAllCollection;
 }  // namespace dom
 }  // namespace mozilla
 
 class nsHTMLDocument : public nsDocument, public nsIHTMLDocument {
+  typedef mozilla::net::ReferrerPolicy ReferrerPolicy;
+
  public:
   using nsDocument::GetPlugins;
   using nsDocument::SetDocumentURI;
 
   nsHTMLDocument();
   virtual nsresult Init() override;
 
   NS_DECL_ISUPPORTS_INHERITED
--- a/dom/xbl/nsXBLProtoImplField.cpp
+++ b/dom/xbl/nsXBLProtoImplField.cpp
@@ -12,16 +12,17 @@
 #include "js/CharacterEncoding.h"
 #include "nsUnicharUtils.h"
 #include "nsReadableUtils.h"
 #include "nsXBLProtoImplField.h"
 #include "nsIScriptContext.h"
 #include "nsIURI.h"
 #include "nsXBLSerialize.h"
 #include "nsXBLPrototypeBinding.h"
+#include "mozilla/CycleCollectedJSContext.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/ElementBinding.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "nsGlobalWindow.h"
 #include "xpcpublic.h"
 #include "WrapperFactory.h"
 
 using namespace mozilla;
--- a/dom/xbl/nsXBLProtoImplMethod.cpp
+++ b/dom/xbl/nsXBLProtoImplMethod.cpp
@@ -14,16 +14,17 @@
 #include "nsReadableUtils.h"
 #include "nsXBLProtoImplMethod.h"
 #include "nsJSUtils.h"
 #include "nsContentUtils.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIXPConnect.h"
 #include "xpcpublic.h"
 #include "nsXBLPrototypeBinding.h"
+#include "mozilla/CycleCollectedJSContext.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ScriptSettings.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsXBLProtoImplMethod::nsXBLProtoImplMethod(const char16_t* aName)
     : nsXBLProtoImplMember(aName), mMethod() {
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -19,16 +19,17 @@
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/FileBinding.h"
 #include "mozilla/dom/FileCreatorHelper.h"
 #include "mozilla/dom/FetchUtil.h"
 #include "mozilla/dom/FormData.h"
 #include "mozilla/dom/MutableBlobStorage.h"
 #include "mozilla/dom/XMLDocument.h"
 #include "mozilla/dom/URLSearchParams.h"
+#include "mozilla/dom/Promise.h"
 #include "mozilla/dom/PromiseNativeHandler.h"
 #include "mozilla/Encoding.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/EventListenerManager.h"
 #include "mozilla/EventStateManager.h"
 #include "mozilla/LoadInfo.h"
 #include "mozilla/LoadContext.h"
 #include "mozilla/MemoryReporting.h"
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -73,16 +73,17 @@
 #include "nsIStyleSheetLinkingElement.h"
 #include "nsIObserverService.h"
 #include "nsNodeUtils.h"
 #include "nsIXULWindow.h"
 #include "nsXULPopupManager.h"
 #include "nsCCUncollectableMarker.h"
 #include "nsURILoader.h"
 #include "mozilla/BasicEvents.h"
+#include "mozilla/CycleCollectedJSContext.h"
 #include "mozilla/dom/DocumentL10n.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/NodeInfoInlines.h"
 #include "mozilla/dom/ProcessingInstruction.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/XULDocumentBinding.h"
 #include "mozilla/dom/XULPersist.h"
 #include "mozilla/EventDispatcher.h"
--- a/image/VectorImage.cpp
+++ b/image/VectorImage.cpp
@@ -12,16 +12,17 @@
 #include "gfxUtils.h"
 #include "imgFrame.h"
 #include "mozilla/AutoRestore.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/SVGSVGElement.h"
 #include "mozilla/dom/SVGDocument.h"
 #include "mozilla/gfx/2D.h"
+#include "mozilla/PendingAnimationTracker.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/Tuple.h"
 #include "nsIPresShell.h"
 #include "nsIStreamListener.h"
 #include "nsMimeTypes.h"
 #include "nsPresContext.h"
 #include "nsRect.h"
 #include "nsString.h"
@@ -31,17 +32,17 @@
 #include "ImageRegion.h"
 #include "ISurfaceProvider.h"
 #include "LookupResult.h"
 #include "Orientation.h"
 #include "SVGDocumentWrapper.h"
 #include "SVGDrawingParameters.h"
 #include "nsIDOMEventListener.h"
 #include "SurfaceCache.h"
-#include "nsDocument.h"
+#include "nsIDocument.h"
 
 namespace mozilla {
 
 using namespace dom;
 using namespace dom::SVGPreserveAspectRatio_Binding;
 using namespace gfx;
 using namespace layers;
 
@@ -1474,19 +1475,18 @@ void VectorImage::InvalidateObserversOnN
 void VectorImage::PropagateUseCounters(nsIDocument* aParentDocument) {
   nsIDocument* doc = mSVGDocumentWrapper->GetDocument();
   if (doc) {
     doc->PropagateUseCounters(aParentDocument);
   }
 }
 
 void VectorImage::ReportUseCounters() {
-  nsIDocument* doc = mSVGDocumentWrapper->GetDocument();
-  if (doc) {
-    static_cast<nsDocument*>(doc)->ReportUseCounters();
+  if (nsIDocument* doc = mSVGDocumentWrapper->GetDocument()) {
+    doc->ReportUseCounters();
   }
 }
 
 nsIntSize VectorImage::OptimalImageSizeForDest(const gfxSize& aDest,
                                                uint32_t aWhichFrame,
                                                SamplingFilter aSamplingFilter,
                                                uint32_t aFlags) {
   MOZ_ASSERT(aDest.width >= 0 || ceil(aDest.width) <= INT32_MAX ||
--- a/xpfe/appshell/nsWebShellWindow.cpp
+++ b/xpfe/appshell/nsWebShellWindow.cpp
@@ -2,16 +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/. */
 
 #include "nsWebShellWindow.h"
 
 #include "nsLayoutCID.h"
 #include "nsContentCID.h"
+#include "nsContentList.h"
 #include "nsIWeakReference.h"
 #include "nsIContentViewer.h"
 #include "nsIComponentManager.h"
 #include "nsIServiceManager.h"
 #include "nsIURL.h"
 #include "nsIIOService.h"
 #include "nsIURL.h"
 #include "nsNetCID.h"