Bug 1447476: Inline ResolveServoStyle. r?xidorn
We already pay a function call for it, no point in paying two.
MozReview-Commit-ID: 4odPqnPfrNF
--- 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,