Bug 1380133 - Part 7: De-templatize CalcStyleDifference(Internal). r=emilio
authorCameron McCormack <cam@mcc.id.au>
Fri, 21 Jul 2017 11:42:44 +0800
changeset 418835 c72f3f8c9c60e299e962c56f429dc8a0058c0c90
parent 418834 f9b6904e3e1071f868efc335d9139e082a31a9f1
child 418836 f2fce7aee9f54eaf048538c9b67020fac08c5b30
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1380133
milestone56.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 1380133 - Part 7: De-templatize CalcStyleDifference(Internal). r=emilio MozReview-Commit-ID: 8c1E1gbwaHz --- layout/style/nsStyleContext.cpp | 23 +++++------------------ layout/style/nsStyleContext.h | 7 ------- 2 files changed, 5 insertions(+), 25 deletions(-)
layout/style/nsStyleContext.cpp
layout/style/nsStyleContext.h
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -180,24 +180,23 @@ nsStyleContext::MoveTo(nsStyleContext* a
 
   if (styleIfVisited) {
     styleIfVisited->mParent->RemoveChild(styleIfVisited);
     styleIfVisited->mParent = aNewParent;
     styleIfVisited->mParent->AddChild(styleIfVisited);
   }
 }
 
-template<class StyleContextLike>
 nsChangeHint
-nsStyleContext::CalcStyleDifferenceInternal(StyleContextLike* aNewContext,
-                                            uint32_t* aEqualStructs,
-                                            uint32_t* aSamePointerStructs,
-                                            uint32_t aRelevantStructs)
+nsStyleContext::CalcStyleDifference(nsStyleContext* aNewContext,
+                                    uint32_t* aEqualStructs,
+                                    uint32_t* aSamePointerStructs,
+                                    uint32_t aRelevantStructs)
 {
-  AUTO_PROFILER_LABEL("nsStyleContext::CalcStyleDifferenceInternal", CSS);
+  AUTO_PROFILER_LABEL("nsStyleContext::CalcStyleDifference", CSS);
 
   static_assert(nsStyleStructID_Length <= 32,
                 "aEqualStructs is not big enough");
 
   MOZ_ASSERT(aRelevantStructs == kAllResolvedStructs || IsServo(),
              "aRelevantStructs must be kAllResolvedStructs for Gecko contexts");
 
   if (aRelevantStructs == kAllResolvedStructs) {
@@ -442,28 +441,16 @@ nsStyleContext::CalcStyleDifferenceInter
     }
   }
 
   MOZ_ASSERT(NS_IsHintSubset(hint, nsChangeHint_AllHints),
              "Added a new hint without bumping AllHints?");
   return hint & ~nsChangeHint_NeutralChange;
 }
 
-nsChangeHint
-nsStyleContext::CalcStyleDifference(nsStyleContext* aNewContext,
-                                    uint32_t* aEqualStructs,
-                                    uint32_t* aSamePointerStructs,
-                                    uint32_t aRelevantStructs)
-{
-  return CalcStyleDifferenceInternal(aNewContext,
-                                     aEqualStructs,
-                                     aSamePointerStructs,
-                                     aRelevantStructs);
-}
-
 namespace mozilla {
 
 void
 GeckoStyleContext::EnsureSameStructsCached(nsStyleContext* aOldContext)
 {
   // NOTE(emilio): We could do better here for stylo, where we only call
   // Style##name_() because we need to run FinishStyle, but otherwise this
   // is only a bitwise or.
--- a/layout/style/nsStyleContext.h
+++ b/layout/style/nsStyleContext.h
@@ -282,23 +282,16 @@ public:
    * structs to be compared.
    */
   nsChangeHint CalcStyleDifference(nsStyleContext* aNewContext,
                                    uint32_t* aEqualStructs,
                                    uint32_t* aSamePointerStructs,
                                    uint32_t aRelevantStructs =
                                      kAllResolvedStructs);
 
-private:
-  template<class StyleContextLike>
-  nsChangeHint CalcStyleDifferenceInternal(StyleContextLike* aNewContext,
-                                           uint32_t* aEqualStructs,
-                                           uint32_t* aSamePointerStructs,
-                                           uint32_t aRelevantStructs);
-
 public:
   /**
    * Get a color that depends on link-visitedness using this and
    * this->GetStyleIfVisited().
    *
    * @param aField A pointer to a member variable in a style struct.
    *               The member variable and its style struct must have
    *               been listed in nsCSSVisitedDependentPropList.h.