Bug 1380133 - Part 6: Remove FakeStyleContext. r=emilio draft
authorCameron McCormack <cam@mcc.id.au>
Fri, 21 Jul 2017 11:42:44 +0800
changeset 612845 55e3be75bb4325de6431e636ef815bc870bcad94
parent 612844 88576e17cd3867acdf8862dab42fd4b1e73bc755
child 612846 0280187becf0f35bc7c5ceb272babd6e0adbb3ff
push id69614
push userbmo:cam@mcc.id.au
push dateFri, 21 Jul 2017 03:44:21 +0000
reviewersemilio
bugs1380133
milestone56.0a1
Bug 1380133 - Part 6: Remove FakeStyleContext. r=emilio MozReview-Commit-ID: EDPXdzmE37Y --- layout/style/nsStyleContext.cpp | 31 ------------------------------- 1 file changed, 31 deletions(-)
layout/style/nsStyleContext.cpp
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -454,47 +454,16 @@ nsStyleContext::CalcStyleDifference(nsSt
                                     uint32_t aRelevantStructs)
 {
   return CalcStyleDifferenceInternal(aNewContext,
                                      aEqualStructs,
                                      aSamePointerStructs,
                                      aRelevantStructs);
 }
 
-class MOZ_STACK_CLASS FakeStyleContext
-{
-public:
-  explicit FakeStyleContext(const ServoComputedValues* aComputedValues)
-    : mComputedValues(aComputedValues) {}
-
-  nsStyleContext* GetStyleIfVisited() {
-    // Bug 1364484: Figure out what to do here for Stylo visited values.  We can
-    // get the visited computed values:
-    // RefPtr<ServoComputedValues> visitedComputedValues =
-    //   Servo_ComputedValues_GetVisitedStyle(mComputedValues).Consume();
-    // But what's the best way to create the nsStyleContext?
-    return nullptr;
-  }
-
-  #define STYLE_STRUCT(name_, checkdata_cb_)                                  \
-  const nsStyle##name_ * Style##name_() {                                     \
-    return mComputedValues->GetStyle##name_();                                \
-  }                                                                           \
-  const nsStyle##name_ * ThreadsafeStyle##name_() {                           \
-    return mComputedValues->GetStyle##name_();                                \
-  }
-  #include "nsStyleStructList.h"
-  #undef STYLE_STRUCT
-
-  const ServoComputedValues* ComputedValues() { return mComputedValues; }
-
-private:
-  const ServoComputedValues* MOZ_NON_OWNING_REF mComputedValues;
-};
-
 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.