Bug 1448763 part 7 - Remove nsCSSCornerSizes. r=emilio
authorXidorn Quan <me@upsuper.org>
Thu, 05 Apr 2018 18:27:33 +1000
changeset 465416 f43518ccb6f90d43b95ddab982543dcd708af8c8
parent 465415 e56285e2657c40d60322b3d4ea7638c3a0308210
child 465417 c44d6b666b2f058948450150178123a9d09a039b
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1448763
milestone61.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 1448763 part 7 - Remove nsCSSCornerSizes. r=emilio MozReview-Commit-ID: jjSjoskIB8
layout/style/nsCSSValue.cpp
layout/style/nsCSSValue.h
--- a/layout/style/nsCSSValue.cpp
+++ b/layout/style/nsCSSValue.cpp
@@ -1678,57 +1678,16 @@ size_t
 css::ImageValue::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t n = aMallocSizeOf(this);
   n += css::URLValueData::SizeOfExcludingThis(aMallocSizeOf);
   n += mRequests.ShallowSizeOfExcludingThis(aMallocSizeOf);
   return n;
 }
 
-// --- nsCSSCornerSizes -----------------
-
-nsCSSCornerSizes::nsCSSCornerSizes(void)
-{
-  MOZ_COUNT_CTOR(nsCSSCornerSizes);
-}
-
-nsCSSCornerSizes::nsCSSCornerSizes(const nsCSSCornerSizes& aCopy)
-  : mTopLeft(aCopy.mTopLeft),
-    mTopRight(aCopy.mTopRight),
-    mBottomRight(aCopy.mBottomRight),
-    mBottomLeft(aCopy.mBottomLeft)
-{
-  MOZ_COUNT_CTOR(nsCSSCornerSizes);
-}
-
-nsCSSCornerSizes::~nsCSSCornerSizes()
-{
-  MOZ_COUNT_DTOR(nsCSSCornerSizes);
-}
-
-void
-nsCSSCornerSizes::Reset()
-{
-  NS_FOR_CSS_FULL_CORNERS(corner) {
-    this->GetCorner(corner).Reset();
-  }
-}
-
-static_assert(eCornerTopLeft == 0 && eCornerTopRight == 1 &&
-              eCornerBottomRight == 2 && eCornerBottomLeft == 3,
-              "box corner constants not tl/tr/br/bl == 0/1/2/3");
-
-/* static */ const nsCSSCornerSizes::corner_type
-nsCSSCornerSizes::corners[4] = {
-  &nsCSSCornerSizes::mTopLeft,
-  &nsCSSCornerSizes::mTopRight,
-  &nsCSSCornerSizes::mBottomRight,
-  &nsCSSCornerSizes::mBottomLeft,
-};
-
 size_t
 mozilla::css::GridTemplateAreasValue::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
   // Only measure it if it's unshared, to avoid double-counting.
   size_t n = 0;
   if (mRefCnt <= 1) {
     n += aMallocSizeOf(this);
     n += mNamedAreas.ShallowSizeOfExcludingThis(aMallocSizeOf);
--- a/layout/style/nsCSSValue.h
+++ b/layout/style/nsCSSValue.h
@@ -1264,59 +1264,10 @@ nsCSSValue::GetPairListValue() const
   if (mUnit == eCSSUnit_PairList)
     return mValue.mPairList;
   else {
     MOZ_ASSERT (mUnit == eCSSUnit_PairListDep, "not a pairlist value");
     return mValue.mPairListDependent;
   }
 }
 
-struct nsCSSCornerSizes {
-  nsCSSCornerSizes(void);
-  nsCSSCornerSizes(const nsCSSCornerSizes& aCopy);
-  ~nsCSSCornerSizes();
-
-  // argument is a "full corner" constant from nsStyleConsts.h
-  nsCSSValue const & GetCorner(uint32_t aCorner) const {
-    return this->*corners[aCorner];
-  }
-  nsCSSValue & GetCorner(uint32_t aCorner) {
-    return this->*corners[aCorner];
-  }
-
-  bool operator==(const nsCSSCornerSizes& aOther) const {
-    NS_FOR_CSS_FULL_CORNERS(corner) {
-      if (this->GetCorner(corner) != aOther.GetCorner(corner))
-        return false;
-    }
-    return true;
-  }
-
-  bool operator!=(const nsCSSCornerSizes& aOther) const {
-    NS_FOR_CSS_FULL_CORNERS(corner) {
-      if (this->GetCorner(corner) != aOther.GetCorner(corner))
-        return true;
-    }
-    return false;
-  }
-
-  bool HasValue() const {
-    NS_FOR_CSS_FULL_CORNERS(corner) {
-      if (this->GetCorner(corner).GetUnit() != eCSSUnit_Null)
-        return true;
-    }
-    return false;
-  }
-
-  void Reset();
-
-  nsCSSValue mTopLeft;
-  nsCSSValue mTopRight;
-  nsCSSValue mBottomRight;
-  nsCSSValue mBottomLeft;
-
-protected:
-  typedef nsCSSValue nsCSSCornerSizes::*corner_type;
-  static const corner_type corners[4];
-};
-
 #endif /* nsCSSValue_h___ */