function fake_box(&$box) { // Create the fake box object push_css_defaults(); $fake = null; $fake_box = new BlockBox($fake); pop_css_defaults(); // 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->padding = $box->padding; // Setup fake box border and background $fake_box->background = $box->background; $fake_box->border = $box->border; return $fake_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; }