NetSurf
|
implementation of HTML table processing and layout. More...
#include <assert.h>
#include <dom/dom.h>
#include "utils/log.h"
#include "utils/utils.h"
#include "utils/talloc.h"
#include "css/utils.h"
#include "html/box.h"
#include "html/table.h"
Go to the source code of this file.
Data Structures | |
struct | border |
Container for border values during table border calculations. More... | |
Functions | |
static bool | table_border_is_more_eyecatching (const css_unit_ctx *unit_len_ctx, const struct border *a, box_type a_src, const struct border *b, box_type b_src) |
Determine if a border style is more eyecatching than another. More... | |
static void | table_cell_top_process_table (const css_unit_ctx *unit_len_ctx, struct box *table, struct border *a, box_type *a_src) |
Process a table. More... | |
static bool | table_cell_top_process_row (const css_unit_ctx *unit_len_ctx, struct box *cell, struct box *row, struct border *a, box_type *a_src) |
Process a row. More... | |
static bool | table_cell_top_process_group (const css_unit_ctx *unit_len_ctx, struct box *cell, struct box *group, struct border *a, box_type *a_src) |
Process a group. More... | |
static void | table_used_left_border_for_cell (const css_unit_ctx *unit_len_ctx, struct box *cell) |
Calculate used values of border-left-{style,color,width}. More... | |
static void | table_used_top_border_for_cell (const css_unit_ctx *unit_len_ctx, struct box *cell) |
Calculate used values of border-top-{style,color,width}. More... | |
static void | table_used_right_border_for_cell (const css_unit_ctx *unit_len_ctx, struct box *cell) |
Calculate used values of border-right-{style,color,width}. More... | |
static void | table_used_bottom_border_for_cell (const css_unit_ctx *unit_len_ctx, struct box *cell) |
Calculate used values of border-bottom-{style,color,width}. More... | |
bool | table_calculate_column_types (const css_unit_ctx *unit_len_ctx, struct box *table) |
Determine the column width types for a table. More... | |
void | table_used_border_for_cell (const css_unit_ctx *unit_len_ctx, struct box *cell) |
Calculate used values of border-{trbl}-{style,color,width} for table cells. More... | |
implementation of HTML table processing and layout.
Definition in file table.c.
|
static |
Determine if a border style is more eyecatching than another.
unit_len_ctx | Length conversion context |
a | Reference border style |
a_src | Source of a |
b | Candidate border style |
b_src | Source of b |
Definition at line 62 of file table.c.
References BOX_TABLE, BOX_TABLE_CELL, BOX_TABLE_ROW, BOX_TABLE_ROW_GROUP, fallthrough, border::style, border::unit, and border::width.
Referenced by table_cell_top_process_group(), table_cell_top_process_row(), table_cell_top_process_table(), 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().
bool table_calculate_column_types | ( | const css_unit_ctx * | unit_len_ctx, |
struct box * | table | ||
) |
Determine the column width types for a table.
unit_len_ctx | Length conversion context |
table | box of type BOX_TABLE |
The table->col array is allocated and type and width are filled in for each column.
Definition at line 813 of file table.c.
References BOX_TABLE_CELL, box::children, box::col, box::columns, box::next, NSLOG, column::positioned, box::start_column, box::style, talloc_array, column::type, box::type, type, column::width, and width.
Referenced by layout_minmax_table().
|
static |
Process a group.
unit_len_ctx | Length conversion context |
cell | Cell being considered |
group | Group to process |
a | Current border style for cell |
a_src | Source of a |
Definition at line 322 of file table.c.
References BOX_TABLE_ROW_GROUP, border::c, border::color, box::last, box::prev, box::style, border::style, table_border_is_more_eyecatching(), table_cell_top_process_row(), border::unit, and border::width.
Referenced by table_used_top_border_for_cell().
|
static |
Process a row.
unit_len_ctx | Length conversion context |
cell | Cell being considered |
row | Row to process |
a | Current border style for cell |
a_src | Source of a |
Definition at line 211 of file table.c.
References BOX_TABLE_CELL, BOX_TABLE_ROW, border::c, box::children, border::color, box::columns, box::next, box::prev, box::start_column, box::style, border::style, table_border_is_more_eyecatching(), border::unit, and border::width.
Referenced by table_cell_top_process_group(), and table_used_top_border_for_cell().
|
static |
Process a table.
unit_len_ctx | Length conversion context |
table | Table to process |
a | Current border style for cell |
a_src | Source of a |
Definition at line 173 of file table.c.
References BOX_TABLE, border::c, border::color, box::style, border::style, table_border_is_more_eyecatching(), border::unit, and border::width.
Referenced by table_used_top_border_for_cell().
void table_used_border_for_cell | ( | const css_unit_ctx * | unit_len_ctx, |
struct box * | cell | ||
) |
Calculate used values of border-{trbl}-{style,color,width} for table cells.
unit_len_ctx | Length conversion context |
cell | Table cell to consider |
Definition at line 988 of file table.c.
References box::border, BOTTOM, BOX_TABLE_CELL, box_border::c, LEFT, RIGHT, box_border::style, box::style, table_used_bottom_border_for_cell(), table_used_left_border_for_cell(), table_used_right_border_for_cell(), table_used_top_border_for_cell(), TOP, box::type, box_border::width, and width.
Referenced by layout_table().
|
static |
Calculate used values of border-bottom-{style,color,width}.
unit_len_ctx | Length conversion context |
cell | Table cell to consider |
Definition at line 723 of file table.c.
References box::border, BOTTOM, BOX_TABLE, BOX_TABLE_CELL, BOX_TABLE_ROW, BOX_TABLE_ROW_GROUP, box_border::c, border::c, border::color, box::next, box::parent, box::rows, box_border::style, box::style, border::style, table_border_is_more_eyecatching(), border::unit, box_border::width, and border::width.
Referenced by table_used_border_for_cell().
|
static |
Calculate used values of border-left-{style,color,width}.
unit_len_ctx | Length conversion context |
cell | Table cell to consider |
Definition at line 387 of file table.c.
References box::border, BOX_TABLE, BOX_TABLE_CELL, BOX_TABLE_ROW, BOX_TABLE_ROW_GROUP, box_border::c, border::c, box::children, border::color, box::columns, LEFT, box::next, box::parent, box::prev, box::rows, box::start_column, box_border::style, box::style, border::style, table_border_is_more_eyecatching(), border::unit, box_border::width, and border::width.
Referenced by table_used_border_for_cell().
|
static |
Calculate used values of border-right-{style,color,width}.
unit_len_ctx | Length conversion context |
cell | Table cell to consider |
Definition at line 619 of file table.c.
References box::border, BOX_TABLE, BOX_TABLE_CELL, BOX_TABLE_ROW, BOX_TABLE_ROW_GROUP, box_border::c, border::c, border::color, box::columns, box::next, box::parent, RIGHT, box::rows, box::start_column, box_border::style, box::style, border::style, table_border_is_more_eyecatching(), border::unit, box_border::width, and border::width.
Referenced by table_used_border_for_cell().
|
static |
Calculate used values of border-top-{style,color,width}.
unit_len_ctx | Length conversion context |
cell | Table cell to consider |
Definition at line 519 of file table.c.
References box::border, BOX_TABLE_CELL, BOX_TABLE_ROW, BOX_TABLE_ROW_GROUP, box_border::c, border::c, border::color, box::parent, box::prev, box_border::style, box::style, border::style, table_border_is_more_eyecatching(), table_cell_top_process_group(), table_cell_top_process_row(), table_cell_top_process_table(), TOP, border::unit, box_border::width, and border::width.
Referenced by table_used_border_for_cell().