NetSurf
Data Fields
box Struct Reference

Node in box tree. More...

#include <box.h>

Collaboration diagram for box:
[legend]

Data Fields

box_type type
 Type of box. More...
 
box_flags flags
 Box flags. More...
 
struct dom_node * node
 DOM node that generated this box or NULL. More...
 
css_select_results * styles
 Computed styles for elements and their pseudo elements. More...
 
css_computed_style * style
 Style for this box. More...
 
lwc_string * id
 value of id attribute (or name for anchors) More...
 
struct boxnext
 Next sibling box, or NULL. More...
 
struct boxprev
 Previous sibling box, or NULL. More...
 
struct boxchildren
 First child box, or NULL. More...
 
struct boxlast
 Last child box, or NULL. More...
 
struct boxparent
 Parent box, or NULL. More...
 
struct boxinline_end
 INLINE_END box corresponding to this INLINE box, or INLINE box corresponding to this INLINE_END box. More...
 
struct boxfloat_children
 First float child box, or NULL. More...
 
struct boxnext_float
 Next sibling float box. More...
 
struct boxfloat_container
 If box is a float, points to box's containing block. More...
 
int clear_level
 Level below which subsequent floats must be cleared. More...
 
int cached_place_below_level
 Level below which floats have been placed. More...
 
int x
 Coordinate of left padding edge relative to parent box, or relative to ancestor that contains this box in float_children for FLOAT_. More...
 
int y
 Coordinate of top padding edge, relative as for x. More...
 
int width
 Width of content box (excluding padding etc.). More...
 
int height
 Height of content box (excluding padding etc.). More...
 
int descendant_x0
 left edge of descendants More...
 
int descendant_y0
 top edge of descendants More...
 
int descendant_x1
 right edge of descendants More...
 
int descendant_y1
 bottom edge of descendants More...
 
int margin [4]
 Margin: TOP, RIGHT, BOTTOM, LEFT. More...
 
int padding [4]
 Padding: TOP, RIGHT, BOTTOM, LEFT. More...
 
struct box_border border [4]
 Border: TOP, RIGHT, BOTTOM, LEFT. More...
 
struct scrollbarscroll_x
 Horizontal scroll. More...
 
struct scrollbarscroll_y
 Vertical scroll. More...
 
int min_width
 Width of box taking all line breaks (including margins etc). More...
 
int max_width
 Width that would be taken with no line breaks. More...
 
char * text
 Text, or NULL if none. More...
 
size_t length
 Length of text. More...
 
int space
 Width of space after current text (depends on font and size). More...
 
size_t byte_offset
 Byte offset within a textual representation of this content. More...
 
struct nsurlhref
 Link, or NULL. More...
 
const char * target
 Link target, or NULL. More...
 
const char * title
 Title, or NULL. More...
 
unsigned int columns
 Number of columns for TABLE / TABLE_CELL. More...
 
unsigned int rows
 Number of rows for TABLE only. More...
 
unsigned int start_column
 Start column for TABLE_CELL only. More...
 
struct columncol
 Array of table column data for TABLE only. More...
 
int list_value
 List item value. More...
 
struct boxlist_marker
 List marker box if this is a list-item, or NULL. More...
 
struct form_controlgadget
 Form control data, or NULL if not a form control. More...
 
char * usemap
 (Image)map to use with this object, or NULL if none More...
 
struct hlcache_handlebackground
 Background image for this box, or NULL if none. More...
 
struct hlcache_handleobject
 Object in this box (usually an image), or NULL if none. More...
 
struct object_paramsobject_params
 Parameters for the object, or NULL. More...
 
struct browser_windowiframe
 Iframe's browser_window, or NULL if none. More...
 

Detailed Description

Node in box tree.

All dimensions are in pixels.

Definition at line 177 of file box.h.

Field Documentation

◆ background

struct hlcache_handle* box::background

Background image for this box, or NULL if none.

Definition at line 435 of file box.h.

Referenced by box_create(), html_fetch_object(), html_object_callback(), html_object_done(), html_redraw_background(), html_redraw_box_has_background(), and html_redraw_inline_background().

◆ border

struct box_border box::border[4]

◆ byte_offset

size_t box::byte_offset

◆ cached_place_below_level

int box::cached_place_below_level

Level below which floats have been placed.

