Bug 1534471 - Reformat a couple of layout/style/ files. r=emilio
authorCameron McCormack <cam@mcc.id.au>
Tue, 12 Mar 2019 00:14:00 +0000
changeset 521459 d6006ca603db8fbf3fa5e9aa8bc0063ce8097e5f
parent 521458 ec39fd695adb0548e5c689d839843fa2e9b3acbd
child 521460 4b280518c7b1798e846ef99af00ba60867dac20c
push id10866
push usernerli@mozilla.com
push dateTue, 12 Mar 2019 18:59:09 +0000
treeherdermozilla-beta@445c24a51727 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1534471
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 1534471 - Reformat a couple of layout/style/ files. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D23059
layout/style/PreferenceSheet.cpp
layout/style/PseudoStyleType.h
layout/style/StreamLoader.cpp
layout/style/nsFontFaceLoader.cpp
layout/style/nsMediaFeatures.cpp
layout/style/nsStyleCoord.h
--- a/layout/style/PreferenceSheet.cpp
+++ b/layout/style/PreferenceSheet.cpp
@@ -31,17 +31,17 @@ static void GetColor(const char* aPrefNa
   if (!ServoCSSParser::ComputeColor(nullptr, NS_RGB(0, 0, 0), value, &result)) {
     return;
   }
   aColor = result;
 }
 
 bool PreferenceSheet::ShouldUseChromePrefs(const Document& aDoc) {
   return aDoc.IsInChromeDocShell() ||
-    (aDoc.IsBeingUsedAsImage() && aDoc.IsDocumentURISchemeChrome());
+         (aDoc.IsBeingUsedAsImage() && aDoc.IsDocumentURISchemeChrome());
 }
 
 static bool UseAccessibilityTheme(bool aIsChrome) {
   return !aIsChrome &&
          !!LookAndFeel::GetInt(LookAndFeel::eIntID_UseAccessibilityTheme, 0);
 }
 
 void PreferenceSheet::Prefs::Load(bool aIsChrome) {
--- a/layout/style/PseudoStyleType.h
+++ b/layout/style/PseudoStyleType.h
@@ -42,17 +42,16 @@ enum class PseudoStyleType : uint8_t {
 
   // Wrapper anon boxes are inheriting anon boxes.
   WrapperAnonBoxesStart,
 
   // Dummy variant so the next variant also has the same discriminant as
   // WrapperAnonBoxesStart.
   __reset_2 = WrapperAnonBoxesStart - 1,
 
-
 #define CSS_ANON_BOX(_name, _str)
 #define CSS_NON_INHERITING_ANON_BOX(_name, _str)
 #define CSS_WRAPPER_ANON_BOX(_name, _str) _name,
 #include "nsCSSAnonBoxList.h"
 #undef CSS_ANON_BOX
 #undef CSS_WRAPPER_ANON_BOX
 #undef CSS_NON_INHERITING_ANON_BOX
 
@@ -74,38 +73,41 @@ enum class PseudoStyleType : uint8_t {
   XULTree = AnonBoxesEnd,
   NotPseudo,
   MAX
 };
 
 std::ostream& operator<<(std::ostream&, PseudoStyleType);
 
 class PseudoStyle final {
-public:
+ public:
   using Type = PseudoStyleType;
 
   // This must match EAGER_PSEUDO_COUNT in Rust code.
   static const size_t kEagerPseudoCount = 4;
 
   static bool IsPseudoElement(Type aType) {
     return aType < Type::CSSPseudoElementsEnd;
   }
 
   static bool IsAnonBox(Type aType) {
     return aType >= Type::AnonBoxesStart && aType < Type::AnonBoxesEnd;
   }
 
   static bool IsInheritingAnonBox(Type aType) {
-    return aType >= Type::InheritingAnonBoxesStart && aType < Type::InheritingAnonBoxesEnd;
+    return aType >= Type::InheritingAnonBoxesStart &&
+           aType < Type::InheritingAnonBoxesEnd;
   }
 
   static bool IsNonInheritingAnonBox(Type aType) {
-    return aType >= Type::NonInheritingAnonBoxesStart && aType < Type::NonInheritingAnonBoxesEnd;
+    return aType >= Type::NonInheritingAnonBoxesStart &&
+           aType < Type::NonInheritingAnonBoxesEnd;
   }
 
   static bool IsWrapperAnonBox(Type aType) {
-    return aType >= Type::WrapperAnonBoxesStart && aType < Type::WrapperAnonBoxesEnd;
+    return aType >= Type::WrapperAnonBoxesStart &&
+           aType < Type::WrapperAnonBoxesEnd;
   }
 };
 
-}
+}  // namespace mozilla
 
 #endif
