Dompdf\Frame
The main Frame class
This class represents a single HTML element. This class stores
positioning information as well as containing block location and
dimensions. Style information for the element is stored in a object. Tree structure is maintained via the parent & children
links.
Synopsis
class Frame
{
- // constants
- const WS_TEXT = 1;
- const WS_SPACE = 2;
- // members
- protected DOMText $_node;
- protected $_id;
- public static integer $ID_COUNTER = 0;
- protected Style $_style;
- protected Style $_original_style;
- protected Frame $_parent;
- protected $_frame_list;
- protected Frame $_first_child;
- protected Frame $_last_child;
- protected Frame $_prev_sibling;
- protected Frame $_next_sibling;
- protected $_containing_block;
- protected $_position;
- protected $_opacity;
- protected AbstractFrameDecorator $_decorator;
- protected LineBox $_containing_line;
- protected array $_is_cache = ;
- public bool $_already_pushed = false;
- public bool $_float_next_line = false;
- public bool $_splitted;
- public static int $_ws_state = self::WS_SPACE;
- // methods
- public void __construct()
- protected void ws_trim()
- protected bool ws_keep()
- protected bool ws_is_text()
- public void dispose()
- public void reset()
- public DOMText get_node()
- public string get_id()
- public Style get_style()
- public Style get_original_style()
- public Frame get_parent()
- public AbstractFrameDecorator get_decorator()
- public Frame get_first_child()
- public Frame get_last_child()
- public Frame get_prev_sibling()
- public Frame get_next_sibling()
- public array get_children()
- public array get_containing_block()
- public array|float get_position()
- public float get_margin_height()
- public float get_margin_width()
- public float get_break_margins()
- public array get_content_box()
- public array get_padding_box()
- public array get_border_box()
- public float get_opacity()
- public LineBox get_containing_line()
- public void set_id()
- public void set_style()
- public void set_decorator()
- public void set_containing_block()
- public void set_position()
- public void set_opacity()
- public void set_containing_line()
- public bool is_auto_height()
- public bool is_auto_width()
- public bool is_text_node()
- public bool is_positionned()
- public bool is_absolute()
- public bool is_block()
- public bool is_inline_block()
- public bool is_in_flow()
- public bool is_pre()
- public bool is_table()
- public void prepend_child()
- public void append_child()
- public void insert_child_before()
- public void insert_child_after()
- public Frame remove_child()
- public string __toString()
Constants
Name | Value |
---|---|
WS_TEXT | 1 |
WS_SPACE | 2 |
Members
protected
- $_containing_block
—
array
This frame's containing block (used in layout): array(x, y, w, h) - $_containing_line
—
Dompdf\LineBox
This frame's containing line box - $_decorator
—
\Dompdf\FrameDecorator\AbstractFrameDecorator
This frame's decorator - $_first_child
—
Dompdf\Frame
This frame's first child. All children are handled as a doubly-linked list. - $_frame_list
—
array
This frame's children - $_id
—
string
Unique identifier for this frame. Used to reference this frame via the node. - $_is_cache — array
- $_last_child
—
Dompdf\Frame
This frame's last child. - $_next_sibling
—
Dompdf\Frame
This frame's next sibling in the document tree. - $_node
—
\DOMElement|\DOMText
The DOMElement or DOMText object this frame represents - $_opacity
—
float
Absolute opacity of this frame - $_original_style
—
Dompdf\Css\Style
This frame's original style. Needed for cases where frames are split across pages. - $_parent
—
Dompdf\Frame
This frame's parent in the document tree. - $_position
—
array
Position on the page of the top-left corner of the margin box of this frame: array(x,y) - $_prev_sibling
—
Dompdf\Frame
This frame's previous sibling in the document tree. - $_style
—
Dompdf\Css\Style
This frame's calculated style
public
-
$ID_COUNTER
Unique id counter - $_already_pushed
—
Dompdf\bool
Tells wether the frame was already pushed to the next page - $_float_next_line — Dompdf\bool
- $_splitted
—
Dompdf\bool
Tells wether the frame was split - $_ws_state — int
Methods
protected
- ws_is_text()
- ws_keep()
- ws_trim() — WIP : preprocessing to remove all the unused whitespace
public
- __construct() — Class constructor
- __toString()
- append_child() — Inserts a new child at the end of the Frame
- dispose() — "Destructor": forcibly free all references held by this frame
- get_border_box() — Return the border box of the frame
- get_break_margins()
- get_children()
- get_containing_block() — Containing block dimensions
- get_containing_line()
- get_content_box() — Return the content box (x,y,w,h) of the frame
- get_decorator()
- get_first_child()
- get_id()
- get_last_child()
- get_margin_height() — Return the height of the margin box of the frame, in pt. Meaningless unless the height has been calculated properly.
- get_margin_width() — Return the width of the margin box of the frame, in pt. Meaningless unless the width has been calculated properly.
- get_next_sibling()
- get_node()
- get_opacity()
- get_original_style()
- get_padding_box() — Return the padding box (x,y,w,h) of the frame
- get_parent()
- get_position() — Block position
- get_prev_sibling()
- get_style()
- insert_child_after() — Inserts a new child immediately after the specified frame
- insert_child_before() — Inserts a new child immediately before the specified frame
- is_absolute()
- is_auto_height() — Indicates if the margin height is auto sized
- is_auto_width() — Indicates if the margin width is auto sized
- is_block()
- is_in_flow()
- is_inline_block()
- is_positionned()
- is_pre()
- is_table()
- is_text_node() — Tells if the frame is a text node
- prepend_child() — Inserts a new child at the beginning of the Frame
- remove_child() — Remove a child frame
- reset() — Re-initialize the frame
- set_containing_block()
- set_containing_line()
- set_decorator()
- set_id()
- set_opacity()
- set_position()
- set_style()