function import_ruleset_body($syntax_ruleset) { $body = new CSSPropertyCollection(); $declarations_obj = $syntax_ruleset->get_declarations(); $declarations = $declarations_obj->get(); foreach ($declarations as $declaration) { $property = $this->import_declaration($declaration); if ($property) { $body->add_property($property); } } return $body; }
function attr_body_link_before(&$root, &$pipeline) { $color = $root->get_attribute('link'); // -1000 means priority modifier; so, any real CSS rule will have more priority than // this fake rule $collection = new CSSPropertyCollection(); $collection->add_property(CSSPropertyDeclaration::create(CSS_COLOR, $color, $pipeline)); $rule = new CSSRule(array(SELECTOR_SEQUENCE, array(array(SELECTOR_TAG, 'a'), array(SELECTOR_PSEUDOCLASS_LINK_LOW_PRIORITY))), $collection, '', -1000); $css =& $pipeline->get_current_css(); $css->add_rule($rule, $pipeline); }