Definition at line 272 of file box.h.

Referenced by box_create(), layout_block_context(), layout_line(), layout_table(), and place_float_below().

◆ children

struct box* box::children

◆ clear_level

int box::clear_level

Level below which subsequent floats must be cleared.

This is used only for boxes with float_children

Definition at line 267 of file box.h.

Referenced by layout_block_context(), and layout_line().

◆ col

struct column* box::col

Array of table column data for TABLE only.

Definition at line 407 of file box.h.

Referenced by box_create(), box_dump(), box_normalise_table_spans(), layout_minmax_table(), layout_table(), and table_calculate_column_types().

◆ columns

unsigned int box::columns

◆ descendant_x0

int box::descendant_x0

◆ descendant_x1

int box::descendant_x1

◆ descendant_y0

int box::descendant_y0

◆ descendant_y1

int box::descendant_y1

◆ flags

box_flags box::flags

◆ float_children

struct box* box::float_children

First float child box, or NULL.

Float boxes are in the tree twice, in this list for the block box which defines the area for floats, and also in the standard tree given by children, next, prev, etc.

Definition at line 251 of file box.h.

Referenced by add_float_to_container(), box_create(), box_dump(), box_move_xy(), box_nearest_text_box(), html_redraw_box_children(), layout_block_context(), layout_calculate_descendant_bboxes(), layout_line(), layout_position_absolute(), layout_position_relative(), layout_table(), and place_float_below().

◆ float_container

struct box* box::float_container

◆ gadget

struct form_control* box::gadget

◆ height

int box::height

◆ href

struct nsurl* box::href

◆ id

lwc_string* box::id

value of id attribute (or name for anchors)

Definition at line 210 of file box.h.

Referenced by box_a(), box_construct_element_after(), box_create(), box_dump(), box_find_by_id(), and box_talloc_destructor().

◆ iframe

struct browser_window* box::iframe

◆ inline_end

struct box* box::inline_end

INLINE_END box corresponding to this INLINE box, or INLINE box corresponding to this INLINE_END box.

Definition at line 242 of file box.h.

Referenced by box_construct_element_after(), box_create(), box_dump(), html_redraw_box(), html_redraw_text_decoration(), html_redraw_text_decoration_inline(), layout_calculate_descendant_bboxes(), layout_line(), layout_minmax_line(), and layout_position_relative().

◆ last

struct box* box::last

◆ length

size_t box::length

◆ list_marker

struct box* box::list_marker

◆ list_value

int box::list_value

List item value.

Definition at line 412 of file box.h.

Referenced by box_create(), layout__ordered_list_count(), and layout__set_numerical_marker_text().

◆ margin

int box::margin[4]

◆ max_width

int box::max_width

◆ min_width

int box::min_width

◆ next

struct box* box::next

◆ next_float

struct box* box::next_float

◆ node

struct dom_node* box::node

◆ object

struct hlcache_handle* box::object

◆ object_params

struct object_params* box::object_params

Parameters for the object, or NULL.

Definition at line 446 of file box.h.

Referenced by box_create(), box_embed(), box_object(), html_object_callback(), and html_object_open_objects().

◆ padding

int box::padding[4]

◆ parent

struct box* box::parent

◆ prev

struct box* box::prev

◆ rows

unsigned int box::rows

◆ scroll_x

struct scrollbar* box::scroll_x

◆ scroll_y

struct scrollbar* box::scroll_y

◆ space

int box::space

◆ start_column

unsigned int box::start_column

◆ style

css_computed_style* box::style

Style for this box.

0 for INLINE_CONTAINER and FLOAT_*. Pointer into a box's 'styles' select results, except for implied boxes, where it is a pointer to an owned computed style.

Definition at line 205 of file box.h.

