Bug 1380133 - Part 3: Remove nsPresContext argument to ServoStyleContext::ResolveSameStructsAs. r=emilio
☠☠ backed out by 1470d246276f ☠ ☠
authorCameron McCormack <cam@mcc.id.au>
Wed, 19 Jul 2017 14:39:40 +0800
changeset 418559 22dabf04e5603fbd71a14b26d98fe4392cf06be2
parent 418558 6f89b4ceda124e9d10690ceb1a88b7318f2277cb
child 418560 cc720d72d02492f272cccdcda5ca969814120b52
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 3: Remove nsPresContext argument to ServoStyleContext::ResolveSameStructsAs. r=emilio We have it in mPresContext already. MozReview-Commit-ID: G1kKHGFOXTp
layout/base/ServoRestyleManager.cpp
layout/generic/ViewportFrame.cpp
layout/style/ServoStyleContext.h
layout/style/ServoStyleContextInlines.h
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -553,17 +553,17 @@ ServoRestyleManager::ProcessPostTraversa
     MOZ_ASSERT(styleFrame || displayContentsNode);
     RefPtr<ServoStyleContext> currentContext =
       aRestyleState.StyleSet().ResolveServoStyle(aElement, aRestyleBehavior);
     MOZ_ASSERT(oldStyleContext->ComputedValues() != currentContext->ComputedValues());
 
     newContext = currentContext;
     newContext->UpdateWithElementState(aElement);
 
-    newContext->ResolveSameStructsAs(PresContext(), oldStyleContext);
+    newContext->ResolveSameStructsAs(oldStyleContext);
 
     // We want to walk all the continuations here, even the ones with different
     // styles.  In practice, the only reason we get continuations with different
     // styles here is ::first-line (::first-letter never affects element
     // styles).  But in that case, newContext is the right context for the
     // _later_ continuations anyway (the ones not affected by ::first-line), not
     // the earlier ones, so there is no point stopping right at the point when
     // we'd actually be setting the right style context.
--- a/layout/generic/ViewportFrame.cpp
+++ b/layout/generic/ViewportFrame.cpp
@@ -423,17 +423,17 @@ ViewportFrame::UpdateStyle(ServoRestyleS
   nsIAtom* pseudo = oldContext->GetPseudo();
   RefPtr<ServoStyleContext> newContext =
     aRestyleState.StyleSet().ResolveInheritingAnonymousBoxStyle(pseudo, nullptr);
 
   // We're special because we have a null GetContent(), so don't call things
   // like UpdateStyleOfOwnedChildFrame that try to append changes for the
   // content to the change list.  Nor do we computed a changehint, since we have
   // no way to apply it anyway.
-  newContext->ResolveSameStructsAs(PresContext(), oldContext);
+  newContext->ResolveSameStructsAs(oldContext);
 
   MOZ_ASSERT(!GetNextContinuation(), "Viewport has continuations?");
   SetStyleContext(newContext);
 
   UpdateStyleOfOwnedAnonBoxes(aRestyleState);
 }
 
 void
--- a/layout/style/ServoStyleContext.h
+++ b/layout/style/ServoStyleContext.h
@@ -38,18 +38,17 @@ public:
   // Update visited state for a given element, and set the prescontext's
   // body text color if applicable.
   void UpdateWithElementState(dom::Element* aElement);
 
   /**
    * Makes this context match |aOther| in terms of which style structs have
    * been resolved.
    */
-  inline void ResolveSameStructsAs(nsPresContext* aPresContext,
-                                   const ServoStyleContext* aOther);
+  inline void ResolveSameStructsAs(const ServoStyleContext* aOther);
 
 private:
   nsPresContext* mPresContext;
   ServoComputedValues mSource;
 };
 
 } // namespace mozilla
 
--- a/layout/style/ServoStyleContextInlines.h
+++ b/layout/style/ServoStyleContextInlines.h
@@ -10,29 +10,29 @@
 
 #include "nsStyleStruct.h"
 #include "ServoBindings.h"
 #include "mozilla/ServoStyleContext.h"
 
 namespace mozilla {
 
 void
-ServoStyleContext::ResolveSameStructsAs(nsPresContext* aPresContext, const ServoStyleContext* aOther)
+ServoStyleContext::ResolveSameStructsAs(const ServoStyleContext* aOther)
 {
   // Only resolve structs that are not already resolved in this struct.
   uint64_t ourBits = mBits & NS_STYLE_INHERIT_MASK;
   uint64_t otherBits = aOther->mBits & NS_STYLE_INHERIT_MASK;
   uint64_t newBits = otherBits & ~ourBits & NS_STYLE_INHERIT_MASK;
 
 #define STYLE_STRUCT(name_, checkdata_cb)                                           \
   if (nsStyle##name_::kHasFinishStyle && newBits & NS_STYLE_INHERIT_BIT(name_)) {   \
     const nsStyle##name_* data = ComputedValues()->GetStyle##name_();               \
-    const_cast<nsStyle##name_*>(data)->FinishStyle(aPresContext);                   \
+    const_cast<nsStyle##name_*>(data)->FinishStyle(mPresContext);                   \
   }
 #include "nsStyleStructList.h"
 #undef STYLE_STRUCT
 
   mBits |= newBits;
 }
 
 } // namespace mozilla
 
-#endif // mozilla_ContextInlines_h
\ No newline at end of file
+#endif // mozilla_ContextInlines_h