function show(&$viewport)
 {
     $border = $this->getCSSProperty(CSS_BORDER);
     $background = $this->getCSSProperty(CSS_BACKGROUND);
     // Draw border of the box
     /*
     FIXME
         if ($border)
             $border->show($viewport, $this);
     */
     // Render background of the box
     if ($background) {
         $background->show($viewport, $this);
     }
     parent::show($viewport);
     return true;
 }
Example #2
0
 /**
  * Layout current BR element. The reflow routine is somewhat similar to the block box reflow routine.
  * As most CSS properties do not apply to BR elements, and BR element always have parent element,
  * the routine is much simpler.
  *
  * @param GenericContainerBox $parent The document element which should be treated as the parent of current element
  * @param FlowContext $context The flow context containing the additional layout data
  * 
  * @see FlowContext
  * @see GenericContainerBox
  */
 function reflow(&$parent, &$context)
 {
     parent::reflow($parent, $context);
     /**
      * Apply 'clear' property; the current Y coordinate can be modified as a result of 'clear'.
      */
     $y = $this->apply_clear($parent->_current_y, $context);
     /**
      * Move current "box" to parent current coordinates. It is REQUIRED, in spite of the generated 
      * box itself have no dimensions and will never be drawn, as several other routines uses box coordinates.
      */
     $this->put_left($parent->_current_x);
     $this->put_top($y);
     /**
      * If we met a sequence of BR tags (like <BR><BR>), we'll have an only one item in the parent's
      * line box - whitespace; in this case we'll need to additionally offset current y coordinate by the font size,
      * as whitespace alone does not affect the Y-coordinate.
      */
     if ($parent->line_box_empty()) {
         /**
          * There's no elements in the parent line box at all (e.g in the following situation:
          * <div><br/> .. some text here...</div>); thus, as we're initiating
          * a new line, we need to offset current Y coordinate by the font-size value.
          */
         // Note that _current_y should be modified before 'close_line' call, as it checks for
         // left-floating boxes, causing an issues if line bottom will be placed below
         // float while line top is above float bottom margin
         $font = $this->getCSSProperty(CSS_FONT);
         $fs = $font->size;
         $parent->_current_y = min($this->get_bottom(), $parent->_current_y - $font->line_height->apply($fs->getPoints()));
         $parent->close_line($context, true);
     } else {
         /**
          * There's at least 1 non-whitespace element in the parent line box, we do not need to use whitespace 
          * height; the bottom of the line box is defined by the non-whitespace elements. Top of the new line
          * should be equal to that value.
          */
         $parent->close_line($context, true);
     }
     /**
      * We need to explicitly extend the parent's height, to make it contain the generated line,
      * as we don't know if it have any children _after_ this BR box. If we will not do it,
      * the following code will be rendred incorrectly:
      * <div>...some text...<br/></div>
      */
     $parent->extend_height($parent->_current_y);
 }
 function show(&$viewport)
 {
     $border = $this->get_css_property(CSS_BORDER);
     $background = $this->get_css_property(CSS_BACKGROUND);
     // Draw border of the box
     $border->show($viewport, $this);
     // Render background of the box
     $background->show($viewport, $this);
     parent::show($viewport);
     return true;
 }
Example #4
0
 function show(&$driver)
 {
     parent::show($driver);
     $strategy =& new StrategyLinkRenderingNormal();
     $strategy->apply($this, $driver);
 }
 function show(&$viewport)
 {
     if (CSSPseudoLinkTarget::is_external_link($this->pseudo_link_target)) {
         $viewport->add_link($this->get_left(), $this->get_top(), $this->get_width(), $this->get_height(), $this->pseudo_link_target);
     }
     if (CSSPseudoLinkTarget::is_local_link($this->pseudo_link_target)) {
         if (isset($viewport->anchors[substr($this->pseudo_link_target, 1)])) {
             $anchor = $viewport->anchors[substr($this->pseudo_link_target, 1)];
             $viewport->add_local_link($this->get_left(), $this->get_top(), $this->get_width(), $this->get_height(), $anchor);
         }
     }
     // Draw border of the box
     $this->border->show($viewport, $this);
     // Render background of the box
     $this->background->show($viewport, $this);
     parent::show($viewport);
     return true;
 }