Bug 1510116. Fix some unified build issues in layout code. r=emilio
authorJonathan Watt <jwatt@jwatt.org>
Mon, 12 Nov 2018 22:20:52 +0000
changeset 504717 9ec6a81e695aef5d519d0e8a79927a9d6e915c03
parent 504716 dc6c022e9fe127bd0d32e25e3206f79e3d0d954c
child 504718 e3ca695c95b2f5f69e6be409e8be394ade8932b3
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1510116
milestone65.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 1510116. Fix some unified build issues in layout code. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D13039
gfx/layers/LayersLogging.h
gfx/layers/wr/IpcResourceUpdateQueue.h
gfx/webrender_bindings/WebRenderAPI.h
layout/base/RestyleManager.cpp
layout/build/nsLayoutStatics.cpp
layout/forms/nsColorControlFrame.cpp
layout/forms/nsHTMLButtonControlFrame.cpp
layout/forms/nsLegendFrame.cpp
layout/generic/ScrollAnimationPhysics.h
layout/inspector/InspectorUtils.cpp
layout/inspector/ServoStyleRuleMap.cpp
layout/inspector/inDeepTreeWalker.cpp
layout/mathml/nsMathMLOperators.cpp
layout/mathml/nsMathMLmactionFrame.cpp
layout/mathml/nsMathMLmfencedFrame.cpp
layout/mathml/nsMathMLmmultiscriptsFrame.cpp
layout/mathml/nsMathMLmoFrame.cpp
layout/mathml/nsMathMLmpaddedFrame.cpp
layout/mathml/nsMathMLmrowFrame.cpp
layout/mathml/nsMathMLmspaceFrame.cpp
layout/mathml/nsMathMLmunderoverFrame.cpp
layout/mathml/nsMathMLsemanticsFrame.cpp
layout/painting/nsDisplayList.cpp
layout/printing/PrintTranslator.h
layout/printing/ipc/RemotePrintJobParent.h
layout/printing/nsPrintData.cpp
layout/printing/nsPrintJob.cpp
layout/printing/nsPrintObject.cpp
layout/style/CSSKeyframesRule.cpp
layout/style/CounterStyleManager.cpp
layout/style/Loader.cpp
layout/style/MappedDeclarations.cpp
layout/style/MediaList.cpp
layout/style/ServoCSSParser.h
layout/style/ServoCSSRuleList.cpp
layout/style/ServoStyleSet.cpp
layout/style/nsDOMCSSValueList.cpp
layout/svg/SVGFELeafFrame.cpp
layout/svg/SVGFEUnstyledLeafFrame.cpp
layout/svg/SVGObserverUtils.cpp
layout/svg/SVGViewFrame.cpp
layout/svg/nsCSSClipPathInstance.h
layout/svg/nsSVGGFrame.cpp
layout/svg/nsSVGGenericContainerFrame.cpp
layout/svg/nsSVGInnerSVGFrame.cpp
layout/svg/nsSVGMarkerFrame.cpp
layout/svg/nsSVGOuterSVGFrame.cpp
layout/svg/nsSVGStopFrame.cpp
layout/svg/nsSVGSwitchFrame.cpp
layout/svg/nsSVGSymbolFrame.cpp
layout/tables/FixedTableLayoutStrategy.cpp
layout/tables/SpanningCellSorter.cpp
layout/tables/nsTableFrame.cpp
layout/xul/grid/nsGridRowGroupFrame.cpp
layout/xul/grid/nsGridRowLeafFrame.cpp
layout/xul/nsButtonBoxFrame.cpp
layout/xul/nsDeckFrame.cpp
layout/xul/nsDocElementBoxFrame.cpp
layout/xul/nsMenuBarListener.h
layout/xul/nsMenuPopupFrame.h
layout/xul/nsResizerFrame.h
layout/xul/nsSplitterFrame.cpp
layout/xul/tree/nsTreeColFrame.cpp
layout/xul/tree/nsTreeColFrame.h
layout/xul/tree/nsTreeColumns.cpp
layout/xul/tree/nsTreeContentView.cpp
layout/xul/tree/nsTreeStyleCache.h
--- a/gfx/layers/LayersLogging.h
+++ b/gfx/layers/LayersLogging.h
@@ -9,16 +9,17 @@
 
 #include "FrameMetrics.h"               // for FrameMetrics
 #include "mozilla/gfx/Matrix.h"         // for Matrix4x4
 #include "mozilla/gfx/Point.h"          // for IntSize, etc
 #include "mozilla/gfx/TiledRegion.h"    // for TiledRegion
 #include "mozilla/gfx/Types.h"          // for SamplingFilter, SurfaceFormat
 #include "mozilla/layers/CompositorTypes.h"  // for TextureFlags
 #include "mozilla/layers/WebRenderLayersLogging.h"