--- a/layout/style/StreamLoader.cpp
+++ b/layout/style/StreamLoader.cpp
@@ -42,18 +42,17 @@ StreamLoader::OnStartRequest(nsIRequest*
         return (mStatus = NS_ERROR_OUT_OF_MEMORY);
       }
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
-StreamLoader::OnStopRequest(nsIRequest* aRequest,
-                            nsresult aStatus) {
+StreamLoader::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
   // Decoded data
   nsCString utf8String;
   {
     // Hold the nsStringBuffer for the bytes from the stack to ensure release
     // no matter which return branch is taken.
     nsCString bytes(mBytes);
     mBytes.Truncate();
 
@@ -109,19 +108,18 @@ StreamLoader::OnStopRequest(nsIRequest* 
   // accessing fields of mSheetLoadData from here.
   mSheetLoadData->mLoader->ParseSheet(utf8String, mSheetLoadData,
                                       Loader::AllowAsyncParse::Yes);
   return NS_OK;
 }
 
 /* nsIStreamListener implementation */
 NS_IMETHODIMP
-StreamLoader::OnDataAvailable(nsIRequest*,
-                              nsIInputStream* aInputStream, uint64_t,
-                              uint32_t aCount) {
+StreamLoader::OnDataAvailable(nsIRequest*, nsIInputStream* aInputStream,
+                              uint64_t, uint32_t aCount) {
   if (NS_FAILED(mStatus)) {
     return mStatus;
   }
   uint32_t dummy;
   return aInputStream->ReadSegments(WriteSegmentFun, this, aCount, &dummy);
 }
 
 void StreamLoader::HandleBOM() {
--- a/layout/style/nsFontFaceLoader.cpp
+++ b/layout/style/nsFontFaceLoader.cpp
@@ -305,18 +305,17 @@ nsFontFaceLoader::OnStartRequest(nsIRequ
     nsCOMPtr<nsIEventTarget> sts =
         do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID);
     Unused << NS_WARN_IF(NS_FAILED(req->RetargetDeliveryTo(sts)));
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFontFaceLoader::OnStopRequest(nsIRequest* aRequest,
-                                nsresult aStatusCode) {
+nsFontFaceLoader::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) {
   MOZ_ASSERT(NS_IsMainThread());
   DropChannel();
   return NS_OK;
 }
 
 void nsFontFaceLoader::Cancel() {
   MOZ_DIAGNOSTIC_ASSERT(!mInLoadTimerCallback);
   MOZ_DIAGNOSTIC_ASSERT(!mInStreamComplete);
--- a/layout/style/nsMediaFeatures.cpp
+++ b/layout/style/nsMediaFeatures.cpp
@@ -207,17 +207,18 @@ bool Gecko_MediaFeatures_HasSystemMetric
       nsContentUtils::ShouldResistFingerprinting(aDocument)) {
     return false;
   }
 
   nsMediaFeatures::InitSystemMetrics();
   return sSystemMetrics->IndexOf(aMetric) != sSystemMetrics->NoIndex;
 }
 
-nsAtom* Gecko_MediaFeatures_GetOperatingSystemVersion(const Document* aDocument) {
+nsAtom* Gecko_MediaFeatures_GetOperatingSystemVersion(
+    const Document* aDocument) {
   if (nsContentUtils::ShouldResistFingerprinting(aDocument)) {
     return nullptr;
   }
 
 #ifdef XP_WIN
   int32_t metricResult;
   if (NS_SUCCEEDED(LookAndFeel::GetInt(
           LookAndFeel::eIntID_OperatingSystemVersionIdentifier,
--- a/layout/style/nsStyleCoord.h
+++ b/layout/style/nsStyleCoord.h
@@ -41,19 +41,17 @@ enum LogicalCorner {
 
 using LengthPercentage = StyleLengthPercentage;
 using LengthPercentageOrAuto = StyleLengthPercentageOrAuto;
 using NonNegativeLengthPercentage = StyleNonNegativeLengthPercentage;
 using NonNegativeLengthPercentageOrAuto =
     StyleNonNegativeLengthPercentageOrAuto;
 using BorderRadius = StyleBorderRadius;
 
-bool StyleCSSPixelLength::IsZero() const {
-  return _0 == 0.0f;
-}
+bool StyleCSSPixelLength::IsZero() const { return _0 == 0.0f; }
 
 nscoord StyleCSSPixelLength::ToAppUnits() const {
   // We want to resolve the length part of the calc() expression rounding 0.5
   // away from zero, instead of the default behavior of NSToCoordRoundWithClamp
   // which is floor(x + 0.5).
   //
   // This is what the rust code in the app_units crate does, and not doing this
   // would regress bug 1323735, for example.