* \brief Insert rule with increasing specificity. * * If two rules have the same specificity, the one that was added later * will be added behind the others. * This gives later added rules more weight. */
| 352 | * This gives later added rules more weight. |
| 353 | */ |
| 354 | void CssStyleSheet::RuleList::insert (CssRule *rule) { |
| 355 | increase (); |
| 356 | int i = size () - 1; |
| 357 | |
| 358 | while (i > 0 && rule->specificity () < get (i - 1)->specificity ()) { |
| 359 | *getRef (i) = get (i - 1); |
| 360 | i--; |
| 361 | } |
| 362 | |
| 363 | *getRef (i) = rule; |
| 364 | } |
| 365 | |
| 366 | /** |
| 367 | * \brief Insert a rule into CssStyleSheet. |
no test coverage detected