Hubbub
|
#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.
Data Structures | |
struct | bookmark |
Bookmark for formatting list. More... | |
Macros | |
#define | PROMPT "This is a searchable index. Insert your search keywords here: " |
Typedefs | |
typedef struct bookmark | bookmark |
Bookmark for formatting list. More... | |
Functions | |
static hubbub_error | process_character (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process a character token. More... | |
static hubbub_error | process_start_tag (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process a start tag. More... | |
static hubbub_error | process_end_tag (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process an end tag. More... | |
static hubbub_error | process_html_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process a html start tag as if in "in body". More... | |
static hubbub_error | process_body_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process a body start tag as if in "in body". More... | |
static hubbub_error | process_frameset_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process a frameset start tag as if in "in body". More... | |
static hubbub_error | process_container_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process a generic container start tag as if in "in body". More... | |
static hubbub_error | process_hN_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process a hN start tag as if in "in body". More... | |
static hubbub_error | process_form_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process a form start tag as if in "in body". More... | |
static hubbub_error | process_dd_dt_li_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token, element_type type) |
Process a dd, dt or li start tag as if in "in body". More... | |
static hubbub_error | process_plaintext_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process a plaintext start tag as if in "in body". More... | |
static hubbub_error | process_a_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process an "a" start tag as if in "in body". More... | |
static hubbub_error | process_presentational_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token, element_type type) |
Process a b, big, em, font, i, s, small, strike, strong, tt, or u start tag as if in "in body". More... | |
static hubbub_error | process_nobr_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process a nobr start tag as if in "in body". More... | |
static hubbub_error | process_button_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process a button start tag as if in "in body". More... | |
static hubbub_error | process_applet_marquee_object_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token, element_type type) |
Process an applet, marquee or object start tag as if in "in body". More... | |
static hubbub_error | process_hr_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process an hr start tag as if in "in body". More... | |
static hubbub_error | process_image_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process an image start tag as if in "in body". More... | |
static hubbub_error | process_isindex_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process an isindex start tag as if in "in body". More... | |
static hubbub_error | process_textarea_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process a textarea start tag as if in "in body". More... | |
static hubbub_error | process_select_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process a select start tag as if in "in body". More... | |
static hubbub_error | process_opt_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process an option or optgroup start tag as if in "in body". More... | |
static hubbub_error | process_phrasing_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Process a phrasing start tag as if in "in body". More... | |
static hubbub_error | process_0body_in_body (hubbub_treebuilder *treebuilder) |
Process a body end tag as if in "in body". More... | |
static hubbub_error | process_0container_in_body (hubbub_treebuilder *treebuilder, element_type type) |
Process a container end tag as if in "in body". More... | |
static hubbub_error | process_0form_in_body (hubbub_treebuilder *treebuilder) |
Process a form end tag as if in "in body". More... | |
static hubbub_error | process_0p_in_body (hubbub_treebuilder *treebuilder) |
Process a p end tag as if in "in body". More... | |
static hubbub_error | process_0dd_dt_li_in_body (hubbub_treebuilder *treebuilder, element_type type) |
Process a dd, dt, or li end tag as if in "in body". More... | |
static hubbub_error | process_0h_in_body (hubbub_treebuilder *treebuilder, element_type type) |
Process a h1, h2, h3, h4, h5, or h6 end tag as if in "in body". More... | |
static hubbub_error | process_0presentational_in_body (hubbub_treebuilder *treebuilder, element_type type) |
Process a presentational end tag as if in "in body". More... | |
static hubbub_error | process_0applet_button_marquee_object_in_body (hubbub_treebuilder *treebuilder, element_type type) |
Process an applet, button, marquee, or object end tag as if in "in body". More... | |
static hubbub_error | process_0br_in_body (hubbub_treebuilder *treebuilder) |
Process a br end tag as if in "in body". More... | |
static hubbub_error | process_0generic_in_body (hubbub_treebuilder *treebuilder, element_type type) |
Process a generic end tag as if in "in body". More... | |
static hubbub_error | aa_find_and_validate_formatting_element (hubbub_treebuilder *treebuilder, element_type type, formatting_list_entry **element) |
Adoption agency: find and validate the formatting element. More... | |
static formatting_list_entry * | aa_find_formatting_element (hubbub_treebuilder *treebuilder, element_type type) |
Adoption agency: find formatting element. More... | |
static hubbub_error | aa_find_furthest_block (hubbub_treebuilder *treebuilder, formatting_list_entry *formatting_element, uint32_t *furthest_block) |
Adoption agency: find furthest block. More... | |
static hubbub_error | aa_reparent_node (hubbub_treebuilder *treebuilder, void *node, void *new_parent, void **reparented) |
Adoption agency: reparent a node. More... | |
static hubbub_error | aa_find_bookmark_location_reparenting_misnested (hubbub_treebuilder *treebuilder, uint32_t formatting_element, uint32_t *furthest_block, bookmark *bookmark, uint32_t *last_node) |
Adoption agency: this is step 6. More... | |
static hubbub_error | aa_remove_element_stack_item (hubbub_treebuilder *treebuilder, uint32_t index, uint32_t limit) |
Adoption agency: remove an entry from the stack at the given index. More... | |
static hubbub_error | aa_clone_and_replace_entries (hubbub_treebuilder *treebuilder, formatting_list_entry *element) |
Adoption agency: shallow clone a node and replace its formatting list and element stack entries. More... | |
hubbub_error | handle_in_body (hubbub_treebuilder *treebuilder, const hubbub_token *token) |
Handle tokens in "in body" insertion mode. More... | |
hubbub_error | aa_insert_into_foster_parent (hubbub_treebuilder *treebuilder, void *node, void **inserted) |
Adoption agency: locate foster parent and insert node into it. More... | |
#define PROMPT "This is a searchable index. Insert your search keywords here: " |
Referenced by process_isindex_in_body().
|
static |
Adoption agency: shallow clone a node and replace its formatting list and element stack entries.
treebuilder | The treebuilder instance |
element | The item in the formatting list containing the node |
Definition at line 2176 of file in_body.c.
References hubbub_tree_handler::clone_node, hubbub_treebuilder::context, hubbub_tree_handler::ctx, formatting_list_entry::details, hubbub_treebuilder_context::element_stack, formatting_list_replace(), HUBBUB_OK, element_context::node, element_context::ns, hubbub_tree_handler::ref_node, formatting_list_entry::stack_index, hubbub_treebuilder::tree_handler, element_context::type, and hubbub_tree_handler::unref_node.
Referenced by aa_find_bookmark_location_reparenting_misnested().
|
static |
Adoption agency: find and validate the formatting element.
treebuilder | The treebuilder instance |
type | Element type to search for |
element | Pointer to location to receive list entry |
Definition at line 1857 of file in_body.c.
References aa_find_formatting_element(), hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, formatting_list_entry::details, element_in_scope(), formatting_list_remove(), HUBBUB_OK, HUBBUB_REPROCESS, formatting_list_entry::stack_index, hubbub_treebuilder::tree_handler, type, element_context::type, and hubbub_tree_handler::unref_node.
Referenced by process_0presentational_in_body().
|
static |
Adoption agency: this is step 6.
treebuilder | The treebuilder instance |
formatting_element | The stack index of the formatting element |
furthest_block | Pointer to index of furthest block in element stack (updated on exit) |
bookmark | Pointer to bookmark (pre-initialised) |
last_node | Pointer to location to receive index of last node |
Definition at line 2014 of file in_body.c.
References aa_clone_and_replace_entries(), aa_remove_element_stack_item(), aa_reparent_node(), hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, formatting_list_entry::details, hubbub_treebuilder_context::element_stack, hubbub_treebuilder_context::formatting_list_end, HUBBUB_OK, bookmark::next, formatting_list_entry::next, element_context::node, bookmark::prev, formatting_list_entry::prev, hubbub_tree_handler::ref_node, formatting_list_entry::stack_index, hubbub_treebuilder::tree_handler, and hubbub_tree_handler::unref_node.
Referenced by process_0presentational_in_body().
|
static |
Adoption agency: find formatting element.
treebuilder | The treebuilder instance |
type | Type of element to search for |
Definition at line 1906 of file in_body.c.
References hubbub_treebuilder::context, formatting_list_entry::details, hubbub_treebuilder_context::formatting_list_end, is_scoping_element(), formatting_list_entry::prev, type, and element_context::type.
Referenced by aa_find_and_validate_formatting_element(), and process_a_in_body().
|
static |
Adoption agency: find furthest block.
treebuilder | The treebuilder instance |
formatting_element | The formatting element |
furthest_block | Pointer to location to receive furthest block |
Definition at line 1936 of file in_body.c.
References hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, hubbub_treebuilder_context::element_stack, element_stack_pop(), formatting_list_remove(), HUBBUB_OK, HUBBUB_REPROCESS, is_formatting_element(), is_phrasing_element(), formatting_list_entry::stack_index, hubbub_treebuilder::tree_handler, type, element_context::type, and hubbub_tree_handler::unref_node.
Referenced by process_0presentational_in_body().
hubbub_error aa_insert_into_foster_parent | ( | hubbub_treebuilder * | treebuilder, |
void * | node, | ||
void ** | inserted | ||
) |
Adoption agency: locate foster parent and insert node into it.
treebuilder | The treebuilder instance |
node | The node to insert |
inserted | Pointer to location to receive inserted node |
Definition at line 2222 of file in_body.c.
References hubbub_tree_handler::append_child, hubbub_treebuilder::context, hubbub_tree_handler::ctx, current_table(), hubbub_treebuilder_context::element_stack, hubbub_tree_handler::get_parent, HUBBUB_OK, hubbub_tree_handler::insert_before, element_context::node, hubbub_tree_handler::ref_node, remove_node_from_dom(), element_context::tainted, hubbub_treebuilder::tree_handler, and hubbub_tree_handler::unref_node.
Referenced by append_text(), insert_element(), process_0presentational_in_body(), process_comment_append(), and reconstruct_active_formatting_list().
|
static |
Adoption agency: remove an entry from the stack at the given index.
treebuilder | The treebuilder instance |
index | The index of the item to remove |
limit | The index of the last item to move |
Preconditions: index < limit, limit <= current_node Postcondition: stack[limit] is empty
Definition at line 2129 of file in_body.c.
References hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::element_stack, hubbub_treebuilder_context::formatting_list_end, HTML, HUBBUB_OK, is_formatting_element(), is_scoping_element(), element_context::node, formatting_list_entry::prev, formatting_list_entry::stack_index, TABLE, hubbub_treebuilder::tree_handler, type, and hubbub_tree_handler::unref_node.
Referenced by aa_find_bookmark_location_reparenting_misnested(), and process_0presentational_in_body().
|
static |
Adoption agency: reparent a node.
treebuilder | The treebuilder instance |
node | The node to reparent |
new_parent | The new parent |
reparented | Pointer to location to receive reparented node |
Definition at line 1990 of file in_body.c.
References hubbub_tree_handler::append_child, hubbub_tree_handler::ctx, HUBBUB_OK, remove_node_from_dom(), and hubbub_treebuilder::tree_handler.
Referenced by aa_find_bookmark_location_reparenting_misnested(), and process_0presentational_in_body().
hubbub_error handle_in_body | ( | hubbub_treebuilder * | treebuilder, |
const hubbub_token * | token | ||
) |
Handle tokens in "in body" insertion mode.
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 123 of file in_body.c.
References BODY, hubbub_treebuilder::context, hubbub_treebuilder_context::current_node, DD, DT, hubbub_treebuilder_context::element_stack, element_stack_dump(), formatting_list_dump(), HUBBUB_OK, HUBBUB_TOKEN_CHARACTER, HUBBUB_TOKEN_COMMENT, HUBBUB_TOKEN_DOCTYPE, HUBBUB_TOKEN_END_TAG, HUBBUB_TOKEN_EOF, HUBBUB_TOKEN_START_TAG, LI, element_context::node, P, process_character(), process_comment_append(), process_end_tag(), process_start_tag(), hubbub_treebuilder_context::strip_leading_lr, TBODY, TD, TFOOT, TH, THEAD, TR, type, element_context::type, and hubbub_token::type.
Referenced by handle_after_after_body(), handle_after_after_frameset(), handle_after_body(), handle_after_frameset(), handle_after_head(), handle_before_head(), handle_in_caption(), handle_in_cell(), handle_in_column_group(), handle_in_frameset(), handle_in_head(), handle_in_head_noscript(), handle_in_select(), handle_in_table(), and hubbub_treebuilder_token_handler().
|
static |
Process an applet, button, marquee, or object end tag as if in "in body".
treebuilder | The treebuilder instance |
type | The element type |
Definition at line 2299 of file in_body.c.
References clear_active_formatting_list_to_marker(), close_implied_end_tags(), hubbub_tree_handler::ctx, element_in_scope(), element_stack_pop(), HUBBUB_OK, hubbub_treebuilder::tree_handler, type, UNKNOWN, and hubbub_tree_handler::unref_node.
Referenced by process_button_in_body(), and process_end_tag().
|
static |
Process a body end tag as if in "in body".
treebuilder | The treebuilder instance |
Definition at line 1401 of file in_body.c.
References AFTER_BODY, BODY, hubbub_treebuilder::context, hubbub_treebuilder_context::current_node, DD, DT, element_in_scope(), hubbub_treebuilder_context::element_stack, HUBBUB_OK, HUBBUB_REPROCESS, IN_BODY, LI, hubbub_treebuilder_context::mode, OPTGROUP, OPTION, P, RP, RT, TBODY, TD, TFOOT, TH, THEAD, TR, and element_context::type.
Referenced by process_end_tag().
|
static |
Process a br end tag as if in "in body".
treebuilder | The treebuilder instance |
Definition at line 2338 of file in_body.c.
References hubbub_tag::attributes, HUBBUB_NS_HTML, HUBBUB_OK, insert_element(), hubbub_string::len, hubbub_tag::n_attributes, hubbub_tag::name, hubbub_tag::ns, hubbub_string::ptr, reconstruct_active_formatting_list(), and SLEN.
Referenced by process_end_tag().
|
static |
Process a container end tag as if in "in body".
treebuilder | The treebuilder instance |
type | The element type |
Definition at line 1441 of file in_body.c.
References close_implied_end_tags(), hubbub_tree_handler::ctx, element_in_scope(), element_stack_pop(), HUBBUB_OK, hubbub_treebuilder::tree_handler, type, UNKNOWN, and hubbub_tree_handler::unref_node.
Referenced by process_end_tag(), and process_isindex_in_body().
|
static |
Process a dd, dt, or li end tag as if in "in body".
treebuilder | The treebuilder instance |
type | The element type |
Definition at line 1578 of file in_body.c.
References close_implied_end_tags(), hubbub_tree_handler::ctx, element_in_scope(), element_stack_pop(), HUBBUB_OK, hubbub_treebuilder::tree_handler, type, and hubbub_tree_handler::unref_node.
Referenced by process_end_tag().
|
static |
Process a form end tag as if in "in body".
treebuilder | The treebuilder instance |
Definition at line 1478 of file in_body.c.
References close_implied_end_tags(), hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, element_in_scope(), hubbub_treebuilder_context::element_stack, element_stack_remove(), FORM, hubbub_treebuilder_context::form_element, HUBBUB_OK, element_context::node, hubbub_treebuilder::tree_handler, UNKNOWN, and hubbub_tree_handler::unref_node.
Referenced by process_end_tag().
|
static |
Process a generic end tag as if in "in body".
treebuilder | The treebuilder instance |
type | The element type |
Definition at line 2367 of file in_body.c.
References close_implied_end_tags(), hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, hubbub_treebuilder_context::element_stack, element_stack_pop(), HUBBUB_OK, is_formatting_element(), is_phrasing_element(), hubbub_treebuilder::tree_handler, type, UNKNOWN, and hubbub_tree_handler::unref_node.
Referenced by process_end_tag(), process_isindex_in_body(), and process_opt_in_body().
|
static |
Process a h1, h2, h3, h4, h5, or h6 end tag as if in "in body".
treebuilder | The treebuilder instance |
type | The element type |
Definition at line 1617 of file in_body.c.
References close_implied_end_tags(), hubbub_tree_handler::ctx, element_in_scope(), element_stack_pop(), H1, H2, H3, H4, H5, H6, HUBBUB_OK, hubbub_treebuilder::tree_handler, type, UNKNOWN, hubbub_tree_handler::unref_node, and UNUSED.
Referenced by process_end_tag().
|
static |
Process a p end tag as if in "in body".
treebuilder | The treebuilder instance |
Definition at line 1524 of file in_body.c.
References hubbub_tag::attributes, hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, hubbub_token::data, element_in_scope(), hubbub_treebuilder_context::element_stack, element_stack_pop(), HUBBUB_NS_HTML, HUBBUB_OK, HUBBUB_TOKEN_START_TAG, hubbub_string::len, hubbub_tag::n_attributes, hubbub_tag::name, hubbub_tag::ns, P, process_container_in_body(), hubbub_string::ptr, SLEN, hubbub_token::tag, hubbub_treebuilder::tree_handler, type, element_context::type, hubbub_token::type, and hubbub_tree_handler::unref_node.
Referenced by process_container_in_body(), process_dd_dt_li_in_body(), process_end_tag(), process_form_in_body(), process_hN_in_body(), process_hr_in_body(), process_isindex_in_body(), and process_plaintext_in_body().
|
static |
Process a presentational end tag as if in "in body".
treebuilder | The treebuilder instance |
type | The element type |
Definition at line 1665 of file in_body.c.
References aa_find_and_validate_formatting_element(), aa_find_bookmark_location_reparenting_misnested(), aa_find_furthest_block(), aa_insert_into_foster_parent(), aa_remove_element_stack_item(), aa_reparent_node(), hubbub_tree_handler::append_child, hubbub_tree_handler::clone_node, hubbub_treebuilder::context, hubbub_tree_handler::ctx, formatting_list_entry::details, hubbub_treebuilder_context::element_stack, hubbub_treebuilder_context::formatting_list_end, formatting_list_insert(), formatting_list_remove(), HUBBUB_OK, HUBBUB_REPROCESS, bookmark::next, formatting_list_entry::next, element_context::node, bookmark::prev, formatting_list_entry::prev, hubbub_tree_handler::ref_node, hubbub_tree_handler::reparent_children, formatting_list_entry::stack_index, TABLE, TBODY, TFOOT, THEAD, TR, hubbub_treebuilder::tree_handler, type, element_context::type, and hubbub_tree_handler::unref_node.
Referenced by process_a_in_body(), process_end_tag(), and process_nobr_in_body().
|
static |
Process an "a" start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 759 of file in_body.c.
References A, aa_find_formatting_element(), hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, hubbub_token::data, formatting_list_entry::details, hubbub_treebuilder_context::element_stack, element_stack_pop(), element_stack_remove(), formatting_list_append(), formatting_list_remove(), HUBBUB_OK, insert_element(), element_context::node, hubbub_tag::ns, process_0presentational_in_body(), reconstruct_active_formatting_list(), hubbub_tree_handler::ref_node, remove_node_from_dom(), formatting_list_entry::stack_index, hubbub_token::tag, hubbub_treebuilder::tree_handler, type, and hubbub_tree_handler::unref_node.
Referenced by process_start_tag().
|
static |
Process an applet, marquee or object start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
type | The element type |
Definition at line 1042 of file in_body.c.
References hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, hubbub_token::data, hubbub_treebuilder_context::element_stack, element_stack_pop(), formatting_list_append(), hubbub_treebuilder_context::frameset_ok, HUBBUB_OK, insert_element(), element_context::node, hubbub_tag::ns, reconstruct_active_formatting_list(), hubbub_tree_handler::ref_node, remove_node_from_dom(), hubbub_token::tag, hubbub_treebuilder::tree_handler, type, and hubbub_tree_handler::unref_node.
Referenced by process_start_tag().
|
static |
Process a body start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 504 of file in_body.c.
References hubbub_tree_handler::add_attributes, hubbub_tag::attributes, BODY, hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, hubbub_token::data, hubbub_treebuilder_context::element_stack, HUBBUB_OK, hubbub_tag::n_attributes, element_context::node, hubbub_token::tag, hubbub_treebuilder::tree_handler, and element_context::type.
Referenced by process_start_tag().
|
static |
Process a button start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 978 of file in_body.c.
References BUTTON, hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, hubbub_token::data, element_in_scope(), hubbub_treebuilder_context::element_stack, element_stack_pop(), formatting_list_append(), hubbub_treebuilder_context::frameset_ok, HUBBUB_OK, insert_element(), element_context::node, hubbub_tag::ns, process_0applet_button_marquee_object_in_body(), reconstruct_active_formatting_list(), hubbub_tree_handler::ref_node, remove_node_from_dom(), hubbub_token::tag, hubbub_treebuilder::tree_handler, type, and hubbub_tree_handler::unref_node.
Referenced by process_start_tag().
|
static |
Process a character token.
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 192 of file in_body.c.
References append_text(), hubbub_token::character, hubbub_treebuilder::context, hubbub_token::data, hubbub_treebuilder_context::frameset_ok, HUBBUB_OK, hubbub_string::len, hubbub_string::ptr, reconstruct_active_formatting_list(), and hubbub_treebuilder_context::strip_leading_lr.
Referenced by handle_in_body(), and process_isindex_in_body().
|
static |
Process a generic container start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 561 of file in_body.c.
References hubbub_token::data, element_in_scope(), HUBBUB_OK, insert_element(), P, process_0p_in_body(), and hubbub_token::tag.
Referenced by process_0p_in_body(), process_isindex_in_body(), and process_start_tag().
|
static |
Process a dd, dt or li start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
type | The element type |
Definition at line 661 of file in_body.c.
References ADDRESS, hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, hubbub_token::data, DD, DIV, DT, element_in_scope(), hubbub_treebuilder_context::element_stack, element_stack_pop(), hubbub_treebuilder_context::frameset_ok, HUBBUB_OK, insert_element(), is_formatting_element(), is_phrasing_element(), LI, P, process_0p_in_body(), hubbub_token::tag, hubbub_treebuilder::tree_handler, type, element_context::type, and hubbub_tree_handler::unref_node.
Referenced by process_start_tag().
|
static |
Process an end tag.
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 416 of file in_body.c.
References A, ADDRESS, APPLET, AREA, ARTICLE, ASIDE, B, BASEFONT, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CENTER, CODE, hubbub_treebuilder::context, hubbub_token::data, DATAGRID, DD, DIR, DIV, DL, DT, element_type_from_name(), EM, EMBED, hubbub_treebuilder_context::enable_scripting, FIELDSET, FONT, FOOTER, FORM, H1, H2, H3, H4, H5, H6, HEADER, HR, HTML, HUBBUB_OK, HUBBUB_REPROCESS, I, IFRAME, IMAGE, IMG, INPUT, ISINDEX, LI, LISTING, MARQUEE, MENU, hubbub_tag::name, NAV, NOBR, NOEMBED, NOFRAMES, NOSCRIPT, OBJECT, OL, P, PARAM, PRE, process_0applet_button_marquee_object_in_body(), process_0body_in_body(), process_0br_in_body(), process_0container_in_body(), process_0dd_dt_li_in_body(), process_0form_in_body(), process_0generic_in_body(), process_0h_in_body(), process_0p_in_body(), process_0presentational_in_body(), S, SECTION, SELECT, SMALL, SPACER, STRIKE, STRONG, TABLE, hubbub_token::tag, TEXTAREA, TT, type, U, UL, and WBR.
Referenced by handle_in_body().
|
static |
Process a form start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 621 of file in_body.c.
References hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, hubbub_token::data, element_in_scope(), hubbub_treebuilder_context::element_stack, hubbub_treebuilder_context::form_element, HUBBUB_OK, insert_element(), element_context::node, P, process_0p_in_body(), hubbub_tree_handler::ref_node, hubbub_token::tag, and hubbub_treebuilder::tree_handler.
Referenced by process_isindex_in_body(), and process_start_tag().
|
static |
Process a frameset start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 526 of file in_body.c.
References BODY, hubbub_treebuilder::context, hubbub_treebuilder_context::current_node, hubbub_token::data, hubbub_treebuilder_context::element_stack, element_stack_pop_until(), hubbub_treebuilder_context::frameset_ok, HUBBUB_OK, IN_FRAMESET, insert_element(), hubbub_treebuilder_context::mode, element_context::node, remove_node_from_dom(), hubbub_token::tag, and element_context::type.
Referenced by process_start_tag().
|
static |
Process a hN start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 581 of file in_body.c.
References hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, hubbub_token::data, element_in_scope(), hubbub_treebuilder_context::element_stack, element_stack_pop(), H1, H2, H3, H4, H5, H6, HUBBUB_OK, insert_element(), P, process_0p_in_body(), hubbub_token::tag, hubbub_treebuilder::tree_handler, type, element_context::type, and hubbub_tree_handler::unref_node.
Referenced by process_start_tag().
|
static |
Process an hr start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 1097 of file in_body.c.
References hubbub_treebuilder::context, hubbub_token::data, element_in_scope(), hubbub_treebuilder_context::frameset_ok, HUBBUB_OK, insert_element(), P, process_0p_in_body(), and hubbub_token::tag.
Referenced by process_isindex_in_body(), and process_start_tag().
|
static |
Process a html start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 486 of file in_body.c.
References hubbub_tree_handler::add_attributes, hubbub_tag::attributes, hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_token::data, hubbub_treebuilder_context::element_stack, hubbub_tag::n_attributes, element_context::node, hubbub_token::tag, and hubbub_treebuilder::tree_handler.
Referenced by process_start_tag().
|
static |
Process an image start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 1121 of file in_body.c.
References hubbub_tag::attributes, hubbub_token::data, HUBBUB_NS_HTML, HUBBUB_OK, insert_element(), hubbub_string::len, hubbub_tag::n_attributes, hubbub_tag::name, hubbub_tag::ns, hubbub_string::ptr, reconstruct_active_formatting_list(), SLEN, and hubbub_token::tag.
Referenced by process_start_tag().
|
static |
Process an isindex start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 1147 of file in_body.c.
References hubbub_tag::attributes, hubbub_token::character, hubbub_treebuilder::context, hubbub_token::data, FORM, hubbub_treebuilder_context::form_element, hubbub_treebuilder_context::frameset_ok, HUBBUB_NOMEM, HUBBUB_NS_HTML, HUBBUB_OK, HUBBUB_TOKEN_CHARACTER, HUBBUB_TOKEN_START_TAG, insert_element(), LABEL, hubbub_string::len, hubbub_tag::n_attributes, name, hubbub_attribute::name, hubbub_tag::name, hubbub_attribute::ns, hubbub_tag::ns, process_0container_in_body(), process_0generic_in_body(), process_0p_in_body(), process_character(), process_container_in_body(), process_form_in_body(), process_hr_in_body(), process_phrasing_in_body(), PROMPT, hubbub_string::ptr, reconstruct_active_formatting_list(), SLEN, hubbub_token::tag, hubbub_token::type, and hubbub_attribute::value.
Referenced by process_start_tag().
|
static |
Process a nobr start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 912 of file in_body.c.
References hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, hubbub_token::data, element_in_scope(), hubbub_treebuilder_context::element_stack, element_stack_pop(), formatting_list_append(), HUBBUB_OK, insert_element(), NOBR, element_context::node, hubbub_tag::ns, process_0presentational_in_body(), reconstruct_active_formatting_list(), hubbub_tree_handler::ref_node, remove_node_from_dom(), hubbub_token::tag, hubbub_treebuilder::tree_handler, type, and hubbub_tree_handler::unref_node.
Referenced by process_start_tag().
|
static |
Process an option or optgroup start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 1359 of file in_body.c.
References hubbub_token::data, element_in_scope(), HUBBUB_OK, insert_element(), OPTION, process_0generic_in_body(), reconstruct_active_formatting_list(), and hubbub_token::tag.
Referenced by process_start_tag().
|
static |
Process a phrasing start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 1383 of file in_body.c.
References hubbub_token::data, HUBBUB_OK, insert_element(), reconstruct_active_formatting_list(), and hubbub_token::tag.
Referenced by process_isindex_in_body(), and process_start_tag().
|
static |
Process a plaintext start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 727 of file in_body.c.
References hubbub_tokeniser_optparams::content_model, hubbub_token::data, element_in_scope(), HUBBUB_CONTENT_MODEL_PLAINTEXT, HUBBUB_OK, HUBBUB_TOKENISER_CONTENT_MODEL, hubbub_tokeniser_setopt(), insert_element(), hubbub_tokeniser_optparams::model, P, process_0p_in_body(), hubbub_token::tag, and hubbub_treebuilder::tokeniser.
Referenced by process_start_tag().
|
static |
Process a b, big, em, font, i, s, small, strike, strong, tt, or u start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
type | The element type |
Definition at line 861 of file in_body.c.
References hubbub_treebuilder::context, hubbub_tree_handler::ctx, hubbub_treebuilder_context::current_node, hubbub_token::data, hubbub_treebuilder_context::element_stack, element_stack_pop(), formatting_list_append(), HUBBUB_OK, insert_element(), element_context::node, hubbub_tag::ns, reconstruct_active_formatting_list(), hubbub_tree_handler::ref_node, remove_node_from_dom(), hubbub_token::tag, hubbub_treebuilder::tree_handler, type, and hubbub_tree_handler::unref_node.
Referenced by process_start_tag().
|
static |
Process a select start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 1337 of file in_body.c.
References hubbub_treebuilder::context, hubbub_token::data, hubbub_treebuilder_context::frameset_ok, HUBBUB_OK, insert_element(), reconstruct_active_formatting_list(), and hubbub_token::tag.
Referenced by process_start_tag().
|
static |
Process a start tag.
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 247 of file in_body.c.
References A, ADDRESS, adjust_foreign_attributes(), adjust_mathml_attributes(), adjust_svg_attributes(), APPLET, AREA, ARTICLE, ASIDE, B, BASE, BASEFONT, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CODE, COL, COLGROUP, COMMAND, hubbub_treebuilder::context, current_table(), hubbub_token::data, DATAGRID, DD, DETAILS, DIALOG, DIR, DIV, DL, DT, hubbub_treebuilder_context::element_stack, element_type_from_name(), EM, EMBED, hubbub_treebuilder_context::enable_scripting, FIELDSET, FIGURE, FONT, FOOTER, FORM, FRAME, FRAMESET, hubbub_treebuilder_context::frameset_ok, H1, H2, H3, H4, H5, H6, handle_in_head(), HEAD, HEADER, HR, HTML, HUBBUB_NS_MATHML, HUBBUB_NS_SVG, HUBBUB_OK, I, IFRAME, IMAGE, IMG, IN_BODY, IN_CAPTION, IN_CELL, IN_COLUMN_GROUP, IN_FOREIGN_CONTENT, IN_ROW, IN_SELECT, IN_SELECT_IN_TABLE, IN_TABLE, IN_TABLE_BODY, INPUT, insert_element(), ISINDEX, LI, LINK, LISTING, MARQUEE, MATH, MENU, META, hubbub_treebuilder_context::mode, hubbub_tag::name, NAV, NOBR, NOEMBED, NOFRAMES, NOSCRIPT, hubbub_tag::ns, OBJECT, OL, OPTGROUP, OPTION, P, PARAM, parse_generic_rcdata(), PLAINTEXT, PRE, process_a_in_body(), process_applet_marquee_object_in_body(), process_body_in_body(), process_button_in_body(), process_container_in_body(), process_dd_dt_li_in_body(), process_form_in_body(), process_frameset_in_body(), process_hN_in_body(), process_hr_in_body(), process_html_in_body(), process_image_in_body(), process_isindex_in_body(), process_nobr_in_body(), process_opt_in_body(), process_phrasing_in_body(), process_plaintext_in_body(), process_presentational_in_body(), process_select_in_body(), process_textarea_in_body(), reconstruct_active_formatting_list(), RP, RT, S, SCRIPT, hubbub_treebuilder_context::second_mode, SECTION, SELECT, hubbub_tag::self_closing, SMALL, SPACER, STRIKE, hubbub_treebuilder_context::strip_leading_lr, STRONG, STYLE, SVG, TABLE, hubbub_token::tag, element_context::tainted, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, type, U, UL, WBR, and XMP.
Referenced by handle_in_body().
|
static |
Process a textarea start tag as if in "in body".
treebuilder | The treebuilder instance |
token | The token to process |
Definition at line 1323 of file in_body.c.
References hubbub_treebuilder::context, hubbub_treebuilder_context::frameset_ok, parse_generic_rcdata(), and hubbub_treebuilder_context::strip_leading_lr.
Referenced by process_start_tag().