Assert when we set the quirk style sheet after building rule cascades. (Bug 448281) r+sr=bzbarsky

This commit is contained in:
L. David Baron 2008-08-06 10:42:56 -07:00
parent 6512c51303
commit c155fd6771
2 changed files with 12 additions and 0 deletions

View File

@ -96,6 +96,12 @@ public:
NS_IMETHOD MediumFeaturesChanged(nsPresContext* aPresContext,
PRBool* aRulesChanged);
#ifdef DEBUG
void AssertQuirksChangeOK() {
NS_ASSERTION(!mRuleCascades, "too late to set quirks style sheet");
}
#endif
protected:
RuleCascadeData* GetRuleCascade(nsPresContext* aPresContext);
void RefreshRuleCascade(nsPresContext* aPresContext);

View File

@ -369,6 +369,12 @@ nsStyleSet::EnableQuirkStyleSheet(PRBool aEnable)
}
NS_ASSERTION(mQuirkStyleSheet, "no quirk stylesheet");
if (mQuirkStyleSheet) {
#ifdef DEBUG
if (mRuleProcessors[eAgentSheet]) {
static_cast<nsCSSRuleProcessor*>(static_cast<nsIStyleRuleProcessor*>(
mRuleProcessors[eAgentSheet]))->AssertQuirksChangeOK();
}
#endif
#ifdef DEBUG_dbaron_off // XXX Make this |DEBUG| once it stops firing.
PRBool applicableNow;
mQuirkStyleSheet->GetApplicable(applicableNow);