Bug 1533870: Preemptively fix unified build bustage in layout/style. r=boris
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 08 Mar 2019 21:48:39 +0000
changeset 524222 b823fe555467c8cfe3bf24bcdcdb06338da160d0
parent 524221 f996bb0f3d232ad13c8d9f87ecbe9baa868ebac2
child 524223 2eb9f506158630ee2a1b71faec9dfe86fdf2a48a
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersboris
bugs1533870
milestone67.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 1533870: Preemptively fix unified build bustage in layout/style. r=boris I wrote this patch by first removing UNIFIED_ from layout/style/moz.build, and then rebuilding, and then addressing build errors one by one. Nearly all of the build errors were for using the "Document" type without a proper namespace, and I've addressed this by sprinkling "using namespace" declarations in the affected .cpp files (and removing a few now-unnecessary dom:: prefixes on types in those files). The only other errors were for WorkletGlobalScope.h which needed an #include to provide the type "DOMHighResTimeStamp", and nsHTMLStyleSheet.h which needed a forward-declaration for the type "mozilla::dom::Document". Differential Revision: https://phabricator.services.mozilla.com/D22767
dom/worklet/WorkletGlobalScope.h
layout/style/ImageLoader.cpp
layout/style/ServoCSSParser.cpp
layout/style/StyleAnimationValue.cpp
layout/style/nsDOMCSSAttrDeclaration.cpp
layout/style/nsDOMCSSDeclaration.cpp
layout/style/nsHTMLStyleSheet.h
--- a/dom/worklet/WorkletGlobalScope.h
+++ b/dom/worklet/WorkletGlobalScope.h
@@ -6,16 +6,17 @@
 
 #ifndef mozilla_dom_WorkletGlobalScope_h
 #define mozilla_dom_WorkletGlobalScope_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/dom/BindingDeclarations.h"
+#include "nsDOMNavigationTiming.h"
 #include "nsIGlobalObject.h"
 #include "nsWrapperCache.h"
 
 #define WORKLET_IID                                  \
   {                                                  \
     0x1b3f62e7, 0xe357, 0x44be, {                    \
       0xbf, 0xe0, 0xdf, 0x85, 0xe6, 0x56, 0x85, 0xac \
     }                                                \
--- a/layout/style/ImageLoader.cpp
+++ b/layout/style/ImageLoader.cpp
@@ -17,16 +17,18 @@
 #include "nsIFrameInlines.h"
 #include "FrameLayerBuilder.h"
 #include "SVGObserverUtils.h"
 #include "imgIContainer.h"
 #include "Image.h"
 #include "GeckoProfiler.h"
 #include "mozilla/layers/WebRenderUserData.h"
 
+using namespace mozilla::dom;
+
 namespace mozilla {
 namespace css {
 
 /* static */
 void ImageLoader::Init() {
   sImages = new nsClassHashtable<nsUint64HashKey, ImageTableEntry>();
 }
 
--- a/layout/style/ServoCSSParser.cpp
+++ b/layout/style/ServoCSSParser.cpp
@@ -8,16 +8,17 @@
 
 #include "ServoCSSParser.h"
 
 #include "mozilla/ServoBindings.h"
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/dom/Document.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 /* static */
 bool ServoCSSParser::IsValidCSSColor(const nsAString& aValue) {
   return Servo_IsValidCSSColor(&aValue);
 }
 
 /* static */
 bool ServoCSSParser::ComputeColor(ServoStyleSet* aStyleSet,
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -28,16 +28,17 @@
 #include "gfxQuaternion.h"
 #include "mozilla/dom/Document.h"
 #include "nsIFrame.h"
 #include "gfx2DGlue.h"
 #include "mozilla/ComputedStyleInlines.h"
 
 using namespace mozilla;
 using namespace mozilla::css;
+using namespace mozilla::dom;
 using namespace mozilla::gfx;
 using nsStyleTransformMatrix::Decompose2DMatrix;
 using nsStyleTransformMatrix::Decompose3DMatrix;
 using nsStyleTransformMatrix::ShearType;
 
 static already_AddRefed<nsCSSValue::Array> AppendFunction(
     nsCSSKeyword aTransformFunction) {
   uint32_t nargs;
--- a/layout/style/nsDOMCSSAttrDeclaration.cpp
+++ b/layout/style/nsDOMCSSAttrDeclaration.cpp
@@ -17,19 +17,20 @@
 #include "mozAutoDocUpdate.h"
 #include "nsIURI.h"
 #include "nsNodeUtils.h"
 #include "nsWrapperCacheInlines.h"
 #include "nsIFrame.h"
 #include "ActiveLayerTracker.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
-nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(
-    dom::Element* aElement, bool aIsSMILOverride)
+nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(Element* aElement,
+                                                           bool aIsSMILOverride)
     : mElement(aElement), mIsSMILOverride(aIsSMILOverride) {
   NS_ASSERTION(aElement, "Inline style for a NULL element?");
 }
 
 nsDOMCSSAttributeDeclaration::~nsDOMCSSAttributeDeclaration() {}
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsDOMCSSAttributeDeclaration, mElement)
 
--- a/layout/style/nsDOMCSSDeclaration.cpp
+++ b/layout/style/nsDOMCSSDeclaration.cpp
@@ -17,23 +17,24 @@
 #include "nsCOMPtr.h"
 #include "mozAutoDocUpdate.h"
 #include "nsIURI.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "nsQueryObject.h"
 #include "mozilla/layers/ScrollLinkedEffectDetector.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 nsDOMCSSDeclaration::~nsDOMCSSDeclaration() = default;
 
 /* virtual */
 JSObject* nsDOMCSSDeclaration::WrapObject(JSContext* aCx,
                                           JS::Handle<JSObject*> aGivenProto) {
-  return dom::CSS2Properties_Binding::Wrap(aCx, this, aGivenProto);
+  return CSS2Properties_Binding::Wrap(aCx, this, aGivenProto);
 }
 
 NS_IMPL_QUERY_INTERFACE(nsDOMCSSDeclaration, nsICSSDeclaration)
 
 nsresult nsDOMCSSDeclaration::GetPropertyValue(const nsCSSPropertyID aPropID,
                                                nsAString& aValue) {
   MOZ_ASSERT(aPropID != eCSSProperty_UNKNOWN,
              "Should never pass eCSSProperty_UNKNOWN around");
--- a/layout/style/nsHTMLStyleSheet.h
+++ b/layout/style/nsHTMLStyleSheet.h
@@ -17,16 +17,21 @@
 #include "nsAtom.h"
 #include "PLDHashTable.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/MemoryReporting.h"
 #include "nsString.h"
 
 class nsMappedAttributes;
 struct RawServoDeclarationBlock;
+namespace mozilla {
+namespace dom {
+class Document;
+}  // namespace dom
+}  // namespace mozilla
 
 class nsHTMLStyleSheet final {
  public:
   explicit nsHTMLStyleSheet(mozilla::dom::Document* aDocument);
 
   void SetOwningDocument(mozilla::dom::Document* aDocument);
 
   NS_INLINE_DECL_REFCOUNTING(nsHTMLStyleSheet)