39 const char *tag,
int tagsize,
42 const char *tag,
int tagsize);
50 int32_t border = -1, cellspacing = -1, cellpadding = -1, bgcolor = -1;
54 border = isdigit(attrbuf[0]) ? strtol (attrbuf, NULL, 10) : 1;
56 cellspacing = strtol (attrbuf, NULL, 10);
58 BUG_MSG(
"<table> cellspacing attribute is obsolete.");
62 cellpadding = strtol (attrbuf, NULL, 10);
64 BUG_MSG(
"<table> cellpadding attribute is obsolete.");
87 if (cellspacing != -1) {
98 BUG_MSG(
"<table> width attribute is obsolete.");
112 BUG_MSG(
"<table> align attribute is obsolete.");
121 BUG_MSG(
"<table> bgcolor attribute is obsolete.");
148 if (cellpadding != -1) {
167 HT2TB(html)->addWidget (table, html->
style ());
173 S_TOP(html)->table = table;
183 int32_t bgcolor = -1;
187 switch (
S_TOP(html)->table_mode) {
189 _MSG(
"Invalid HTML syntax: <tr> outside <table>\n");
202 BUG_MSG(
"<tr> bgcolor attribute is obsolete.");
225 switch (
S_TOP(html)->table_mode) {
301 static int i_TABLE = -1;
334 int borderWidth, marginWidth;
340 collapseCellAttrs = *(html->
style ());
353 collapseTableAttrs = *tableStyle;
379 separateCellAttrs = *(html->
style ());
390 const char *tag,
int tagsize,
398 switch (
S_TOP(html)->table_mode) {
408 if (!
S_TOP(html)->cell_text_align_set) {
414 BUG_MSG(
"<t%c> nowrap attribute is obsolete.",
427 BUG_MSG(
"<t%c> width attribute is obsolete.",
439 BUG_MSG(
"<t%c> bgcolor attribute is obsolete.",
450 const char *tag,
int tagsize)
452 int colspan = 1, rowspan = 1;
456 switch (
S_TOP(html)->table_mode) {
458 BUG_MSG(
"<t%c> outside <table>.",
471 colspan = strtol(attrbuf, &invalid, 10);
472 if ((colspan < 0) || (attrbuf == invalid))
477 rowspan =
MAX(1, strtol (attrbuf, NULL, 10));
492 ((
dw::Table*)
S_TOP(html)->table)->addCell (col_tb, colspan, rowspan);
493 S_TOP(html)->textblock = html->
dw = col_tb;
DilloHtmlDocumentType DocType
lout::misc::SimpleVector< DilloHtmlState > * stack
dw::core::style::Style * wordStyle()
dw::core::style::Style * style()
StyleEngine * styleEngine
void setNonCssHint(CssPropertyName name, CssValueType type, CssPropertyValue value)
void inheritBackgroundColor()
Use of the background color of the parent style as default.
void inheritNonCssHints()
Instruct StyleEngine to use the nonCssHints from parent element This is only used for tables where no...
A Widget for rendering tables.
struct dw::core::style::StyleAttrs::@20 borderColor
BorderCollapse borderCollapse
struct dw::core::style::StyleAttrs::@21 borderStyle
static Style * create(StyleAttrs *attrs)
int size() const
Return the number of elements put into this vector.
T * getRef(int i) const
Return the reference of one element.
@ CSS_PROPERTY_PADDING_TOP
@ CSS_PROPERTY_BORDER_RIGHT_STYLE
@ CSS_PROPERTY_BORDER_RIGHT_WIDTH
@ CSS_PROPERTY_BORDER_LEFT_WIDTH
@ CSS_PROPERTY_PADDING_BOTTOM
@ CSS_PROPERTY_BORDER_TOP_WIDTH
@ CSS_PROPERTY_PADDING_RIGHT
@ CSS_PROPERTY_PADDING_LEFT
@ CSS_PROPERTY_BORDER_SPACING
@ CSS_PROPERTY_BORDER_LEFT_STYLE
@ CSS_PROPERTY_TEXT_ALIGN
@ CSS_PROPERTY_BORDER_TOP_STYLE
@ CSS_PROPERTY_BACKGROUND_COLOR
@ CSS_PROPERTY_WHITE_SPACE
@ CSS_PROPERTY_BORDER_BOTTOM_STYLE
@ CSS_PROPERTY_BORDER_BOTTOM_WIDTH
@ CSS_TYPE_ENUM
Value is i, if represented by enum_symbols[i].
@ CSS_TYPE_LENGTH_PERCENTAGE
<length> or <percentage>.
@ CSS_TYPE_COLOR
Represented as integer.
CssLength CSS_CREATE_LENGTH(float v, CssLengthType t)
int dStrAsciiCasecmp(const char *s1, const char *s2)
#define D_ASCII_TOLOWER(c)
const char * a_Html_get_attr(DilloHtml *html, const char *tag, int tagsize, const char *attrname)
Call Html_get_attr2 telling it to parse entities and strip the result.
bool a_Html_tag_set_valign_attr(DilloHtml *html, const char *tag, int tagsize)
Evaluates the VALIGN attribute (top|bottom|middle|baseline) and sets the style in style_attrs.
CssLength a_Html_parse_length(DilloHtml *html, const char *attr)
Returns a length or a percentage, or UNDEF_LENGTH in case of an error, or if attr is NULL.
int32_t a_Html_color_parse(DilloHtml *html, const char *str, int32_t default_color)
Parse a color attribute.
void a_Html_tag_set_align_attr(DilloHtml *html, const char *tag, int tagsize)
Evaluates the ALIGN attribute (left|center|right|justify) and sets the style at the top of the stack.
int a_Html_tag_index(const char *tag)
Get 'tag' index.
@ DILLO_HTML_TABLE_MODE_TD
inside of
@ DILLO_HTML_TABLE_MODE_NONE
no table at all
@ DILLO_HTML_TABLE_MODE_TR
inside of , outside of
@ DILLO_HTML_TABLE_MODE_TOP
outside of
#define HT2TB(html)
"html struct" to Textblock
#define BUG_MSG(...)
Add a bug-meter message.
#define S_TOP(html)
Top of the parsing stack.
@ DILLO_HTML_TABLE_BORDER_COLLAPSE
@ DILLO_HTML_TABLE_BORDER_SEPARATE
Anything related to Dillo Widget styles is defined here.
The core of Dw is defined in this namespace.
Dw is in this namespace, or sub namespaces of this one.
DilloPrefs prefs
Global Data.
void Html_tag_open_td(DilloHtml *html, const char *tag, int tagsize)
static void Html_set_collapsing_border_model(DilloHtml *html, Widget *col_tb)
void Html_tag_content_tbody(DilloHtml *html, const char *tag, int tagsize)
void Html_tag_open_tbody(DilloHtml *html, const char *tag, int tagsize)
void Html_tag_open_thead(DilloHtml *html, const char *tag, int tagsize)
static void Html_table_set_border_model(DilloHtml *html, DilloHtmlTableBorderMode mode)
Set current table's border model.
void Html_tag_content_th(DilloHtml *html, const char *tag, int tagsize)
void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_open_table_cell(DilloHtml *html, const char *tag, int tagsize, dw::core::style::TextAlignType text_align)
void Html_tag_open_tfoot(DilloHtml *html, const char *tag, int tagsize)
void Html_tag_content_td(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_content_table_cell(DilloHtml *html, const char *tag, int tagsize)
void Html_tag_content_tr(DilloHtml *html, const char *tag, int tagsize)
static int Html_table_get_border_model(DilloHtml *html)
The table border model is stored in the table's stack item.
void Html_tag_open_th(DilloHtml *html, const char *tag, int tagsize)
void Html_tag_content_table(DilloHtml *html, const char *tag, int tagsize)
static void Html_set_separate_border_model(DilloHtml *html, Widget *col_tb)
Adjust style for separate border model.
void Html_tag_open_tr(DilloHtml *html, const char *tag, int tagsize)
DilloHtmlTableBorderMode table_border_mode
int tag_idx
TagInfo index for the tag that's being processed.