diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2011-12-30 21:51:58 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2011-12-30 21:51:58 +0100 |
commit | fe21a59c2c565d827147ac27f3398f2b3c2f22a4 (patch) | |
tree | 40491fe618245b9ccf589c78a50b3364af3e2b47 | |
parent | 7c3b1795f94aacce1c44c3c7c821cefc2fe2b671 (diff) |
try to make CssStyleSheet::apply more readable
-rw-r--r-- | src/css.cc | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -458,13 +458,15 @@ void CssStyleSheet::apply (CssPropertyList *props, int minSpecIndex = -1; for (int i = 0; i < numLists; i++) { - if (ruleList[i] && ruleList[i]->size () > index[i] && - (ruleList[i]->get(index[i])->specificity () < minSpec || - (ruleList[i]->get(index[i])->specificity () == minSpec && - ruleList[i]->get(index[i])->position () < minPos))) { + RuleList *rl = ruleList[i]; - minSpec = ruleList[i]->get(index[i])->specificity (); - minPos = ruleList[i]->get(index[i])->position (); + if (rl && rl->size () > index[i] && + (rl->get(index[i])->specificity () < minSpec || + (rl->get(index[i])->specificity () == minSpec && + rl->get(index[i])->position () < minPos))) { + + minSpec = rl->get(index[i])->specificity (); + minPos = rl->get(index[i])->position (); minSpecIndex = i; } } |