Inline_Frame_Reflower

Reflows inline frames.

Defined (1)

The class is defined in the following location(s).

/lib/dompdf/include/inline_frame_reflower.cls.php  
  1. class Inline_Frame_Reflower extends Frame_Reflower { 
  2.  
  3. function __construct(Frame $frame) { parent::__construct($frame); } 
  4.  
  5. //........................................................................ 
  6.  
  7. function reflow(Block_Frame_Decorator $block = null) { 
  8. $frame = $this->_frame; 
  9.  
  10. // Check if a page break is forced 
  11. $page = $frame->get_root(); 
  12. $page->check_forced_page_break($frame); 
  13.  
  14. if ( $page->is_full() ) 
  15. return; 
  16.  
  17. $style = $frame->get_style(); 
  18.  
  19. // Generated content 
  20. $this->_set_content(); 
  21.  
  22. $frame->position(); 
  23.  
  24. $cb = $frame->get_containing_block(); 
  25.  
  26. // Add our margin, padding & border to the first and last children 
  27. if ( ($f = $frame->get_first_child()) && $f instanceof Text_Frame_Decorator ) { 
  28. $f_style = $f->get_style(); 
  29. $f_style->margin_left = $style->margin_left; 
  30. $f_style->padding_left = $style->padding_left; 
  31. $f_style->border_left = $style->border_left; 
  32.  
  33. if ( ($l = $frame->get_last_child()) && $l instanceof Text_Frame_Decorator ) { 
  34. $l_style = $l->get_style(); 
  35. $l_style->margin_right = $style->margin_right; 
  36. $l_style->padding_right = $style->padding_right; 
  37. $l_style->border_right = $style->border_right; 
  38.  
  39. if ( $block ) { 
  40. $block->add_frame_to_line($this->_frame); 
  41.  
  42. // Set the containing blocks and reflow each child. The containing 
  43. // block is not changed by line boxes. 
  44. foreach ( $frame->get_children() as $child ) { 
  45. $child->set_containing_block($cb); 
  46. $child->reflow($block);