Bug 1220496 - Create PresHint/StyleAttr rule processors in nsStyleSet::Init and make DirtyRuleProcessors private. r=bzbarsky

This commit is contained in:
Cameron McCormack 2015-11-05 18:24:22 +11:00
parent 4b121e2bff
commit fc548e7db1
3 changed files with 7 additions and 12 deletions

View File

@ -2499,11 +2499,6 @@ nsDocument::FillStyleSet(nsStyleSet* aStyleSet)
NS_PRECONDITION(aStyleSet->SheetCount(SheetType::Doc) == 0,
"Style set already has document sheets?");
// We could consider moving this to nsStyleSet::Init, to match its
// handling of the eAnimationSheet and eTransitionSheet levels.
aStyleSet->DirtyRuleProcessors(SheetType::PresHint);
aStyleSet->DirtyRuleProcessors(SheetType::StyleAttr);
int32_t i;
for (i = mStyleSheets.Count() - 1; i >= 0; --i) {
nsIStyleSheet* sheet = mStyleSheets[i];

View File

@ -247,12 +247,12 @@ nsStyleSet::Init(nsPresContext *aPresContext)
// Make an explicit GatherRuleProcessors call for the levels that
// don't have style sheets. The other levels will have their calls
// triggered by DirtyRuleProcessors. (We should probably convert the
// SheetType::PresHint and SheetType::StyleAttr levels to work like
// this as well, and not implement nsIStyleSheet.)
// triggered by DirtyRuleProcessors.
GatherRuleProcessors(SheetType::PresHint);
GatherRuleProcessors(SheetType::SVGAttrAnimation);
GatherRuleProcessors(SheetType::StyleAttr);
GatherRuleProcessors(SheetType::Animation);
GatherRuleProcessors(SheetType::Transition);
GatherRuleProcessors(SheetType::SVGAttrAnimation);
}
nsresult

View File

@ -317,8 +317,6 @@ class nsStyleSet final
nsIStyleSheet *aNewSheet,
nsIStyleSheet *aReferenceSheet);
nsresult DirtyRuleProcessors(mozilla::SheetType aType);
// Enable/Disable entire author style level (Doc, ScopedDoc & PresHint levels)
bool GetAuthorStyleDisabled();
nsresult SetAuthorStyleDisabled(bool aStyleDisabled);
@ -393,13 +391,15 @@ class nsStyleSet final
// to drop any nsCSSSelector pointers it has.
void ClearSelectors();
private:
private:
nsStyleSet(const nsStyleSet& aCopy) = delete;
nsStyleSet& operator=(const nsStyleSet& aCopy) = delete;
// Run mark-and-sweep GC on mRuleTree and mOldRuleTrees, based on mRoots.
void GCRuleTrees();
nsresult DirtyRuleProcessors(mozilla::SheetType aType);
// Update the rule processor list after a change to the style sheet list.
nsresult GatherRuleProcessors(mozilla::SheetType aType);