Bug 1447476: Inline ResolveServoStyle. r?xidorn draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 20 Mar 2018 23:21:28 +0100
changeset 770326 2b2a684dc75e19ba890f6bd577ad7a68c8d7e5db
parent 770325 5b93c660daa6f27ca67457330c0e2409acbe244e
push id103378
push userbmo:emilio@crisal.io
push dateWed, 21 Mar 2018 00:05:51 +0000
reviewersxidorn
bugs1447476
milestone61.0a1
Bug 1447476: Inline ResolveServoStyle. r?xidorn We already pay a function call for it, no point in paying two. MozReview-Commit-ID: 4odPqnPfrNF
layout/style/ServoStyleSet.cpp
layout/style/ServoStyleSet.h
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -1386,24 +1386,16 @@ ServoStyleSet::ClearCachedStyleData()
 
 void
 ServoStyleSet::CompatibilityModeChanged()
 {
   Servo_StyleSet_CompatModeChanged(mRawSet.get());
   SetStylistStyleSheetsDirty();
 }
 
-already_AddRefed<ServoStyleContext>
-ServoStyleSet::ResolveServoStyle(Element* aElement)
-{
-  RefPtr<ServoStyleContext> result =
-    Servo_ResolveStyle(aElement, mRawSet.get()).Consume();
-  return result.forget();
-}
-
 void
 ServoStyleSet::ClearNonInheritingStyleContexts()
 {
   for (RefPtr<ServoStyleContext>& ptr : mNonInheritingStyleContexts) {
     ptr = nullptr;
   }
 }
 
--- a/layout/style/ServoStyleSet.h
+++ b/layout/style/ServoStyleSet.h
@@ -338,17 +338,20 @@ public:
   void CompatibilityModeChanged();
 
   /**
    * Resolve style for the given element, and return it as a
    * ServoStyleContext.
    *
    * FIXME(emilio): Is there a point in this after bug 1367904?
    */
-  already_AddRefed<ServoStyleContext> ResolveServoStyle(dom::Element* aElement);
+  already_AddRefed<ServoStyleContext> ResolveServoStyle(dom::Element* aElement)
+  {
+    return Servo_ResolveStyle(aElement, mRawSet.get()).Consume();
+  }
 
   bool GetKeyframesForName(nsAtom* aName,
                            const nsTimingFunction& aTimingFunction,
                            nsTArray<Keyframe>& aKeyframes);
 
   nsTArray<ComputedKeyframeValues>
   GetComputedKeyframeValuesFor(const nsTArray<Keyframe>& aKeyframes,
                                dom::Element* aElement,