From 3f763b8af98585731a261b4a4b81fb488f8b284a Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Fri, 8 Mar 2019 21:48:39 +0000 Subject: [PATCH] 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 --HG-- extra : moz-landing-system : lando --- dom/worklet/WorkletGlobalScope.h | 1 + layout/style/ImageLoader.cpp | 2 ++ layout/style/ServoCSSParser.cpp | 1 + layout/style/StyleAnimationValue.cpp | 1 + layout/style/nsDOMCSSAttrDeclaration.cpp | 5 +++-- layout/style/nsDOMCSSDeclaration.cpp | 3 ++- layout/style/nsHTMLStyleSheet.h | 5 +++++ 7 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dom/worklet/WorkletGlobalScope.h b/dom/worklet/WorkletGlobalScope.h index 4067db42642d..1e4da6419fab 100644 --- a/dom/worklet/WorkletGlobalScope.h +++ b/dom/worklet/WorkletGlobalScope.h @@ -11,6 +11,7 @@ #include "mozilla/ErrorResult.h" #include "mozilla/TimeStamp.h" #include "mozilla/dom/BindingDeclarations.h" +#include "nsDOMNavigationTiming.h" #include "nsIGlobalObject.h" #include "nsWrapperCache.h" diff --git a/layout/style/ImageLoader.cpp b/layout/style/ImageLoader.cpp index a6b8f58266c2..9981cf6c536a 100644 --- a/layout/style/ImageLoader.cpp +++ b/layout/style/ImageLoader.cpp @@ -22,6 +22,8 @@ #include "GeckoProfiler.h" #include "mozilla/layers/WebRenderUserData.h" +using namespace mozilla::dom; + namespace mozilla { namespace css { diff --git a/layout/style/ServoCSSParser.cpp b/layout/style/ServoCSSParser.cpp index 963aa75f1bb4..062d23e0273b 100644 --- a/layout/style/ServoCSSParser.cpp +++ b/layout/style/ServoCSSParser.cpp @@ -13,6 +13,7 @@ #include "mozilla/dom/Document.h" using namespace mozilla; +using namespace mozilla::dom; /* static */ bool ServoCSSParser::IsValidCSSColor(const nsAString& aValue) { diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp index 369d22795d84..4e1f6b5cd97e 100644 --- a/layout/style/StyleAnimationValue.cpp +++ b/layout/style/StyleAnimationValue.cpp @@ -33,6 +33,7 @@ using namespace mozilla; using namespace mozilla::css; +using namespace mozilla::dom; using namespace mozilla::gfx; using nsStyleTransformMatrix::Decompose2DMatrix; using nsStyleTransformMatrix::Decompose3DMatrix; diff --git a/layout/style/nsDOMCSSAttrDeclaration.cpp b/layout/style/nsDOMCSSAttrDeclaration.cpp index 5a0894657390..8da15e47db47 100644 --- a/layout/style/nsDOMCSSAttrDeclaration.cpp +++ b/layout/style/nsDOMCSSAttrDeclaration.cpp @@ -22,9 +22,10 @@ #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?"); } diff --git a/layout/style/nsDOMCSSDeclaration.cpp b/layout/style/nsDOMCSSDeclaration.cpp index 1a88b0d25144..d56ba46a23f9 100644 --- a/layout/style/nsDOMCSSDeclaration.cpp +++ b/layout/style/nsDOMCSSDeclaration.cpp @@ -22,13 +22,14 @@ #include "mozilla/layers/ScrollLinkedEffectDetector.h" using namespace mozilla; +using namespace mozilla::dom; nsDOMCSSDeclaration::~nsDOMCSSDeclaration() = default; /* virtual */ JSObject* nsDOMCSSDeclaration::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return dom::CSS2Properties_Binding::Wrap(aCx, this, aGivenProto); + return CSS2Properties_Binding::Wrap(aCx, this, aGivenProto); } NS_IMPL_QUERY_INTERFACE(nsDOMCSSDeclaration, nsICSSDeclaration) diff --git a/layout/style/nsHTMLStyleSheet.h b/layout/style/nsHTMLStyleSheet.h index 5b607229c4e1..121f33230f35 100644 --- a/layout/style/nsHTMLStyleSheet.h +++ b/layout/style/nsHTMLStyleSheet.h @@ -22,6 +22,11 @@ class nsMappedAttributes; struct RawServoDeclarationBlock; +namespace mozilla { +namespace dom { +class Document; +} // namespace dom +} // namespace mozilla class nsHTMLStyleSheet final { public: