Bug 1370501 - stylo: Implement ServoStyleRule::GetSpecificity. r?emilio
MozReview-Commit-ID: Kxa7Q3Yw4It
--- a/layout/style/ServoBindingList.h
+++ b/layout/style/ServoBindingList.h
@@ -147,16 +147,19 @@ SERVO_BINDING_FUNC(Servo_StyleRule_GetSt
SERVO_BINDING_FUNC(Servo_StyleRule_SetStyle, void,
RawServoStyleRuleBorrowed rule,
RawServoDeclarationBlockBorrowed declarations)
SERVO_BINDING_FUNC(Servo_StyleRule_GetSelectorText, void,
RawServoStyleRuleBorrowed rule, nsAString* result)
SERVO_BINDING_FUNC(Servo_StyleRule_GetSelectorTextAtIndex, void,
RawServoStyleRuleBorrowed rule, uint32_t index,
nsAString* result)
+SERVO_BINDING_FUNC(Servo_StyleRule_GetSpecificityAtIndex, void,
+ RawServoStyleRuleBorrowed rule, uint32_t index,
+ uint64_t* specificity)
SERVO_BINDING_FUNC(Servo_StyleRule_GetSelectorCount, void,
RawServoStyleRuleBorrowed rule, uint32_t* count)
SERVO_BINDING_FUNC(Servo_ImportRule_GetHref, void,
RawServoImportRuleBorrowed rule, nsAString* result)
SERVO_BINDING_FUNC(Servo_ImportRule_GetSheet, const RawServoStyleSheet*,
RawServoImportRuleBorrowed rule)
SERVO_BINDING_FUNC(Servo_Keyframe_GetKeyText, void,
RawServoKeyframeBorrowed keyframe, nsAString* result)
--- a/layout/style/ServoStyleRule.cpp
+++ b/layout/style/ServoStyleRule.cpp
@@ -264,17 +264,17 @@ ServoStyleRule::GetSelectorText(uint32_t
{
Servo_StyleRule_GetSelectorTextAtIndex(mRawRule, aSelectorIndex, &aText);
return NS_OK;
}
nsresult
ServoStyleRule::GetSpecificity(uint32_t aSelectorIndex, uint64_t* aSpecificity)
{
- // TODO Bug 1370501
+ Servo_StyleRule_GetSpecificityAtIndex(mRawRule, aSelectorIndex, aSpecificity);
return NS_OK;
}
nsresult
ServoStyleRule::SelectorMatchesElement(Element* aElement,
uint32_t aSelectorIndex,
const nsAString& aPseudo,
bool* aMatches)