Backed out changeset cf561cad85f1 (bug 1380133)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 20 Jul 2017 15:39:53 +0200
changeset 418590 d986a76643602972c0024a93f07a88b7fa685ce8
parent 418589 68de2711a4274b4ff35e56cb29a6dce6a173598f
child 418591 0a99d8945fd9876a90e1619a33ae3637cb8817e4
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 outcf561cad85f14e30b4f073356d9291ff74dd6d99
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 cf561cad85f1 (bug 1380133)
layout/style/nsStyleContext.cpp
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -454,16 +454,47 @@ 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.