Hubbub
Functions
in_table.c File Reference
#include <assert.h>
#include <string.h>
#include "treebuilder/modes.h"
#include "treebuilder/internal.h"
#include "treebuilder/treebuilder.h"
#include "utils/utils.h"

Go to the source code of this file.

Functions

static void clear_stack_table_context (hubbub_treebuilder *treebuilder)
 Clear the stack back to a table context: "the UA must, while the current node is not a table element or an html element, pop elements from the stack of open elements. More...
 
static hubbub_error process_input_in_table (hubbub_treebuilder *treebuilder, const hubbub_token *token)
 Process an input start tag in the "in table" insertion mode. More...
 
hubbub_error handle_in_table (hubbub_treebuilder *treebuilder, const hubbub_token *token)
 Handle token in "in table" insertion mode. More...
 

Function Documentation

static void clear_stack_table_context ( hubbub_treebuilder treebuilder)
inlinestatic

Clear the stack back to a table context: "the UA must, while the current node is not a table element or an html element, pop elements from the stack of open elements.

"

Definition at line 23 of file in_table.c.

References hubbub_tree_handler::ctx, current_node(), element_stack_pop(), HTML, TABLE, hubbub_treebuilder::tree_handler, type, and hubbub_tree_handler::unref_node.

Referenced by handle_in_table().

hubbub_error handle_in_table ( hubbub_treebuilder treebuilder,
const hubbub_token token 
)

Handle token in "in table" insertion mode.

Parameters
treebuilderThe treebuilder instance
tokenThe token to handle
Returns
True to reprocess token, false otherwise
Todo:
parse error
Todo:
parse error
Todo:
fragment case
Todo:
parse error
Todo:
parse error

Definition at line 74 of file in_table.c.

References hubbub_tag::attributes, BODY, CAPTION, clear_stack_table_context(), COL, COLGROUP, hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, current_table(), hubbub_token::data, hubbub_treebuilder_context::element_stack, element_stack_pop_until(), element_type_from_name(), formatting_list_append(), hubbub_treebuilder_context::formatting_list_end, formatting_list_remove(), handle_in_body(), handle_in_head(), HTML, HUBBUB_OK, HUBBUB_REPROCESS, HUBBUB_TOKEN_CHARACTER, HUBBUB_TOKEN_COMMENT, HUBBUB_TOKEN_DOCTYPE, HUBBUB_TOKEN_END_TAG, HUBBUB_TOKEN_EOF, HUBBUB_TOKEN_START_TAG, IN_CAPTION, IN_COLUMN_GROUP, IN_TABLE_BODY, hubbub_treebuilder_context::in_table_foster, INPUT, insert_element(), hubbub_string::len, hubbub_treebuilder_context::mode, hubbub_tag::n_attributes, hubbub_tag::name, element_context::node, hubbub_tag::ns, process_characters_expect_whitespace(), process_comment_append(), process_input_in_table(), hubbub_string::ptr, hubbub_tree_handler::ref_node, reset_insertion_mode(), SCRIPT, SLEN, STYLE, TABLE, hubbub_token::tag, element_context::tainted, TBODY, TD, TFOOT, TH, THEAD, TR, hubbub_treebuilder::tree_handler, type, hubbub_token::type, and hubbub_tree_handler::unref_node.

Referenced by handle_in_row(), handle_in_table_body(), and hubbub_treebuilder_token_handler().

static hubbub_error process_input_in_table ( hubbub_treebuilder treebuilder,
const hubbub_token token 
)
inlinestatic

Process an input start tag in the "in table" insertion mode.

Todo:
parse error

Definition at line 44 of file in_table.c.

References hubbub_tag::attributes, hubbub_token::data, HUBBUB_REPROCESS, hubbub_string_match_ci(), insert_element(), hubbub_string::len, hubbub_tag::n_attributes, hubbub_string::ptr, SLEN, hubbub_token::tag, and hubbub_attribute::value.

Referenced by handle_in_table().