Referenced by box__style_is_float(), box_body(), box_canvas(), box_construct_element(), box_construct_element_after(), box_construct_generate(), box_construct_marker(), box_contains_point(), box_create(), box_dump(), box_embed(), box_extract_properties(), box_has_percentage_max_width(), box_iframe(), box_image(), box_input(), box_input_text(), box_normalise_block(), box_normalise_flex(), box_normalise_table(), box_normalise_table_row(), box_normalise_table_row_group(), box_normalise_table_spans(), box_object(), box_select(), box_talloc_destructor(), box_visible(), default_mouse_action(), form_open_select_menu(), get_mouse_action_node(), get_pointer_shape(), html_drop_file_at_point(), html_get_contextual_content(), html_object_callback(), html_redraw_background(), html_redraw_borders(), html_redraw_box(), html_redraw_box_has_background(), html_redraw_file(), html_redraw_inline_background(), html_redraw_inline_borders(), html_redraw_text_box(), html_redraw_text_decoration(), html_reformat(), html_scroll_at_point(), html_selection_drag_end(), layout__list_item_is_numerical(), layout__set_numerical_marker_text(), layout_absolute(), layout_apply_minmax_height(), layout_block_add_scrollbar(), layout_block_context(), layout_block_find_dimensions(), layout_calculate_descendant_bboxes(), layout_compute_offsets(), layout_compute_relative_offset(), layout_find_dimensions(), layout_flex(), layout_flex__base_and_main_sizes(), layout_flex_ctx__create(), layout_float(), layout_float_find_dimensions(), layout_get_box_bbox(), layout_handle_box_sizing(), layout_inline_container(), layout_line(), layout_lists(), layout_minmax_block(), layout_minmax_line(), layout_minmax_table(), layout_next_margin_block(), layout_position_absolute(), layout_position_relative(), layout_solve_width(), layout_table(), layout_update_descendant_bbox(), lh__box_align_self(), lh__box_is_absolute(), lh__box_size_cross_is_auto(), lh__flex_direction_reversed(), lh__flex_main_is_horizontal(), line_height(), mouse_action_drag_selection(), save_text_solve_whitespace(), selection_copy_box(), table_calculate_column_types(), table_cell_top_process_group(), table_cell_top_process_row(), table_cell_top_process_table(), table_used_border_for_cell(), table_used_bottom_border_for_cell(), table_used_left_border_for_cell(), table_used_right_border_for_cell(), and table_used_top_border_for_cell().

◆ styles

css_select_results* box::styles

Computed styles for elements and their pseudo elements.

NULL on non-element boxes.

Definition at line 197 of file box.h.

Referenced by box_construct_element(), box_construct_element_after(), box_create(), box_free_box(), box_get_style(), and box_talloc_destructor().

◆ target

const char* box::target

◆ text

char* box::text

◆ title

const char* box::title

◆ type

box_type box::type

Type of box.

Definition at line 181 of file box.h.

Referenced by add_float_to_container(), box__is_flex(), box_br(), box_button(), box_construct_element(), box_construct_element_after(), box_construct_generate(), box_construct_marker(), box_construct_text(), box_create(), box_dump(), box_extract_properties(), box_frameset(), box_input(), box_input_text(), box_nearest_text_box(), box_normalise_block(), box_normalise_flex(), box_normalise_inline_container(), box_normalise_table(), box_normalise_table_row(), box_normalise_table_row_group(), box_normalise_table_spans(), box_select(), coords_from_range(), extract_text(), find_sides(), get_pointer_shape(), html_object_done(), html_redraw_background(), html_redraw_box(), html_redraw_box_children(), html_redraw_text_decoration(), html_redraw_text_decoration_block(), html_redraw_text_decoration_inline(), layout_absolute(), layout_apply_minmax_height(), layout_block_add_scrollbar(), layout_block_context(), layout_block_object(), layout_calculate_descendant_bboxes(), layout_clear(), layout_find_dimensions(), layout_flex_item(), layout_float(), layout_get_box_bbox(), layout_inline_container(), layout_line(), layout_minmax_block(), layout_minmax_inline_container(), layout_minmax_line(), layout_minmax_table(), layout_next_margin_block(), layout_position_absolute(), layout_position_relative(), layout_table(), lh__box_is_flex_container(), lh__box_is_float_box(), lh__box_is_inline_flow(), lh__box_is_inline_level(), place_float_below(), save_text_solve_whitespace(), selection_copy(), table_calculate_column_types(), and table_used_border_for_cell().

◆ usemap

char* box::usemap

(Image)map to use with this object, or NULL if none

Definition at line 429 of file box.h.

Referenced by box_create(), box_image(), box_object(), get_mouse_action_node(), and html_get_contextual_content().

◆ width

int box::width

◆ x

int box::x

◆ y

int box::y

The documentation for this struct was generated from the following file: