internal void PushGroup(GroupRule aRule) { mGroupStack.AppendElement(aRule); }
// Parse the {} part of an @media or @-moz-document rule. internal bool ParseGroupRule(GroupRule aRule, RuleAppendFunc aAppendFunc, object aData) { // XXXbz this could use better error reporting throughout the method if (!ExpectSymbol('{', true)) { return false; } // push rule on stack, loop over children PushGroup(aRule); nsCSSSection holdSection = mSection; mSection = nsCSSSection.General; for (;;) { // Get next non-whitespace token if (! GetToken(true)) { { if (!mSuppressErrors) mReporter.ReportUnexpected("PEGroupRuleEOF2"); }; break; } if (mToken.IsSymbol('}')) { // done! UngetToken(); break; } if (nsCSSTokenType.AtKeyword == mToken.mType) { // Parse for nested rules ParseAtRule(aAppendFunc, aData, true); continue; } UngetToken(); ParseRuleSet((rule, _) => AppendRule(rule), this, true); } PopGroup(); if (!ExpectSymbol('}', true)) { mSection = holdSection; return false; } aAppendFunc(aRule, aData); return true; }