Backed out changeset 1f1175528301 (bug 1380133)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 20 Jul 2017 15:39:48 +0200
changeset 418589 68de2711a4274b4ff35e56cb29a6dce6a173598f
parent 418588 b7486c8fc6f6fda4abcd859f3447e03a894ae55e
child 418590 d986a76643602972c0024a93f07a88b7fa685ce8
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)
bugs1380133
milestone56.0a1
backs out1f11755283013a8db8c2369fabed2dae9ae9455c
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
Backed out changeset 1f1175528301 (bug 1380133)
layout/style/nsStyleContext.cpp
layout/style/nsStyleContext.h
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -180,23 +180,24 @@ nsStyleContext::MoveTo(nsStyleContext* a
 
   if (styleIfVisited) {
     styleIfVisited->mParent->RemoveChild(styleIfVisited);
     styleIfVisited->mParent = aNewParent;
     styleIfVisited->mParent->AddChild(styleIfVisited);
   }
 }
 
+template<class StyleContextLike>
 nsChangeHint
-nsStyleContext::CalcStyleDifference(nsStyleContext* aNewContext,
-                                    uint32_t* aEqualStructs,
-                                    uint32_t* aSamePointerStructs,
-                                    uint32_t aRelevantStructs)
+nsStyleContext::CalcStyleDifferenceInternal(StyleContextLike* aNewContext,
+                                            uint32_t* aEqualStructs,
+                                            uint32_t* aSamePointerStructs,
+                                            uint32_t aRelevantStructs)
 {
-  AUTO_PROFILER_LABEL("nsStyleContext::CalcStyleDifference", CSS);
+  AUTO_PROFILER_LABEL("nsStyleContext::CalcStyleDifferenceInternal", 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) {
@@ -441,16 +442,28 @@ nsStyleContext::CalcStyleDifference(nsSt
     }
   }
 
   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,16 +282,23 @@ 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.