Пример #1
0
 /**
  * Optimises shorthands
  * @access public
  * @version 1.0
  */
 function shorthands()
 {
     $shorthands =& $GLOBALS['csstidy']['shorthands'];
     if (!$this->parser->get_cfg('optimise_shorthands') || $this->parser->get_cfg('preserve_css')) {
         return;
     }
     if ($this->property == 'background' && $this->parser->get_cfg('optimise_shorthands') > 1) {
         unset($this->css[$this->at][$this->selector]['background']);
         $this->parser->merge_css_blocks($this->at, $this->selector, csstidy_optimise::dissolve_short_bg($this->value));
     }
     if (isset($shorthands[$this->property])) {
         $this->parser->merge_css_blocks($this->at, $this->selector, csstidy_optimise::dissolve_4value_shorthands($this->property, $this->value));
         if (is_array($shorthands[$this->property])) {
             unset($this->css[$this->at][$this->selector][$this->property]);
         }
     }
 }