function parse($value)
 {
     if ($value === 'inherit') {
         return CSS_PROPERTY_INHERIT;
     }
     // Note that we cannot just compare $value with these strings for equality,
     // as 'parse' can be called with composite 'background' value as a parameter,
     // say, 'black url(picture.gif) repeat', instead of just using 'repeat'
     // Also, note that
     // 1) 'repeat-x' value will match 'repeat' term
     // 2) background-image 'url' values may contain these values as substrings
     // to avoid these problems, we'll add spaced to the beginning and to the end of value,
     // and will search for space-padded values, instead of raw substrings
     $value = " " . $value . " ";
     if (strpos($value, ' repeat-x ') !== false) {
         return BR_REPEAT_X;
     }
     if (strpos($value, ' repeat-y ') !== false) {
         return BR_REPEAT_Y;
     }
     if (strpos($value, ' no-repeat ') !== false) {
         return BR_NO_REPEAT;
     }
     if (strpos($value, ' repeat ') !== false) {
         return BR_REPEAT;
     }
     return CSSBackgroundRepeat::default_value();
 }
 function CSSBackground()
 {
     $this->default_value = new Background(CSSBackgroundColor::default_value(), CSSBackgroundImage::default_value(), CSSBackgroundRepeat::default_value(), CSSBackgroundPosition::default_value());
     $this->CSSProperty(false, false);
 }
Exemplo n.º 3
0
 /**
  * Tests if the 'background' CSS property value is the default property value; e.g.
  * all subproperty values are set to defaults.
  * 
  * @return bool Flag indicating if current object have default value
  *
  * @see CSSBackgroundColor::default_value
  * @see BackgroundImage::is_default
  * @see CSSBackgroundRepeat::default_value
  * @see BackgroundPosition::is_default
  */
 function is_default()
 {
     return $this->_color->equals(CSSBackgroundColor::default_value()) && $this->_image->is_default() && $this->_repeat == CSSBackgroundRepeat::default_value() && $this->_position->is_default() && $this->_attachment->is_default();
 }
Exemplo n.º 4
0
 function CSSBackground()
 {
     $this->default_value = new Background(CSSBackgroundColor::default_value(), CSSBackgroundImage::default_value(), CSSBackgroundRepeat::default_value(), CSSBackgroundPosition::default_value(), CSSBackgroundAttachment::default_value());
     $this->CSSPropertyHandler(true, false);
 }