Bug 1370501 - stylo: Implement ServoStyleRule::GetSpecificity. r?emilio draft
authorFernando Jimenez Moreno <ferjmoreno@gmail.com>
Mon, 12 Jun 2017 14:54:44 +0200
changeset 592562 d371e48a79ff40557254631b8bdc2c9cd6c10d91
parent 592561 5013b05ad735668d055fee91fdd683fbcd6dab78
child 632861 7ff741614aa3e5cc706fac78fdf951cca49b2cf4
push id63432
push userferjmoreno@gmail.com
push dateMon, 12 Jun 2017 12:55:06 +0000
reviewersemilio
bugs1370501
milestone55.0a1
Bug 1370501 - stylo: Implement ServoStyleRule::GetSpecificity. r?emilio MozReview-Commit-ID: Kxa7Q3Yw4It
layout/style/ServoBindingList.h
layout/style/ServoStyleRule.cpp
--- 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)