function CSSRule($rule, &$pipeline) { $this->selector = $rule[0]; $this->body = $rule[1]->copy(); $this->baseurl = $rule[2]; $this->order = $rule[3]; $this->specificity = css_selector_specificity($this->selector); $this->pseudoelement = css_find_pseudoelement($this->selector); }
function CSSRule($selector, $body, $baseurl, $order) { $this->selector = $selector; $this->body =& $body; $this->baseurl = $baseurl; $this->order = $order; $this->specificity = css_selector_specificity($this->selector); $this->pseudoelement = css_find_pseudoelement($this->selector); }
function css_find_pseudoelement($selector) { $selector_type = selector_get_type($selector); switch ($selector_type) { case SELECTOR_PSEUDOELEMENT_BEFORE: case SELECTOR_PSEUDOELEMENT_AFTER: return $selector_type; case SELECTOR_SEQUENCE: foreach ($selector[1] as $subselector) { $pe = css_find_pseudoelement($subselector); if (!is_null($pe)) { return $pe; } } return null; default: return null; } }
function CSSRule($rule, &$pipeline) { $this->selector = $rule[0]; $this->body = $rule[1]; $this->baseurl = $rule[2]; $this->order = $rule[3]; // Pre-parse property values foreach (array_keys($this->body) as $key) { $handler =& get_css_handler($key); if ($handler) { $value = $this->parse_important($key, $this->body[$key]); $pipeline->push_base_url($this->baseurl); $this->body[$key] = $handler->parse($value, $pipeline); $pipeline->pop_base_url(); } } $this->specificity = css_selector_specificity($this->selector); $this->pseudoelement = css_find_pseudoelement($this->selector); }