зеркало из https://github.com/mozilla/pjs.git
Bug 529750 part 1. Don't walk non-CSS UA rules when checking for important UA rules. r=dbaron
This commit is contained in:
Родитель
28880643f0
Коммит
f9c2b88340
|
@ -700,6 +700,10 @@ nsStyleSet::FileRules(nsIStyleRuleProcessor::EnumFunc aCollectorFunc,
|
||||||
// -. transition rules = Transition normal
|
// -. transition rules = Transition normal
|
||||||
// [most important]
|
// [most important]
|
||||||
|
|
||||||
|
// Save off the last rule before we start walking our agent sheets;
|
||||||
|
// this will be either the root or one of the restriction rules.
|
||||||
|
nsRuleNode* lastRestrictionRN = aRuleWalker->CurrentNode();
|
||||||
|
|
||||||
aRuleWalker->SetLevel(eAgentSheet, PR_FALSE, PR_TRUE);
|
aRuleWalker->SetLevel(eAgentSheet, PR_FALSE, PR_TRUE);
|
||||||
if (mRuleProcessors[eAgentSheet])
|
if (mRuleProcessors[eAgentSheet])
|
||||||
(*aCollectorFunc)(mRuleProcessors[eAgentSheet], aData);
|
(*aCollectorFunc)(mRuleProcessors[eAgentSheet], aData);
|
||||||
|
@ -786,14 +790,18 @@ nsStyleSet::FileRules(nsIStyleRuleProcessor::EnumFunc aCollectorFunc,
|
||||||
|
|
||||||
if (haveImportantUARules) {
|
if (haveImportantUARules) {
|
||||||
aRuleWalker->SetLevel(eAgentSheet, PR_TRUE, PR_FALSE);
|
aRuleWalker->SetLevel(eAgentSheet, PR_TRUE, PR_FALSE);
|
||||||
AddImportantRules(lastAgentRN, mRuleTree, aRuleWalker); //agent
|
AddImportantRules(lastAgentRN, lastRestrictionRN, aRuleWalker); //agent
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
else {
|
else {
|
||||||
AssertNoImportantRules(lastAgentRN, mRuleTree);
|
AssertNoImportantRules(lastAgentRN, lastRestrictionRN);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
AssertNoCSSRules(lastRestrictionRN, mRuleTree);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
nsRuleNode *lastImportantRN = aRuleWalker->CurrentNode();
|
nsRuleNode *lastImportantRN = aRuleWalker->CurrentNode();
|
||||||
#endif
|
#endif
|
||||||
|
@ -1022,6 +1030,7 @@ nsStyleSet::ResolvePseudoElementStyle(Element* aParentElement,
|
||||||
if (treeContext.HaveRelevantLink()) {
|
if (treeContext.HaveRelevantLink()) {
|
||||||
treeContext.ResetForVisitedMatching();
|
treeContext.ResetForVisitedMatching();
|
||||||
ruleWalker.Reset();
|
ruleWalker.Reset();
|
||||||
|
WalkRestrictionRule(aType, &ruleWalker);
|
||||||
FileRules(EnumRulesMatching<PseudoElementRuleProcessorData>, &data,
|
FileRules(EnumRulesMatching<PseudoElementRuleProcessorData>, &data,
|
||||||
aParentElement, &ruleWalker);
|
aParentElement, &ruleWalker);
|
||||||
visitedRuleNode = ruleWalker.CurrentNode();
|
visitedRuleNode = ruleWalker.CurrentNode();
|
||||||
|
@ -1081,6 +1090,7 @@ nsStyleSet::ProbePseudoElementStyle(Element* aParentElement,
|
||||||
if (aTreeMatchContext.HaveRelevantLink()) {
|
if (aTreeMatchContext.HaveRelevantLink()) {
|
||||||
aTreeMatchContext.ResetForVisitedMatching();
|
aTreeMatchContext.ResetForVisitedMatching();
|
||||||
ruleWalker.Reset();
|
ruleWalker.Reset();
|
||||||
|
WalkRestrictionRule(aType, &ruleWalker);
|
||||||
FileRules(EnumRulesMatching<PseudoElementRuleProcessorData>, &data,
|
FileRules(EnumRulesMatching<PseudoElementRuleProcessorData>, &data,
|
||||||
aParentElement, &ruleWalker);
|
aParentElement, &ruleWalker);
|
||||||
visitedRuleNode = ruleWalker.CurrentNode();
|
visitedRuleNode = ruleWalker.CurrentNode();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче