Documentation

Frame
in package

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.

Table of Contents

WS_SPACE  = 2
WS_TEXT  = 1
$_already_pushed  : bool
Tells whether the frame was already pushed to the next page
$_float_next_line  : bool
$_splitted  : bool
Tells whether the frame was split
$_ws_state  : int
$ID_COUNTER  : mixed
Unique id counter
$_containing_block  : array<string|int, float>
This frame's containing block (used in layout): array(x, y, w, h)
$_containing_line  : LineBox
This frame's containing line box
$_decorator  : AbstractFrameDecorator
This frame's decorator
$_first_child  : Frame
This frame's first child. All children are handled as a doubly-linked list.
$_frame_list  : array<string|int, Frame>
This frame's children
$_id  : string
Unique identifier for this frame. Used to reference this frame via the node.
$_is_cache  : array<string|int, mixed>
$_last_child  : Frame
This frame's last child.
$_next_sibling  : 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  : Style
This frame's original style. Needed for cases where frames are split across pages.
$_parent  : Frame
This frame's parent in the document tree.
$_position  : array<string|int, float>
Position on the page of the top-left corner of the margin box of this frame: array(x,y)
$_prev_sibling  : Frame
This frame's previous sibling in the document tree.
$_style  : Style
This frame's calculated style
__construct()  : mixed
Class constructor
__toString()  : string
append_child()  : mixed
Inserts a new child at the end of the Frame
dispose()  : mixed
"Destructor": forcibly free all references held by this frame
get_border_box()  : array<string|int, mixed>
Return the border box of the frame
get_break_margins()  : float
get_children()  : FrameList|array<string|int, Frame>
get_containing_block()  : array<string|int, float>|float
Containing block dimensions
get_containing_line()  : LineBox
get_content_box()  : array<string|int, mixed>
Return the content box (x,y,w,h) of the frame
get_decorator()  : AbstractFrameDecorator
get_first_child()  : Frame
get_id()  : string
get_last_child()  : Frame
get_margin_height()  : float
Return the height of the margin box of the frame, in pt. Meaningless unless the height has been calculated properly.
get_margin_width()  : float
Return the width of the margin box of the frame, in pt. Meaningless unless the width has been calculated properly.
get_next_sibling()  : Frame
get_node()  : DOMElement|DOMText
get_opacity()  : float
get_original_style()  : Style
get_padding_box()  : array<string|int, mixed>
Return the padding box (x,y,w,h) of the frame
get_parent()  : Frame
get_position()  : array<string|int, mixed>|float
Block position
get_prev_sibling()  : Frame
get_style()  : Style
insert_child_after()  : mixed
Inserts a new child immediately after the specified frame
insert_child_before()  : mixed
Inserts a new child immediately before the specified frame
is_absolute()  : bool
is_auto_height()  : bool
Indicates if the margin height is auto sized
is_auto_width()  : bool
Indicates if the margin width is auto sized
is_block()  : bool
is_in_flow()  : bool
is_inline_block()  : bool
is_positionned()  : bool
is_pre()  : bool
is_table()  : bool
is_text_node()  : bool
Tells if the frame is a text node
prepend_child()  : mixed
Inserts a new child at the beginning of the Frame
remove_child()  : Frame
Remove a child frame
reset()  : mixed
Re-initialize the frame
set_containing_block()  : mixed
set_containing_line()  : mixed
set_decorator()  : mixed
set_id()  : mixed
set_opacity()  : mixed
set_position()  : mixed
set_style()  : mixed
ws_is_text()  : bool
ws_keep()  : bool
ws_trim()  : mixed
WIP : preprocessing to remove all the unused whitespace

Constants

WS_SPACE

public mixed WS_SPACE = 2

WS_TEXT

public mixed WS_TEXT = 1

Properties

$_already_pushed

Tells whether the frame was already pushed to the next page

public bool $_already_pushed = false

$_float_next_line

public bool $_float_next_line = false

$_splitted

Tells whether the frame was split

public bool $_splitted

$_ws_state

public static int $_ws_state = self::WS_SPACE

$ID_COUNTER

Unique id counter

public static mixed $ID_COUNTER = 0

$_containing_block

This frame's containing block (used in layout): array(x, y, w, h)

protected array<string|int, float> $_containing_block

$_containing_line

This frame's containing line box

protected LineBox $_containing_line

$_first_child

This frame's first child. All children are handled as a doubly-linked list.

protected Frame $_first_child

$_frame_list

This frame's children

protected array<string|int, Frame> $_frame_list

$_id

Unique identifier for this frame. Used to reference this frame via the node.

protected string $_id

$_is_cache

protected array<string|int, mixed> $_is_cache = []

$_last_child

This frame's last child.

protected Frame $_last_child

$_next_sibling

This frame's next sibling in the document tree.

protected Frame $_next_sibling

$_node

The DOMElement or DOMText object this frame represents

protected DOMElement|DOMText $_node

$_opacity

Absolute opacity of this frame

protected float $_opacity

$_original_style

This frame's original style. Needed for cases where frames are split across pages.

protected Style $_original_style

$_parent

This frame's parent in the document tree.

protected Frame $_parent

$_position

Position on the page of the top-left corner of the margin box of this frame: array(x,y)

protected array<string|int, float> $_position

$_prev_sibling

This frame's previous sibling in the document tree.

protected Frame $_prev_sibling

$_style

This frame's calculated style

protected Style $_style

Methods

__construct()

Class constructor

public __construct(DOMNode $node) : mixed
Parameters
$node : DOMNode

the DOMNode this frame represents

Return values
mixed

__toString()

public __toString() : string
Return values
string

append_child()

Inserts a new child at the end of the Frame

public append_child( $child[,  $update_node = true ]) : mixed
Parameters
$child :

Frame The new Frame to insert

$update_node : = true

boolean Whether or not to update the DOM

Return values
mixed

dispose()

"Destructor": forcibly free all references held by this frame

public dispose([bool $recursive = false ]) : mixed
Parameters
$recursive : bool = false

if true, call dispose on all children

Return values
mixed

get_border_box()

Return the border box of the frame

public get_border_box() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_break_margins()

public get_break_margins() : float
Return values
float

get_containing_block()

Containing block dimensions

public get_containing_block([ $i = null ]) : array<string|int, float>|float
Parameters
$i : = null

string The key of the wanted containing block's dimension (x, y, w, h)

Return values
array<string|int, float>|float

get_content_box()

Return the content box (x,y,w,h) of the frame

public get_content_box() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_id()

public get_id() : string
Return values
string

get_margin_height()

Return the height of the margin box of the frame, in pt. Meaningless unless the height has been calculated properly.

public get_margin_height() : float
Return values
float

get_margin_width()

Return the width of the margin box of the frame, in pt. Meaningless unless the width has been calculated properly.

public get_margin_width() : float
Return values
float

get_node()

public get_node() : DOMElement|DOMText
Return values
DOMElement|DOMText

get_opacity()

public get_opacity([null $opacity = null ]) : float
Parameters
$opacity : null = null
Return values
float

get_original_style()

public get_original_style() : Style
Return values
Style

get_padding_box()

Return the padding box (x,y,w,h) of the frame

public get_padding_box() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_position()

Block position

public get_position([ $i = null ]) : array<string|int, mixed>|float
Parameters
$i : = null

string The key of the wanted position value (x, y)

Return values
array<string|int, mixed>|float

insert_child_after()

Inserts a new child immediately after the specified frame

public insert_child_after( $new_child,  $ref[,  $update_node = true ]) : mixed
Parameters
$new_child :

Frame The new Frame to insert

$ref :

Frame The Frame before the new Frame

$update_node : = true

boolean Whether or not to update the DOM

Tags
throws
Exception
Return values
mixed

insert_child_before()

Inserts a new child immediately before the specified frame

public insert_child_before( $new_child,  $ref[,  $update_node = true ]) : mixed
Parameters
$new_child :

Frame The new Frame to insert

$ref :

Frame The Frame after the new Frame

$update_node : = true

boolean Whether or not to update the DOM

Tags
throws
Exception
Return values
mixed

is_absolute()

public is_absolute() : bool
Return values
bool

is_auto_height()

Indicates if the margin height is auto sized

public is_auto_height() : bool
Return values
bool

is_auto_width()

Indicates if the margin width is auto sized

public is_auto_width() : bool
Return values
bool

is_block()

public is_block() : bool
Return values
bool

is_in_flow()

public is_in_flow() : bool
Return values
bool

is_inline_block()

public is_inline_block() : bool
Return values
bool

is_positionned()

public is_positionned() : bool
Return values
bool

is_pre()

public is_pre() : bool
Return values
bool

is_table()

public is_table() : bool
Return values
bool

is_text_node()

Tells if the frame is a text node

public is_text_node() : bool
Return values
bool

prepend_child()

Inserts a new child at the beginning of the Frame

public prepend_child( $child[,  $update_node = true ]) : mixed
Parameters
$child :

Frame The new Frame to insert

$update_node : = true

boolean Whether or not to update the DOM

Return values
mixed

remove_child()

Remove a child frame

public remove_child(Frame $child[, bool $update_node = true ]) : Frame
Parameters
$child : Frame
$update_node : bool = true

Whether or not to remove the DOM node

Tags
throws
Exception
Return values
Frame

The removed child frame

reset()

Re-initialize the frame

public reset() : mixed
Return values
mixed

set_containing_block()

public set_containing_block([null $x = null ][, null $y = null ][, null $w = null ][, null $h = null ]) : mixed
Parameters
$x : null = null
$y : null = null
$w : null = null
$h : null = null
Return values
mixed

set_containing_line()

public set_containing_line(LineBox $line) : mixed
Parameters
$line : LineBox
Return values
mixed

set_id()

public set_id( $id) : mixed
Parameters
$id :
Return values
mixed

set_opacity()

public set_opacity( $opacity) : mixed
Parameters
$opacity :
Return values
mixed

set_position()

public set_position([null $x = null ][, null $y = null ]) : mixed
Parameters
$x : null = null
$y : null = null
Return values
mixed

set_style()

public set_style(Style $style) : mixed
Parameters
$style : Style
Return values
mixed

ws_is_text()

protected ws_is_text() : bool
Return values
bool

ws_keep()

protected ws_keep() : bool
Return values
bool

ws_trim()

WIP : preprocessing to remove all the unused whitespace

protected ws_trim() : mixed
Return values
mixed

Search results