Bug 1528071 - Move `GetAtomBase`s into classes to avoid unified name conflict. r=heycam
authorDavid Major <dmajor@mozilla.com>
Wed, 06 Mar 2019 04:41:13 +0000
changeset 520480 020e9abe510a885e1ce61db806fc5f65b0568014
parent 520472 0d659b1c6de3bc90ac8cb964717142f49f3f0d8e
child 520481 6a337f6390227e9903c436e125a1d198c0d01781
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1528071
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 1528071 - Move `GetAtomBase`s into classes to avoid unified name conflict. r=heycam Differential Revision: https://phabricator.services.mozilla.com/D22013
layout/style/nsCSSAnonBoxes.cpp
layout/style/nsCSSAnonBoxes.h
layout/style/nsCSSPseudoElements.cpp
layout/style/nsCSSPseudoElements.h
--- a/layout/style/nsCSSAnonBoxes.cpp
+++ b/layout/style/nsCSSAnonBoxes.cpp
@@ -18,17 +18,18 @@ using namespace mozilla;
 /* static */
 bool nsCSSAnonBoxes::IsTreePseudoElement(nsAtom* aPseudo) {
   return StringBeginsWith(nsDependentAtomString(aPseudo),
                           NS_LITERAL_STRING(":-moz-tree-"));
 }
 #endif
 
 #ifdef DEBUG
-static nsStaticAtom* GetAtomBase() {
+/* static */
+nsStaticAtom* nsCSSAnonBoxes::GetAtomBase() {
   return const_cast<nsStaticAtom*>(
       nsGkAtoms::GetAtomByIndex(kAtomIndex_AnonBoxes));
 }
 
 /* static */
 void nsCSSAnonBoxes::AssertAtoms() {
   nsStaticAtom* base = GetAtomBase();
   size_t index = 0;
--- a/layout/style/nsCSSAnonBoxes.h
+++ b/layout/style/nsCSSAnonBoxes.h
@@ -42,16 +42,17 @@ class nsCSSAnonBoxes {
     MOZ_ASSERT(PseudoStyle::IsNonInheritingAnonBox(aType));
     static_assert(sizeof(PseudoStyleType) == sizeof(uint8_t), "");
     return static_cast<NonInheriting>(
         static_cast<uint8_t>(aType) -
         static_cast<uint8_t>(PseudoStyleType::NonInheritingAnonBoxesStart));
   }
 
 #ifdef DEBUG
+  static nsStaticAtom* GetAtomBase();
   static void AssertAtoms();
 #endif
 
 // Alias nsCSSAnonBoxes::foo() to nsGkAtoms::AnonBox_foo.
 #define CSS_ANON_BOX(name_, value_)                       \
   static nsCSSAnonBoxPseudoStaticAtom* name_() {          \
     return const_cast<nsCSSAnonBoxPseudoStaticAtom*>(     \
         static_cast<const nsCSSAnonBoxPseudoStaticAtom*>( \
--- a/layout/style/nsCSSPseudoElements.cpp
+++ b/layout/style/nsCSSPseudoElements.cpp
@@ -19,17 +19,18 @@ using namespace mozilla;
 
 // Flags data for each of the pseudo-elements.
 /* static */ const uint32_t nsCSSPseudoElements::kPseudoElementFlags[] = {
 #define CSS_PSEUDO_ELEMENT(name_, value_, flags_) flags_,
 #include "nsCSSPseudoElementList.h"
 #undef CSS_PSEUDO_ELEMENT
 };
 
-static nsStaticAtom* GetAtomBase() {
+/* static */
+nsStaticAtom* nsCSSPseudoElements::GetAtomBase() {
   return const_cast<nsStaticAtom*>(
       nsGkAtoms::GetAtomByIndex(kAtomIndex_PseudoElements));
 }
 
 bool nsCSSPseudoElements::IsPseudoElement(nsAtom* aAtom) {
   return nsStaticAtomUtils::IsMember(aAtom, GetAtomBase(),
                                      kAtomCount_PseudoElements);
 }
--- a/layout/style/nsCSSPseudoElements.h
+++ b/layout/style/nsCSSPseudoElements.h
@@ -145,12 +145,14 @@ class nsCSSPseudoElements {
     return (kPseudoElementFlags[size_t(aType)] & aFlags) == aFlags;
   }
 
   static bool PseudoElementHasAnyFlag(const Type aType, uint32_t aFlags) {
     MOZ_ASSERT(aType < Type::CSSPseudoElementsEnd);
     return (kPseudoElementFlags[size_t(aType)] & aFlags) != 0;
   }
 
+  static nsStaticAtom* GetAtomBase();
+
   static const uint32_t kPseudoElementFlags[size_t(Type::CSSPseudoElementsEnd)];
 };
 
 #endif /* nsCSSPseudoElements_h___ */