Open Bug 1022442 Opened 10 years ago Updated 2 years ago

Have rulenodes hold references to data blocks directly, not to StyleRules

Categories

(Core :: CSS Parsing and Computation, defect)

x86
macOS
defect

Tracking

()

People

(Reporter: bzbarsky, Unassigned)

Details

Per discussion with dbaron today, we want to make the following changes, I believe: 1) Rename nsIStyleRule to nsIStyleDataProvider 2) Implement nsIStyleDataProvider on css::Declaration (this will add a vtable pointer to the class, sadly) or some class that rules hold on to and owns css::Declaration, depending on how exactly we want to handle !important bits (e.g. rulenode could pass in a boolean for whether it's looking for !important data or not, instead of just requiring different classes for normal and !important data). 3) Switch rule traversal in CSSRuleProcessor and style set to hook rulenodes up to CSSDeclarations or this new class directly. We may need something here for keyframe and page rules too. 4) Drop the inheritance of css::Rule from nsIStyleDataProvider. 5) Make StyleRule objects mutable and get rid of the machinery that swaps them in and out of their DOM wrapper. 6) Get rid of the extra DOM wrapper around StyleRule. 7) Get rid of the extra class we're going to add in bug 898764. David, did I miss anything?
Flags: needinfo?(dbaron)
(In reply to Boris Zbarsky [:bz] from comment #0) > Per discussion with dbaron today, we want to make the following changes, I > believe: > > 1) Rename nsIStyleRule to nsIStyleDataProvider drop the nsI (and add mozilla::), and maybe also drop the "Provider" (although probably keep it). And I'd also want to rename nsIStyleRuleProcessor to mozilla::StyleDataSource or similar. > 2) Implement nsIStyleDataProvider on css::Declaration (this will add a vtable > pointer to the class, sadly) or some class that rules hold on to and owns > css::Declaration, depending on how exactly we want to handle !important bits > (e.g. rulenode could pass in a boolean for whether it's looking for > !important data or not, instead of just requiring different classes for > normal and !important data). I think we want this to be on nsCSSDataBlock, not Declaration > 3) Switch rule traversal in CSSRuleProcessor and style set to hook rulenodes up > to CSSDeclarations or this new class directly. We may need something here > for keyframe and page rules too. I didn't think too closely about keyframe and page rules, but it should just be a matter of hooking things up. > 4) Drop the inheritance of css::Rule from nsIStyleDataProvider. > 5) Make StyleRule objects mutable and get rid of the machinery that > swaps them in and out of their DOM wrapper. > 6) Get rid of the extra DOM wrapper around StyleRule. > 7) Get rid of the extra class we're going to add in bug 898764. > > David, did I miss anything? I think that sounds about right, though whoever does it will probably find something we missed.
Flags: needinfo?(dbaron)
Summary: Have rulenodes hold references to declarations directly, not to StyleRules → Have rulenodes hold references to data blocks directly, not to StyleRules
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.