From 3c5ec261f56685d1a1b744a1fedb77c5acb6d9bb Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Wed, 26 Apr 2017 15:57:57 +0800 Subject: [PATCH] Bug 1355394 part 2 - Move GetRules function into macro. r=heycam MozReview-Commit-ID: AlQ5os4s26v --HG-- extra : rebase_source : 49d19b5915cb38a1809d54f0aee9a2825f604eef --- layout/style/ServoBindingList.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/layout/style/ServoBindingList.h b/layout/style/ServoBindingList.h index dab9fb60e785..3996054ba055 100644 --- a/layout/style/ServoBindingList.h +++ b/layout/style/ServoBindingList.h @@ -98,10 +98,15 @@ SERVO_BINDING_FUNC(Servo_CssRules_DeleteRule, nsresult, RawServo##type_##RuleBorrowed rule, nsACString* result) \ SERVO_BINDING_FUNC(Servo_##type_##Rule_GetCssText, void, \ RawServo##type_##RuleBorrowed rule, nsAString* result) +#define GROUP_RULE_FUNCS(type_) \ + BASIC_RULE_FUNCS(type_) \ + SERVO_BINDING_FUNC(Servo_##type_##Rule_GetRules, ServoCssRulesStrong, \ + RawServo##type_##RuleBorrowed rule) BASIC_RULE_FUNCS(Style) -BASIC_RULE_FUNCS(Media) +GROUP_RULE_FUNCS(Media) BASIC_RULE_FUNCS(Namespace) BASIC_RULE_FUNCS(Page) +#undef GROUP_RULE_FUNCS #undef BASIC_RULE_FUNCS SERVO_BINDING_FUNC(Servo_CssRules_GetFontFaceRuleAt, nsCSSFontFaceRule*, ServoCssRulesBorrowed rules, uint32_t index) @@ -114,8 +119,6 @@ SERVO_BINDING_FUNC(Servo_StyleRule_GetSelectorText, void, RawServoStyleRuleBorrowed rule, nsAString* result) SERVO_BINDING_FUNC(Servo_MediaRule_GetMedia, RawServoMediaListStrong, RawServoMediaRuleBorrowed rule) -SERVO_BINDING_FUNC(Servo_MediaRule_GetRules, ServoCssRulesStrong, - RawServoMediaRuleBorrowed rule) SERVO_BINDING_FUNC(Servo_NamespaceRule_GetPrefix, nsIAtom*, RawServoNamespaceRuleBorrowed rule) SERVO_BINDING_FUNC(Servo_NamespaceRule_GetURI, nsIAtom*,