+#include "mozilla/layers/ZoomConstraints.h"
 #include "nsAString.h"
 #include "nsPrintfCString.h"            // for nsPrintfCString
 #include "nsRegion.h"                   // for nsRegion, nsIntRegion
 #include "nscore.h"                     // for nsACString, etc
 
 struct nsRectAbsolute;
 
 namespace mozilla {
--- a/gfx/layers/wr/IpcResourceUpdateQueue.h
+++ b/gfx/layers/wr/IpcResourceUpdateQueue.h
@@ -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/. */
 
 #ifndef GFX_WR_IPCRESOURCEUPDATEQUEUE_H
 #define GFX_WR_IPCRESOURCEUPDATEQUEUE_H
 
 #include "mozilla/layers/WebRenderMessages.h"
 #include "mozilla/layers/RefCountedShmem.h"
+#include "mozilla/layers/TextureClient.h"
 #include "mozilla/webrender/WebRenderTypes.h"
 
 namespace mozilla {
 namespace ipc {
 class IShmemAllocator;
 }
 namespace wr {
 
--- a/gfx/webrender_bindings/WebRenderAPI.h
+++ b/gfx/webrender_bindings/WebRenderAPI.h
@@ -8,16 +8,17 @@
 #define MOZILLA_LAYERS_WEBRENDERAPI_H
 
 #include <vector>
 #include <unordered_map>
 #include <unordered_set>
 
 #include "mozilla/AlreadyAddRefed.h"
 #include "mozilla/gfx/CompositorHitTestInfo.h"
+#include "mozilla/layers/IpcResourceUpdateQueue.h"
 #include "mozilla/layers/ScrollableLayerGuid.h"
 #include "mozilla/layers/SyncObject.h"
 #include "mozilla/Range.h"
 #include "mozilla/webrender/webrender_ffi.h"
 #include "mozilla/webrender/WebRenderTypes.h"
 #include "GLTypes.h"
 #include "Units.h"
 
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -8,16 +8,17 @@
 
 #include "mozilla/AutoRestyleTimelineMarker.h"
 #include "mozilla/AutoTimelineMarker.h"
 #include "mozilla/ComputedStyle.h"
 #include "mozilla/ComputedStyleInlines.h"
 #include "mozilla/DocumentStyleRootIterator.h"
 #include "mozilla/GeckoBindings.h"
 #include "mozilla/LayerAnimationInfo.h"
+#include "mozilla/layers/AnimationInfo.h"
 #include "mozilla/ServoBindings.h"
 #include "mozilla/ServoStyleSetInlines.h"
 #include "mozilla/Unused.h"
 #include "mozilla/ViewportFrame.h"
 #include "mozilla/dom/ChildIterator.h"
 #include "mozilla/dom/ElementInlines.h"
 #include "mozilla/dom/HTMLBodyElement.h"
 
@@ -48,16 +49,18 @@
 #include "SVGTextFrame.h"
 #include "ActiveLayerTracker.h"
 #include "nsSVGIntegrationUtils.h"
 
 #ifdef ACCESSIBILITY
 #include "nsAccessibilityService.h"
 #endif
 
+using mozilla::layers::AnimationInfo;
+
 using namespace mozilla::dom;
 using namespace mozilla::layers;
 
 namespace mozilla {
 
 RestyleManager::RestyleManager(nsPresContext* aPresContext)
   : mPresContext(aPresContext)
   , mRestyleGeneration(1)
--- a/layout/build/nsLayoutStatics.cpp
+++ b/layout/build/nsLayoutStatics.cpp
@@ -5,16 +5,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "base/basictypes.h"
 
 #include "nsLayoutStatics.h"
 #include "nscore.h"
 
 #include "DateTimeFormat.h"
+#include "MediaManager.h"
+#include "mozilla/dom/ServiceWorkerRegistrar.h"
 #include "nsAttrValue.h"
 #include "nsColorNames.h"
 #include "nsComputedDOMStyle.h"
 #include "nsContentDLF.h"
 #include "nsContentUtils.h"
 #include "nsCSSAnonBoxes.h"
 #include "mozilla/css/ErrorReporter.h"
 #include "nsCSSKeywords.h"
--- a/layout/forms/nsColorControlFrame.cpp
+++ b/layout/forms/nsColorControlFrame.cpp
@@ -10,16 +10,17 @@
 #include "nsContentUtils.h"
 #include "nsCSSPseudoElements.h"
 #include "nsCheckboxRadioFrame.h"
 #include "nsGkAtoms.h"
 #include "nsIFormControl.h"
 #include "mozilla/dom/HTMLInputElement.h"
 #include "nsIDocument.h"
 
+using namespace mozilla;
 using mozilla::dom::Element;
 using mozilla::dom::HTMLInputElement;
 using mozilla::dom::CallerType;
 
 nsColorControlFrame::nsColorControlFrame(ComputedStyle* aStyle)
   : nsHTMLButtonControlFrame(aStyle, kClassID)
 {
 }
--- a/layout/forms/nsHTMLButtonControlFrame.cpp
+++ b/layout/forms/nsHTMLButtonControlFrame.cpp
@@ -3,16 +3,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 "nsHTMLButtonControlFrame.h"
 
 #include "nsContainerFrame.h"
 #include "nsIFormControlFrame.h"
+#include "nsIFrameInlines.h"
 #include "nsPresContext.h"
 #include "nsGkAtoms.h"
 #include "nsButtonFrameRenderer.h"
 #include "nsCSSAnonBoxes.h"
 #include "nsCheckboxRadioFrame.h"
 #include "nsNameSpaceManager.h"
 #include "nsDisplayList.h"
 #include <algorithm>
--- a/layout/forms/nsLegendFrame.cpp
+++ b/layout/forms/nsLegendFrame.cpp
@@ -1,22 +1,27 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
 #include "nsLegendFrame.h"
+
+#include "ComputedStyle.h"
 #include "nsIContent.h"
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsHTMLParts.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsCheckboxRadioFrame.h"
+#include "WritingModes.h"
+
+using namespace mozilla;
 
 nsIFrame*
 NS_NewLegendFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle)
 {
 #ifdef DEBUG
   const nsStyleDisplay* disp = aStyle->StyleDisplay();
   NS_ASSERTION(!disp->IsAbsolutelyPositionedStyle() && !disp->IsFloatingStyle(),
                "Legends should not be positioned and should not float");
--- a/layout/generic/ScrollAnimationPhysics.h
+++ b/layout/generic/ScrollAnimationPhysics.h
@@ -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/. */
 
 #ifndef mozilla_layout_ScrollAnimationPhysics_h_
 #define mozilla_layout_ScrollAnimationPhysics_h_
 
 #include "mozilla/TimeStamp.h"
 #include "nsPoint.h"
+#include "Units.h"
 
 namespace mozilla {
 
 class ScrollAnimationPhysics
 {
 public:
   virtual void Update(const TimeStamp& aTime,
                       const nsPoint& aDestination,
--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.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 "mozilla/ArrayUtils.h"
 #include "mozilla/EventStates.h"
 
 #include "inLayoutUtils.h"
 
+#include "gfxTextRun.h"
 #include "nsArray.h"
 #include "nsAutoPtr.h"
 #include "nsIServiceManager.h"
 #include "nsString.h"
 #include "nsIStyleSheetLinkingElement.h"
 #include "nsIContentInlines.h"
 #include "nsIDocument.h"
 #include "nsIPresShell.h"
--- a/layout/inspector/ServoStyleRuleMap.cpp
+++ b/layout/inspector/ServoStyleRuleMap.cpp
@@ -5,21 +5,25 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ServoStyleRuleMap.h"
 
 #include "mozilla/css/GroupRule.h"
 #include "mozilla/dom/CSSImportRule.h"
 #include "mozilla/dom/CSSRuleBinding.h"
 #include "mozilla/dom/CSSStyleRule.h"
+#include "mozilla/dom/ShadowRoot.h"
 #include "mozilla/IntegerRange.h"
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "nsDocument.h"
 #include "nsStyleSheetService.h"
+#include "nsXBLPrototypeResources.h"
+
+using namespace mozilla::dom;
 
 namespace mozilla {
 
 void
 ServoStyleRuleMap::EnsureTable(ServoStyleSet& aStyleSet)
 {
   if (!IsEmpty()) {
     return;
--- a/layout/inspector/inDeepTreeWalker.cpp
+++ b/layout/inspector/inDeepTreeWalker.cpp
@@ -2,25 +2,29 @@
 /* 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/. */
 
 #include "inDeepTreeWalker.h"
 #include "inLayoutUtils.h"
 
+#include "BindingStyleRule.h"
+#include "InspectorUtils.h"
 #include "nsString.h"
 #include "nsIDocument.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIContent.h"
 #include "ChildIterator.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/InspectorUtils.h"
 #include "mozilla/dom/NodeFilterBinding.h"
 
+using mozilla::dom::InspectorUtils;
+
 /*****************************************************************************
  * This implementation does not currently operaate according to the W3C spec.
  * In particular it does NOT handle DOM mutations during the walk.  It also
  * ignores whatToShow and the filter.
  *****************************************************************************/
 
 ////////////////////////////////////////////////////
 
--- a/layout/mathml/nsMathMLOperators.cpp
+++ b/layout/mathml/nsMathMLOperators.cpp
@@ -3,16 +3,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 "nsMathMLOperators.h"
 #include "nsCOMPtr.h"
 #include "nsDataHashtable.h"
 #include "nsHashKeys.h"
+#include "nsNetUtil.h"
 #include "nsTArray.h"
 
 #include "nsIPersistentProperties2.h"
 #include "nsISimpleEnumerator.h"
 #include "nsCRT.h"
 
 // operator dictionary entry
 struct OperatorData {
--- a/layout/mathml/nsMathMLmactionFrame.cpp
+++ b/layout/mathml/nsMathMLmactionFrame.cpp
@@ -11,16 +11,17 @@
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIWebBrowserChrome.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsTextFragment.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/dom/Event.h"
 
+using namespace mozilla;
 using mozilla::dom::Event;
 
 //
 // <maction> -- bind actions to a subexpression - implementation
 //
 
 enum nsMactionActionTypes {
   NS_MATHML_ACTION_TYPE_CLASS_ERROR            = 0x10,
--- a/layout/mathml/nsMathMLmfencedFrame.cpp
+++ b/layout/mathml/nsMathMLmfencedFrame.cpp
@@ -6,16 +6,18 @@
 
 #include "gfxContext.h"
 #include "nsMathMLmfencedFrame.h"
 #include "nsMathMLChar.h"
 #include <algorithm>
 
 using namespace mozilla;
 
+using mozilla::gfx::DrawTarget;
+
 //
 // <mfenced> -- surround content with a pair of fences
 //
 
 nsIFrame*
 NS_NewMathMLmfencedFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle)
 {
   return new (aPresShell) nsMathMLmfencedFrame(aStyle);
--- a/layout/mathml/nsMathMLmmultiscriptsFrame.cpp
+++ b/layout/mathml/nsMathMLmmultiscriptsFrame.cpp
@@ -6,17 +6,17 @@
 
 
 #include "nsMathMLmmultiscriptsFrame.h"
 #include "nsPresContext.h"
 #include <algorithm>
 #include "gfxContext.h"
 #include "gfxMathTable.h"
 
-using mozilla::WritingMode;
+using namespace mozilla;
 
 //
 // <mmultiscripts> -- attach prescripts and tensor indices to a base - implementation
 // <msub> -- attach a subscript to a base - implementation
 // <msubsup> -- attach a subscript-superscript pair to a base - implementation
 // <msup> -- attach a superscript to a base - implementation
 //
 
--- a/layout/mathml/nsMathMLmoFrame.cpp
+++ b/layout/mathml/nsMathMLmoFrame.cpp
@@ -7,16 +7,18 @@
 #include "gfxContext.h"
 #include "nsMathMLmoFrame.h"
 #include "nsPresContext.h"
 #include "nsContentUtils.h"
 #include "nsFrameSelection.h"
 #include "nsMathMLElement.h"
 #include <algorithm>
 
+using namespace mozilla;
+
 //
 // <mo> -- operator, fence, or separator - implementation
 //
 
 // additional ComputedStyle to be used by our MathMLChar.
 #define NS_MATHML_CHAR_STYLE_CONTEXT_INDEX   0
 
 nsIFrame*
--- a/layout/mathml/nsMathMLmpaddedFrame.cpp
+++ b/layout/mathml/nsMathMLmpaddedFrame.cpp
@@ -6,16 +6,18 @@
 
 
 #include "nsMathMLmpaddedFrame.h"
 #include "nsMathMLElement.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/TextUtils.h"
 #include <algorithm>
 
+using namespace mozilla;
+
 //
 // <mpadded> -- adjust space around content - implementation
 //
 
 #define NS_MATHML_SIGN_INVALID           -1 // if the attribute is not there
 #define NS_MATHML_SIGN_UNSPECIFIED        0
 #define NS_MATHML_SIGN_MINUS              1
 #define NS_MATHML_SIGN_PLUS               2
--- a/layout/mathml/nsMathMLmrowFrame.cpp
+++ b/layout/mathml/nsMathMLmrowFrame.cpp
@@ -2,16 +2,18 @@
 /* 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/. */
 
 #include "nsMathMLmrowFrame.h"
 #include "mozilla/gfx/2D.h"
 
+using namespace mozilla;
+
 //
 // <mrow> -- horizontally group any number of subexpressions - implementation
 //
 
 nsIFrame*
 NS_NewMathMLmrowFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle)
 {
   return new (aPresShell) nsMathMLmrowFrame(aStyle);
--- a/layout/mathml/nsMathMLmspaceFrame.cpp
+++ b/layout/mathml/nsMathMLmspaceFrame.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 "nsMathMLmspaceFrame.h"
 #include "nsMathMLElement.h"
 #include "mozilla/gfx/2D.h"
 #include <algorithm>
 
+using namespace mozilla;
 
 //
 // <mspace> -- space - implementation
 //
 
 nsIFrame*
 NS_NewMathMLmspaceFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle)
 {
--- a/layout/mathml/nsMathMLmunderoverFrame.cpp
+++ b/layout/mathml/nsMathMLmunderoverFrame.cpp
@@ -7,16 +7,18 @@
 #include "nsMathMLmunderoverFrame.h"
 #include "nsPresContext.h"
 #include "nsMathMLmmultiscriptsFrame.h"
 #include "nsMathMLElement.h"
 #include <algorithm>
 #include "gfxContext.h"
 #include "gfxMathTable.h"
 
+using namespace mozilla;
+
 //
 // <munderover> -- attach an underscript-overscript pair to a base - implementation
 // <mover> -- attach an overscript to a base - implementation
 // <munder> -- attach an underscript to a base - implementation
 //
 
 nsIFrame*
 NS_NewMathMLmunderoverFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle)
--- a/layout/mathml/nsMathMLsemanticsFrame.cpp
+++ b/layout/mathml/nsMathMLsemanticsFrame.cpp
@@ -4,16 +4,18 @@
  * 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 "nsMathMLsemanticsFrame.h"
 #include "nsMimeTypes.h"
 #include "mozilla/gfx/2D.h"
 
+using namespace mozilla;
+
 //
 // <semantics> -- associate annotations with a MathML expression
 //
 
 nsIFrame*
 NS_NewMathMLsemanticsFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle)
 {
   return new (aPresShell) nsMathMLsemanticsFrame(aStyle);
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -17,26 +17,29 @@
 #include <limits>
 
 #include "gfxContext.h"
 #include "gfxUtils.h"
 #include "mozilla/dom/TabChild.h"
 #include "mozilla/dom/HTMLCanvasElement.h"
 #include "mozilla/dom/KeyframeEffect.h"
 #include "mozilla/dom/Selection.h"
+#include "mozilla/dom/ServiceWorkerRegistrar.h"
+#include "mozilla/dom/ServiceWorkerRegistration.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/layers/PLayerTransaction.h"
 #include "mozilla/ShapeUtils.h"
 #include "nsCSSRendering.h"
 #include "nsCSSRenderingGradients.h"
 #include "nsISelectionController.h"
 #include "nsIPresShell.h"
 #include "nsRegion.h"
 #include "nsStyleStructInlines.h"
 #include "nsStyleTransformMatrix.h"
+#include "nsTransitionManager.h"
 #include "gfxMatrix.h"
 #include "gfxPrefs.h"
 #include "nsSVGIntegrationUtils.h"
 #include "nsSVGUtils.h"
 #include "nsLayoutUtils.h"
 #include "nsIScrollableFrame.h"
 #include "nsIFrameInlines.h"
 #include "nsStyleConsts.h"
--- a/layout/printing/PrintTranslator.h
+++ b/layout/printing/PrintTranslator.h
@@ -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/. */
 
 #ifndef mozilla_layout_PrintTranslator_h
 #define mozilla_layout_PrintTranslator_h
 
 #include <istream>
 
+#include "DrawEventRecorder.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/gfx/Filters.h"
 #include "mozilla/gfx/RecordedEvent.h"
 #include "nsRefPtrHashtable.h"
 
 class nsDeviceContext;
 
 namespace mozilla {
--- a/layout/printing/ipc/RemotePrintJobParent.h
+++ b/layout/printing/ipc/RemotePrintJobParent.h
@@ -14,21 +14,22 @@
 #include "nsCOMPtr.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/gfx/RecordedEvent.h"
 
 class nsDeviceContext;
 class nsIPrintSettings;
 class nsIWebProgressListener;
-class PrintTranslator;
 
 namespace mozilla {
 namespace layout {
 
+class PrintTranslator;
+
 class RemotePrintJobParent final : public PRemotePrintJobParent
 {
 public:
   explicit RemotePrintJobParent(nsIPrintSettings* aPrintSettings);
 
   void ActorDestroy(ActorDestroyReason aWhy) final;
 
   mozilla::ipc::IPCResult RecvInitializePrint(const nsString& aDocumentTitle,
--- a/layout/printing/nsPrintData.cpp
+++ b/layout/printing/nsPrintData.cpp
@@ -3,16 +3,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 "nsPrintData.h"
 
 #include "nsIStringBundle.h"
 #include "nsIServiceManager.h"
+#include "nsIWidget.h"
 #include "nsPrintObject.h"
 #include "nsPrintPreviewListener.h"
 #include "nsIWebProgressListener.h"
 #include "mozilla/Services.h"
 
 //-----------------------------------------------------
 // PR LOGGING
 #include "mozilla/Logging.h"
--- a/layout/printing/nsPrintJob.cpp
+++ b/layout/printing/nsPrintJob.cpp
@@ -132,17 +132,17 @@ using namespace mozilla::dom;
 // but we only want some of it on,
 //#define EXTENDED_DEBUG_PRINTING
 #endif
 
 // this log level turns on the dumping of each document's layout info
 #define DUMP_LAYOUT_LEVEL (static_cast<mozilla::LogLevel>(9))
 
 #ifndef PR_PL
-static mozilla::LazyLogModule gPrintingLog("printing")
+static mozilla::LazyLogModule gPrintingLog("printing");
 
 #define PR_PL(_p1)  MOZ_LOG(gPrintingLog, mozilla::LogLevel::Debug, _p1);
 #endif
 
 #ifdef EXTENDED_DEBUG_PRINTING
 static uint32_t gDumpFileNameCnt   = 0;
 static uint32_t gDumpLOFileNameCnt = 0;
 #endif
--- a/layout/printing/nsPrintObject.cpp
+++ b/layout/printing/nsPrintObject.cpp
@@ -1,27 +1,33 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
 #include "nsPrintObject.h"
+
 #include "nsIContentViewer.h"
 #include "nsContentUtils.h" // for nsAutoScriptBlocker
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsPIDOMWindow.h"
+#include "nsPresContext.h"
 #include "nsGkAtoms.h"
 #include "nsComponentManagerUtils.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIBaseWindow.h"
 #include "nsIDocument.h"
 #include "nsDocShell.h"
 
 #include "mozilla/dom/BrowsingContext.h"
+#include "mozilla/dom/Element.h"
+
+using mozilla::dom::BrowsingContext;
+using mozilla::dom::Element;
 
 //---------------------------------------------------
 //-- nsPrintObject Class Impl
 //---------------------------------------------------
 nsPrintObject::nsPrintObject() :
   mContent(nullptr), mFrameType(eFrame), mParent(nullptr),
   mHasBeenPrinted(false), mDontPrint(true), mPrintAsIs(false),
   mInvisible(false), mPrintPreview(false), mDidCreateDocShell(false),
--- a/layout/style/CSSKeyframesRule.cpp
+++ b/layout/style/CSSKeyframesRule.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 "mozilla/dom/CSSKeyframesRule.h"
 
 #include "mozilla/dom/CSSKeyframesRuleBinding.h"
 #include "mozilla/dom/CSSRuleList.h"
 #include "mozilla/ServoBindings.h"
+#include "nsCOMArray.h"
 
 #include <limits>
 
 namespace mozilla {
 namespace dom {
 
 // -------------------------------------------
 // CSSKeyframeList
--- a/layout/style/CounterStyleManager.cpp
+++ b/layout/style/CounterStyleManager.cpp
@@ -7,16 +7,17 @@
 #include "CounterStyleManager.h"
 
 #include "mozilla/ArenaObjectID.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/Types.h"
 #include "mozilla/WritingModes.h"
+#include "nsPresContext.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsTHashtable.h"
 #include "nsUnicodeProperties.h"
 #include "mozilla/ServoBindings.h"
 #include "mozilla/ServoStyleSet.h"
 
 namespace mozilla {
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -15,16 +15,17 @@
 #include "mozilla/LoadInfo.h"
 #include "mozilla/Logging.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/SystemGroup.h"
 #include "mozilla/ResultExtensions.h"
 #include "mozilla/URLPreloader.h"
 #include "nsIRunnable.h"
+#include "nsITimedChannel.h"
 #include "nsSyncLoadService.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsIURI.h"
 #include "nsNetUtil.h"
 #include "nsIProtocolHandler.h"
--- a/layout/style/MappedDeclarations.cpp
+++ b/layout/style/MappedDeclarations.cpp
@@ -1,15 +1,19 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
-#include "mozilla/MappedDeclarations.h"
+#include "MappedDeclarations.h"
+
+#include "nsAttrValue.h"
+#include "nsIDocument.h"
+#include "nsPresContext.h"
 
 namespace mozilla {
 
 void
 MappedDeclarations::SetIdentAtomValue(nsCSSPropertyID aId, nsAtom* aValue)
 {
   Servo_DeclarationBlock_SetIdentStringValue(mDecl, aId, aValue);
   if (aId == eCSSProperty__x_lang) {
--- a/layout/style/MediaList.cpp
+++ b/layout/style/MediaList.cpp
@@ -8,16 +8,17 @@
 
 #include "mozilla/dom/MediaList.h"
 
 #include "mozAutoDocUpdate.h"
 #include "mozilla/dom/MediaListBinding.h"
 #include "mozilla/ServoBindings.h"
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/StyleSheetInlines.h"
+#include "nsPresContext.h"
 
 namespace mozilla {
 namespace dom {
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MediaList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
--- a/layout/style/ServoCSSParser.h
+++ b/layout/style/ServoCSSParser.h
@@ -6,16 +6,17 @@
 
 /* CSS parsing utility functions */
 
 #ifndef mozilla_ServoCSSParser_h
 #define mozilla_ServoCSSParser_h
 
 #include "mozilla/gfx/Types.h"
 #include "mozilla/RefPtr.h"
+#include "mozilla/ServoStyleConsts.h"
 #include "mozilla/ServoTypes.h"
 #include "nsColor.h"
 #include "nsCSSPropertyID.h"
 #include "nsDOMCSSDeclaration.h"
 #include "nsStringFwd.h"
 
 class nsCSSValue;
 class nsIDocument;
--- a/layout/style/ServoCSSRuleList.cpp
+++ b/layout/style/ServoCSSRuleList.cpp
@@ -17,16 +17,17 @@
 #include "mozilla/dom/CSSMozDocumentRule.h"
 #include "mozilla/dom/CSSNamespaceRule.h"
 #include "mozilla/dom/CSSPageRule.h"
 #include "mozilla/dom/CSSStyleRule.h"
 #include "mozilla/dom/CSSSupportsRule.h"
 #include "mozilla/IntegerRange.h"
 #include "mozilla/ServoBindings.h"
 #include "mozilla/StyleSheet.h"
+#include "nsIDocument.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 
 ServoCSSRuleList::ServoCSSRuleList(already_AddRefed<ServoCssRules> aRawRules,
                                    StyleSheet* aSheet,
                                    css::GroupRule* aParentRule)
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/ServoStyleSetInlines.h"
 
 #include "gfxPlatformFontList.h"
 #include "mozilla/AutoRestyleTimelineMarker.h"
 #include "mozilla/DocumentStyleRootIterator.h"
+#include "mozilla/EffectCompositor.h"
 #include "mozilla/IntegerRange.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/ServoBindings.h"
 #include "mozilla/RestyleManager.h"
 #include "mozilla/ServoStyleRuleMap.h"
 #include "mozilla/ServoTypes.h"
 #include "mozilla/StyleAnimationValue.h"
 #include "mozilla/css/Loader.h"
--- a/layout/style/nsDOMCSSValueList.cpp
+++ b/layout/style/nsDOMCSSValueList.cpp
@@ -3,16 +3,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/. */
 
 /* DOM object representing lists of values in DOM computed style */
 
 #include "nsDOMCSSValueList.h"
 #include "nsString.h"
+#include "mozilla/ErrorResult.h"
 #include "mozilla/Move.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsDOMCSSValueList::nsDOMCSSValueList(bool aCommaDelimited)
   : CSSValue()
   , mCommaDelimited(aCommaDelimited)
--- a/layout/svg/SVGFELeafFrame.cpp
+++ b/layout/svg/SVGFELeafFrame.cpp
@@ -1,21 +1,24 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
 // Keep in (case-insensitive) order:
+#include "ComputedStyle.h"
 #include "nsContainerFrame.h"
 #include "nsFrame.h"
 #include "nsGkAtoms.h"
 #include "SVGObserverUtils.h"
 #include "nsSVGFilters.h"
 
+using namespace mozilla;
+
 /*
  * This frame is used by filter primitive elements that don't
  * have special child elements that provide parameters.
  */
 class SVGFELeafFrame final : public nsFrame
 {
   friend nsIFrame*
   NS_NewSVGFELeafFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
--- a/layout/svg/SVGFEUnstyledLeafFrame.cpp
+++ b/layout/svg/SVGFEUnstyledLeafFrame.cpp
@@ -6,16 +6,18 @@
 
 // Keep in (case-insensitive) order:
 #include "nsContainerFrame.h"
 #include "nsFrame.h"
 #include "nsGkAtoms.h"
 #include "SVGObserverUtils.h"
 #include "nsSVGFilters.h"
 
+using namespace mozilla;
+
 class SVGFEUnstyledLeafFrame final : public nsFrame
 {
   friend nsIFrame*
   NS_NewSVGFEUnstyledLeafFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
 protected:
   explicit SVGFEUnstyledLeafFrame(ComputedStyle* aStyle)
     : nsFrame(aStyle, kClassID)
   {
--- a/layout/svg/SVGObserverUtils.cpp
+++ b/layout/svg/SVGObserverUtils.cpp
@@ -8,27 +8,29 @@
 #include "SVGObserverUtils.h"
 
 // Keep others in (case-insensitive) order:
 #include "mozilla/dom/CanvasRenderingContext2D.h"
 #include "mozilla/RestyleManager.h"
 #include "nsCSSFrameConstructor.h"
 #include "nsISupportsImpl.h"
 #include "nsSVGClipPathFrame.h"
+#include "nsSVGMarkerFrame.h"
 #include "nsSVGPaintServerFrame.h"
 #include "nsSVGFilterFrame.h"
 #include "nsSVGMaskFrame.h"
 #include "nsIReflowCallback.h"
 #include "nsCycleCollectionParticipant.h"
 #include "SVGGeometryElement.h"
 #include "SVGTextPathElement.h"
 #include "SVGUseElement.h"
 #include "ImageLoader.h"
 #include "mozilla/net/ReferrerPolicy.h"
 
+using namespace mozilla;
 using namespace mozilla::dom;
 
 static already_AddRefed<URLAndReferrerInfo>
 ResolveURLUsingLocalRef(nsIFrame* aFrame, const css::URLValue* aURL)
 {
   MOZ_ASSERT(aFrame);
 
   if (!aURL) {
--- a/layout/svg/SVGViewFrame.cpp
+++ b/layout/svg/SVGViewFrame.cpp
@@ -6,16 +6,17 @@
 
 // Keep in (case-insensitive) order:
 #include "nsFrame.h"
 #include "nsGkAtoms.h"
 #include "nsSVGOuterSVGFrame.h"
 #include "mozilla/dom/SVGSVGElement.h"
 #include "mozilla/dom/SVGViewElement.h"
 
+using namespace mozilla;
 using namespace mozilla::dom;
 
 /**
  * While views are not directly rendered in SVG they can be linked to
  * and thereby override attributes of an <svg> element via a fragment
  * identifier. The SVGViewFrame class passes on any attribute changes
  * the view receives to the overridden <svg> element (if there is one).
  **/
--- a/layout/svg/nsCSSClipPathInstance.h
+++ b/layout/svg/nsCSSClipPathInstance.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 __NS_CSSCLIPPATHINSTANCE_H__
 #define __NS_CSSCLIPPATHINSTANCE_H__
 
+#include "gfxPoint.h"
 #include "nsStyleStruct.h"
 #include "nsRect.h"
 #include "mozilla/gfx/2D.h"
 
 class nsIFrame;
 class gfxContext;
 
 namespace mozilla {
--- a/layout/svg/nsSVGGFrame.cpp
+++ b/layout/svg/nsSVGGFrame.cpp
@@ -10,16 +10,17 @@
 // Keep others in (case-insensitive) order:
 #include "nsGkAtoms.h"
 #include "SVGTransformableElement.h"
 #include "nsIFrame.h"
 #include "SVGGraphicsElement.h"
 #include "nsSVGIntegrationUtils.h"
 #include "nsSVGUtils.h"
 
+using namespace mozilla;
 using namespace mozilla::dom;
 
 //----------------------------------------------------------------------
 // Implementation
 
 nsIFrame*
 NS_NewSVGGFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle)
 {
--- a/layout/svg/nsSVGGenericContainerFrame.cpp
+++ b/layout/svg/nsSVGGenericContainerFrame.cpp
@@ -3,16 +3,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/. */
 
 // Main header first:
 #include "nsSVGGenericContainerFrame.h"
 #include "nsSVGIntegrationUtils.h"
 
+using namespace mozilla;
+
 //----------------------------------------------------------------------
 // nsSVGGenericContainerFrame Implementation
 
 nsIFrame*
 NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle)
 {
   return new (aPresShell) nsSVGGenericContainerFrame(aStyle);
 }
--- a/layout/svg/nsSVGInnerSVGFrame.cpp
+++ b/layout/svg/nsSVGInnerSVGFrame.cpp
@@ -2,16 +2,18 @@
 /* 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/. */
 
 // Main header first:
 #include "nsSVGInnerSVGFrame.h"
 
+using namespace mozilla;
+
 nsIFrame*
 NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle)
 {
   return new (aPresShell) nsSVGInnerSVGFrame(aStyle);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsSVGInnerSVGFrame)
 
--- a/layout/svg/nsSVGMarkerFrame.cpp
+++ b/layout/svg/nsSVGMarkerFrame.cpp
@@ -9,16 +9,17 @@
 
 // Keep others in (case-insensitive) order:
 #include "gfxContext.h"
 #include "SVGObserverUtils.h"
 #include "mozilla/dom/SVGMarkerElement.h"
 #include "SVGGeometryElement.h"
 #include "SVGGeometryFrame.h"
 
+using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::gfx;
 using namespace mozilla::image;
 
 nsContainerFrame*
 NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle)
 {
   return new (aPresShell) nsSVGMarkerFrame(aStyle);
--- a/layout/svg/nsSVGOuterSVGFrame.cpp
+++ b/layout/svg/nsSVGOuterSVGFrame.cpp
@@ -17,16 +17,17 @@
 #include "nsSVGForeignObjectFrame.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/SVGSVGElement.h"
 #include "mozilla/dom/SVGViewElement.h"
 #include "nsSubDocumentFrame.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
+using namespace mozilla::gfx;
 using namespace mozilla::image;
 
 //----------------------------------------------------------------------
 // Implementation helpers
 
 void
 nsSVGOuterSVGFrame::RegisterForeignObject(nsSVGForeignObjectFrame* aFrame)
 {
--- a/layout/svg/nsSVGStopFrame.cpp
+++ b/layout/svg/nsSVGStopFrame.cpp
@@ -6,16 +6,18 @@
 
 // Keep in (case-insensitive) order:
 #include "nsContainerFrame.h"
 #include "nsFrame.h"
 #include "nsGkAtoms.h"
 #include "mozilla/ComputedStyle.h"
 #include "SVGObserverUtils.h"
 
+using namespace mozilla;
+
 // This is a very simple frame whose only purpose is to capture style change
 // events and propagate them to the parent.  Most of the heavy lifting is done
 // within the nsSVGGradientFrame, which is the parent for this frame
 
 class nsSVGStopFrame : public nsFrame
 {
   friend nsIFrame*
   NS_NewSVGStopFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
--- a/layout/svg/nsSVGSwitchFrame.cpp
+++ b/layout/svg/nsSVGSwitchFrame.cpp
@@ -6,16 +6,17 @@
 
 // Keep in (case-insensitive) order:
 #include "gfxRect.h"
 #include "SVGObserverUtils.h"
 #include "nsSVGGFrame.h"
 #include "mozilla/dom/SVGSwitchElement.h"
 #include "nsSVGUtils.h"
 
+using namespace mozilla;
 using namespace mozilla::gfx;
 using namespace mozilla::image;
 
 class nsSVGSwitchFrame final : public nsSVGGFrame
 {
   friend nsIFrame*
   NS_NewSVGSwitchFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
 protected:
--- a/layout/svg/nsSVGSymbolFrame.cpp
+++ b/layout/svg/nsSVGSymbolFrame.cpp
@@ -2,16 +2,18 @@
 /* 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/. */
 
 // Main header first:
 #include "nsSVGSymbolFrame.h"
 
+using namespace mozilla;
+
 nsIFrame*
 NS_NewSVGSymbolFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle)
 {
   return new (aPresShell) nsSVGSymbolFrame(aStyle);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsSVGSymbolFrame)
 
--- a/layout/tables/FixedTableLayoutStrategy.cpp
+++ b/layout/tables/FixedTableLayoutStrategy.cpp
@@ -5,21 +5,25 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Algorithms that determine column and table inline sizes used for
  * CSS2's 'table-layout: fixed'.
  */
 
 #include "FixedTableLayoutStrategy.h"
+#include "nsStyleConsts.h"
 #include "nsTableFrame.h"
 #include "nsTableColFrame.h"
 #include "nsTableCellFrame.h"
+#include "WritingModes.h"
 #include <algorithm>
 
+using namespace mozilla;
+
 FixedTableLayoutStrategy::FixedTableLayoutStrategy(nsTableFrame *aTableFrame)
   : nsITableLayoutStrategy(nsITableLayoutStrategy::Fixed)
   , mTableFrame(aTableFrame)
 {
   MarkIntrinsicISizesDirty();
 }
 
 /* virtual */
--- a/layout/tables/SpanningCellSorter.cpp
+++ b/layout/tables/SpanningCellSorter.cpp
@@ -8,16 +8,18 @@
  * Code to sort cells by their colspan, used by BasicTableLayoutStrategy.
  */
 
 #include "SpanningCellSorter.h"
 #include "nsQuickSort.h"
 #include "nsIPresShell.h"
 #include "mozilla/HashFunctions.h"
 
+using namespace mozilla;
+
 //#define DEBUG_SPANNING_CELL_SORTER
 
 SpanningCellSorter::SpanningCellSorter()
   : mState(ADDING)
   , mHashTable(&HashTableOps, sizeof(HashTableEntry))
   , mSortedHashTable(nullptr)
 {
     memset(mArray, 0, sizeof(mArray));
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -1,22 +1,25 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 sw=2 et 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/. */
 
+#include "nsTableFrame.h"
+
+#include "mozilla/gfx/2D.h"
+#include "mozilla/gfx/Helpers.h"
 #include "mozilla/Likely.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/IntegerRange.h"
 #include "mozilla/WritingModes.h"
 
 #include "gfxContext.h"
 #include "nsCOMPtr.h"
-#include "nsTableFrame.h"
 #include "mozilla/ComputedStyle.h"
 #include "nsStyleConsts.h"
 #include "nsIContent.h"
 #include "nsCellMap.h"
 #include "nsTableCellFrame.h"
 #include "nsHTMLParts.h"
 #include "nsTableColFrame.h"
 #include "nsTableColGroupFrame.h"
@@ -49,16 +52,21 @@
 #include "gfxPrefs.h"
 #include "mozilla/layers/StackingContextHelper.h"
 #include "mozilla/layers/WebRenderLayerManager.h"
 
 using namespace mozilla;
 using namespace mozilla::image;
 using namespace mozilla::layout;
 
+using mozilla::gfx::AutoRestoreTransform;
+using mozilla::gfx::DrawTarget;
+using mozilla::gfx::Float;
+using mozilla::gfx::ToDeviceColor;
+
 /********************************************************************************
  ** TableReflowInput                                                         **
  ********************************************************************************/
 
 namespace mozilla {
 
 struct TableReflowInput {
 
--- a/layout/xul/grid/nsGridRowGroupFrame.cpp
+++ b/layout/xul/grid/nsGridRowGroupFrame.cpp
@@ -12,16 +12,18 @@
 //
 
 #include "nsGridRowGroupFrame.h"
 #include "nsGridRowLeafLayout.h"
 #include "nsGridRow.h"
 #include "nsBoxLayoutState.h"
 #include "nsGridLayout2.h"
 
+using namespace mozilla;
+
 already_AddRefed<nsBoxLayout> NS_NewGridRowGroupLayout();
 
 nsIFrame*
 NS_NewGridRowGroupFrame(nsIPresShell* aPresShell,
                         ComputedStyle* aStyle)
 {
   nsCOMPtr<nsBoxLayout> layout = NS_NewGridRowGroupLayout();
   return new (aPresShell) nsGridRowGroupFrame(aStyle, layout);
--- a/layout/xul/grid/nsGridRowLeafFrame.cpp
+++ b/layout/xul/grid/nsGridRowLeafFrame.cpp
@@ -12,16 +12,18 @@
 //
 
 #include "nsGridRowLeafFrame.h"
 #include "nsGridRowLeafLayout.h"
 #include "nsGridRow.h"
 #include "nsBoxLayoutState.h"
 #include "nsGridLayout2.h"
 
+using namespace mozilla;
+
 already_AddRefed<nsBoxLayout> NS_NewGridRowLeafLayout();
 
 nsIFrame*
 NS_NewGridRowLeafFrame(nsIPresShell* aPresShell,
                        ComputedStyle* aStyle)
 {
   nsCOMPtr<nsBoxLayout> layout = NS_NewGridRowLeafLayout();
   return new (aPresShell) nsGridRowLeafFrame(aStyle, false, layout);
--- a/layout/xul/nsButtonBoxFrame.cpp
+++ b/layout/xul/nsButtonBoxFrame.cpp
@@ -17,17 +17,17 @@
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/MouseEventBinding.h"
 #include "mozilla/EventStateManager.h"
 #include "mozilla/EventStates.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/TextEvents.h"
 
 using namespace mozilla;
-
+using namespace mozilla::dom;
 
 NS_IMPL_ISUPPORTS(nsButtonBoxFrame::nsButtonBoxListener, nsIDOMEventListener)
 
 nsresult
 nsButtonBoxFrame::nsButtonBoxListener::HandleEvent(dom::Event* aEvent)
 {
   if (!mButtonBoxFrame) {
     return NS_OK;
--- a/layout/xul/nsDeckFrame.cpp
+++ b/layout/xul/nsDeckFrame.cpp
@@ -28,16 +28,18 @@
 #include "nsContainerFrame.h"
 #include "nsContentUtils.h"
 #include "nsXULPopupManager.h"
 
 #ifdef ACCESSIBILITY
 #include "nsAccessibilityService.h"
 #endif
 
+using namespace mozilla;
+
 nsIFrame*
 NS_NewDeckFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle)
 {
   return new (aPresShell) nsDeckFrame(aStyle);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsDeckFrame)
 
--- a/layout/xul/nsDocElementBoxFrame.cpp
+++ b/layout/xul/nsDocElementBoxFrame.cpp
@@ -18,16 +18,17 @@
 #include "nsIServiceManager.h"
 #include "nsNodeInfoManager.h"
 #include "nsContentCreatorFunctions.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/FromParser.h"
 
 //#define DEBUG_REFLOW
 
+using namespace mozilla;
 using namespace mozilla::dom;
 
 class nsDocElementBoxFrame final : public nsBoxFrame
                                  , public nsIAnonymousContentCreator
 {
 public:
   virtual void DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData) override;
 
--- a/layout/xul/nsMenuBarListener.h
+++ b/layout/xul/nsMenuBarListener.h
@@ -3,16 +3,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 nsMenuBarListener_h
 #define nsMenuBarListener_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/EventForwards.h"
+#include "nsIContent.h"
 #include "nsIDOMEventListener.h"
 
 // X.h defines KeyPress
 #ifdef KeyPress
 #undef KeyPress
 #endif
 
 class nsMenuFrame;
--- a/layout/xul/nsMenuPopupFrame.h
+++ b/layout/xul/nsMenuPopupFrame.h
@@ -9,16 +9,17 @@
 //
 
 #ifndef nsMenuPopupFrame_h__
 #define nsMenuPopupFrame_h__
 
 #include "mozilla/Attributes.h"
 #include "mozilla/gfx/Types.h"
 #include "nsAtom.h"
+#include "nsIDOMXULSelectCntrlEl.h"
 #include "nsGkAtoms.h"
 #include "nsCOMPtr.h"
 #include "nsMenuFrame.h"
 
 #include "nsBoxFrame.h"
 #include "nsMenuParent.h"
 
 #include "nsITimer.h"
--- a/layout/xul/nsResizerFrame.h
+++ b/layout/xul/nsResizerFrame.h
@@ -10,16 +10,19 @@
 #include "mozilla/EventForwards.h"
 #include "nsTitleBarFrame.h"
 
 class nsIBaseWindow;
 
 class nsResizerFrame final : public nsTitleBarFrame
 {
 protected:
+  typedef mozilla::LayoutDeviceIntPoint LayoutDeviceIntPoint;
+  typedef mozilla::LayoutDeviceIntRect LayoutDeviceIntRect;
+
   struct Direction {
     int8_t mHorizontal;
     int8_t mVertical;
   };
 
 public:
   NS_DECL_FRAMEARENA_HELPERS(nsResizerFrame)
 
--- a/layout/xul/nsSplitterFrame.cpp
+++ b/layout/xul/nsSplitterFrame.cpp
@@ -35,16 +35,18 @@
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/MouseEvent.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/UniquePtr.h"
 #include "nsBindingManager.h"
 
 using namespace mozilla;
 
+using mozilla::dom::Event;
+
 class nsSplitterInfo {
 public:
   nscoord min;
   nscoord max;
   nscoord current;
   nscoord changed;
   nsCOMPtr<nsIContent> childElem;
   int32_t flex;
--- a/layout/xul/tree/nsTreeColFrame.cpp
+++ b/layout/xul/tree/nsTreeColFrame.cpp
@@ -13,16 +13,18 @@
 #include "nsIBoxObject.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/dom/TreeBoxObject.h"
 #include "nsTreeColumns.h"
 #include "nsDisplayList.h"
 #include "nsTreeBodyFrame.h"
 #include "nsXULElement.h"
 
+using namespace mozilla;
+
 //
 // NS_NewTreeColFrame
 //
 // Creates a new col frame
 //
 nsIFrame*
 NS_NewTreeColFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle)
 {
--- a/layout/xul/tree/nsTreeColFrame.h
+++ b/layout/xul/tree/nsTreeColFrame.h
@@ -1,21 +1,22 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
 #include "mozilla/Attributes.h"
+#include "mozilla/ComputedStyle.h"
 #include "nsBoxFrame.h"
 
 class nsITreeBoxObject;
 
 nsIFrame* NS_NewTreeColFrame(nsIPresShell* aPresShell,
-                             ComputedStyle* aStyle);
+                             mozilla::ComputedStyle* aStyle);
 
 class nsTreeColFrame final : public nsBoxFrame
 {
 public:
   NS_DECL_FRAMEARENA_HELPERS(nsTreeColFrame)
 
   explicit nsTreeColFrame(ComputedStyle* aStyle):
     nsBoxFrame(aStyle, kClassID) {}
--- a/layout/xul/tree/nsTreeColumns.cpp
+++ b/layout/xul/tree/nsTreeColumns.cpp
@@ -13,16 +13,17 @@
 #include "nsContentUtils.h"
 #include "nsTreeBodyFrame.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/TreeBoxObject.h"
 #include "mozilla/dom/TreeColumnBinding.h"
 #include "mozilla/dom/TreeColumnsBinding.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 // Column class that caches all the info about our column.
 nsTreeColumn::nsTreeColumn(nsTreeColumns* aColumns, dom::Element* aElement)
   : mContent(aElement),
     mColumns(aColumns),
     mIndex(0),
     mPrevious(nullptr)
 {
--- a/layout/xul/tree/nsTreeContentView.cpp
+++ b/layout/xul/tree/nsTreeContentView.cpp
@@ -11,21 +11,23 @@
 #include "nsTreeContentView.h"
 #include "ChildIterator.h"
 #include "nsError.h"
 #include "nsXULSortService.h"
 #include "nsTreeBodyFrame.h"
 #include "nsTreeColumns.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/dom/Element.h"
+#include "mozilla/dom/TreeBoxObject.h"
 #include "mozilla/dom/TreeContentViewBinding.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIDocument.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 // A content model view implementation for the tree.
 
 #define ROW_FLAG_CONTAINER      0x01
 #define ROW_FLAG_OPEN           0x02
 #define ROW_FLAG_EMPTY          0x04
 #define ROW_FLAG_SEPARATOR      0x08
 
--- a/layout/xul/tree/nsTreeStyleCache.h
+++ b/layout/xul/tree/nsTreeStyleCache.h
@@ -6,19 +6,22 @@
 
 #ifndef nsTreeStyleCache_h__
 #define nsTreeStyleCache_h__
 
 #include "mozilla/AtomArray.h"
 #include "mozilla/Attributes.h"
 #include "nsAutoPtr.h"
 #include "nsCOMArray.h"
+#include "nsDataHashtable.h"
 #include "nsRefPtrHashtable.h"
 #include "mozilla/ComputedStyle.h"
 
+class nsIContent;
+
 class nsTreeStyleCache
 {
 public:
   nsTreeStyleCache()
     : mNextState(0)
   {
   }