Closed Bug 811581 Opened 7 years ago Closed 7 years ago

add a base class for all *RuleProcessorData classes

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla19

People

(Reporter: heycam, Assigned: heycam)

Details

Attachments

(1 file)

We can add a common base class to all of the *RuleProcessorData structs.  (The only one that doesn't currently inherit from RuleProcessorData is AnonBoxRuleProcessorData.)  That'll let us pass in something more specific than void* to nsStyleSet::FileRules.
Attached patch patchSplinter Review
Assignee: nobody → cam
Status: NEW → ASSIGNED
Attachment #681322 - Flags: review?(bzbarsky)
Comment on attachment 681322 [details] [diff] [review]
patch

>+++ b/layout/style/nsRuleProcessorData.h
>+struct NS_STACK_CLASS RuleProcessorData {
...
>+    NS_PRECONDITION(aRuleWalker, "Must have rule walker");

This will fail for some of the subclasses (e.g. StateRuleProcessorData and AttributeRuleProcessorData).  This assert needs to be in the subclasses that can actually assert this.

>+struct NS_STACK_CLASS ElementRuleProcessorData :
...
>+    : ElementDependentRuleProcessorData(aPresContext, aElement, aRuleWalker,
>+                                  aTreeMatchContext)

Please fix indent.

>+struct NS_STACK_CLASS PseudoElementRuleProcessorData :
...
>+    : ElementDependentRuleProcessorData(aPresContext, aParentElement, aRuleWalker,
>+                                  aTreeMatchContext),

And here.

r=me with those nits.
Attachment #681322 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/16b8ffa02767
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.