From 6b93a5693c49af53575a51c728750c6897e6bb00 Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Thu, 20 Jul 2017 15:39:53 +0200 Subject: [PATCH] Backed out changeset cf561cad85f1 (bug 1380133) --- layout/style/nsStyleContext.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/layout/style/nsStyleContext.cpp b/layout/style/nsStyleContext.cpp index 8400857ad26e..2cd62f8d59b1 100644 --- a/layout/style/nsStyleContext.cpp +++ b/layout/style/nsStyleContext.cpp @@ -459,6 +459,37 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aNewContext, 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 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