/**
  * Set inherited properties in this style using values in $parent
  *
  * @param StyleParser $parent
  */
 function inherit(StyleParser $parent)
 {
     // Set parent font size
     $this->_parent_font_size = $parent->get_font_size();
     foreach (self::$_inherited as $prop) {
         //inherit the !important property also.
         //if local property is also !important, don't inherit.
         if (isset($parent->_props[$prop]) && (!isset($this->_props[$prop]) || isset($parent->_important_props[$prop]) && !isset($this->_important_props[$prop]))) {
             if (isset($parent->_important_props[$prop])) {
                 $this->_important_props[$prop] = true;
             }
             //see __set and __get, on all assignments clear cache!
             $this->_prop_cache[$prop] = null;
             $this->_props[$prop] = $parent->_props[$prop];
         }
     }
     foreach (array_keys($this->_props) as $prop) {
         if ($this->_props[$prop] === "inherit") {
             if (isset($parent->_important_props[$prop])) {
                 $this->_important_props[$prop] = true;
             }
             //do not assign direct, but
             //implicite assignment through __set, redirect to specialized, get value with __get
             //This is for computing defaults if the parent setting is also missing.
             //Therefore do not directly assign the value without __set
             //set _important_props before that to be able to propagate.
             //see __set and __get, on all assignments clear cache!
             //$this->_prop_cache[$prop] = null;
             //$this->_props[$prop] = $parent->_props[$prop];
             //props_set for more obvious explicite assignment not implemented, because
             //too many implicite uses.
             // $this->props_set($prop, $parent->$prop);
             $this->{$prop} = $parent->{$prop};
         }
     }
     return $this;
 }