Пример #1
0
 function &create()
 {
     $box =& new NullBox();
     $css_state = new CSSState(CSS::get());
     $css_state->pushState();
     $box->readCSS($css_state);
     return $box;
 }
 function fake_box(&$box)
 {
     // Create the fake box object
     $fake_state = new CSSState(CSS::get());
     $fake_state->pushState();
     $fake = null;
     $fake_box = new BlockBox($fake);
     $fake_box->readCSS($fake_state);
     // Setup fake box size
     $fake_box->put_left($this->left);
     $fake_box->put_width($this->right - $this->left);
     $fake_box->put_top($this->top - $box->baseline);
     $fake_box->put_height($this->top - $this->bottom);
     // Setup padding value
     $fake_box->setCSSProperty(CSS_PADDING, $box->getCSSProperty(CSS_PADDING));
     // Setup fake box border and background
     $fake_box->setCSSProperty(CSS_BACKGROUND, $box->getCSSProperty(CSS_BACKGROUND));
     $fake_box->setCSSProperty(CSS_BORDER, $box->getCSSProperty(CSS_BORDER));
     return $fake_box;
 }