MCPcopy Create free account
hub / github.com/dillo-browser/dillo / insert

Method insert

src/css.cc:354–364  ·  view source on GitHub ↗

* \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. */

Source from the content-addressed store, hash-verified

352 * This gives later added rules more weight.
353 */
354void 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.

Callers 4

mainFunction · 0.45
make_panelMethod · 0.45
set_render_layoutMethod · 0.45
addRuleMethod · 0.45

Calls 1

specificityMethod · 0.45

Tested by

no test coverage detected