function parse_css_properties_property($string, &$code) { $identifier_regexp = CSS::get_identifier_regexp(); if (!preg_match(sprintf('/^\\s*(%s)(.*)/si', $identifier_regexp), $string, $matches)) { $code = null; return ''; } $name = strtolower(trim($matches[1])); $rest = $matches[2]; $code = CSS::name2code($name); return $rest; }
function import_declaration($declaration) { $syntax_property = $declaration->get_property(); $code = CSS::name2code($syntax_property->get_name()); if (is_null($code)) { return null; } $handler = CSS::get_handler($code); $property = new CSSPropertyDeclaration(); $property->set_code($code); $expr = $declaration->get_expr(); $property->set_value($handler->parse($expr->to_string(), $this->get_pipeline(), $expr)); $property->set_important($declaration->get_important()); return $property; }