NetSurf
|
Private data for text/html content. More...
#include <dom/bindings/hubbub/parser.h>
#include "netsurf/types.h"
#include "content/content_protected.h"
#include "content/handlers/css/utils.h"
Go to the source code of this file.
Data Structures | |
union | html_drag_owner |
For drags we don't own. More... | |
union | html_selection_owner |
For getting at selections in this content or things in this content. More... | |
union | html_focus_owner |
For directing input. More... | |
struct | html_content |
Data specific to CONTENT_HTML. More... | |
Typedefs | |
typedef struct html_content | html_content |
Data specific to CONTENT_HTML. More... | |
Functions | |
void | html__redraw_a_box (html_content *htmlc, struct box *box) |
redraw a box More... | |
void | html_finish_conversion (html_content *htmlc) |
Complete conversion of an HTML document. More... | |
bool | html_can_begin_conversion (html_content *htmlc) |
Test if an HTML content conversion can begin. More... | |
bool | html_begin_conversion (html_content *htmlc) |
Begin conversion of an HTML document. More... | |
bool | html_exec (struct content *c, const char *src, size_t srclen) |
execute some text as a script element More... | |
nserror | html_script_exec (html_content *htmlc, bool allow_defer) |
Attempt script execution for defer and async scripts. More... | |
nserror | html_script_free (html_content *htmlc) |
Free all script resources and references for a html content. More... | |
bool | html_saw_insecure_scripts (html_content *htmlc) |
Check if any of the scripts loaded were insecure. More... | |
nserror | html_proceed_to_done (html_content *html) |
Complete the HTML content state machine iff all scripts are finished. More... | |
bool | html_redraw (struct content *c, struct content_redraw_data *data, const struct rect *clip, const struct redraw_context *ctx) |
Draw a CONTENT_HTML using the current set of plotters (plot). More... | |
bool | html_redraw_borders (struct box *box, int x_parent, int y_parent, int p_width, int p_height, const struct rect *clip, float scale, const struct redraw_context *ctx) |
Draw borders for a box. More... | |
bool | html_redraw_inline_borders (struct box *box, struct rect b, const struct rect *clip, float scale, bool first, bool last, const struct redraw_context *ctx) |
Draw an inline's borders. More... | |
dom_hubbub_error | html_process_script (void *ctx, dom_node *node) |
process script node parser callback More... | |
struct form * | html_forms_get_forms (const char *docenc, dom_html_document *doc) |
struct form_control * | html_forms_get_control_for_node (struct form *forms, dom_node *node) |
nserror | html_css_fetcher_register (void) |
Register the fetcher for the pseudo x-ns-css scheme. More... | |
nserror | html_css_fetcher_add_item (dom_string *data, struct nsurl *base_url, uint32_t *key) |
bool | fire_generic_dom_event (dom_string *type, dom_node *target, bool bubbles, bool cancelable) |
Construct an event and fire it at the DOM. More... | |
bool | fire_dom_keyboard_event (dom_string *type, dom_node *target, bool bubbles, bool cancelable, uint32_t key) |
Construct a keyboard event and fire it at the DOM. More... | |
Variables | |
bool | html_redraw_debug |
Render padding and margin box outlines in html_redraw(). More... | |
struct dom_string * | html_dom_string_map |
struct dom_string * | html_dom_string_id |
struct dom_string * | html_dom_string_name |
struct dom_string * | html_dom_string_area |
struct dom_string * | html_dom_string_a |
struct dom_string * | html_dom_string_nohref |
struct dom_string * | html_dom_string_href |
struct dom_string * | html_dom_string_target |
struct dom_string * | html_dom_string_shape |
struct dom_string * | html_dom_string_default |
struct dom_string * | html_dom_string_rect |
struct dom_string * | html_dom_string_rectangle |
struct dom_string * | html_dom_string_coords |
struct dom_string * | html_dom_string_circle |
struct dom_string * | html_dom_string_poly |
struct dom_string * | html_dom_string_polygon |
struct dom_string * | html_dom_string_text_javascript |
struct dom_string * | html_dom_string_type |
struct dom_string * | html_dom_string_src |
Private data for text/html content.
Definition in file private.h.
typedef struct html_content html_content |
Data specific to CONTENT_HTML.
enum html_drag_type |
enum html_focus_type |
enum html_selection_type |
bool fire_dom_keyboard_event | ( | dom_string * | type, |
dom_node * | target, | ||
bool | bubbles, | ||
bool | cancelable, | ||
uint32_t | key | ||
) |
Construct a keyboard event and fire it at the DOM.
Definition at line 133 of file html.c.
References fire_dom_event(), NS_KEY_DOWN, NS_KEY_ESCAPE, NS_KEY_LEFT, NS_KEY_PAGE_DOWN, NS_KEY_PAGE_UP, NS_KEY_RIGHT, NS_KEY_TEXT_END, NS_KEY_TEXT_START, NS_KEY_UP, NSLOG, result, type, and utf8_from_ucs4().
Referenced by html_keypress().
bool fire_generic_dom_event | ( | dom_string * | type, |
dom_node * | target, | ||
bool | bubbles, | ||
bool | cancelable | ||
) |
Construct an event and fire it at the DOM.
Definition at line 111 of file html.c.
References fire_dom_event(), NSLOG, result, and type.
Referenced by mouse_action_drag_none().
void html__redraw_a_box | ( | struct html_content * | html, |
struct box * | box | ||
) |
redraw a box
htmlc | HTML content |
box | The box to redraw. |
redraw a box
html | content containing the box, of type CONTENT_HTML |
box | box to redraw. |
Definition at line 1130 of file html.c.
References BOTTOM, box_coords(), content__request_redraw(), box::height, LEFT, box::padding, RIGHT, TOP, box::width, box::x, and box::y.
Referenced by form__select_process_selection(), form_radio_set(), gadget_mouse_action(), html__set_file_gadget_filename(), html_overflow_scroll_callback(), and html_texty_element_update().
bool html_begin_conversion | ( | html_content * | htmlc | ) |
Begin conversion of an HTML document.
htmlc | Content to convert |
Definition at line 833 of file html.c.
References html_content::aborted, form::action, content::active, html_content::base, html_content::base_url, content_broadcast_error(), content_get_url(), content_set_error(), html_content::conversion_begun, html_content::document, form::document_charset, html_content::encoding, html_content::encoding_source, html_content::forms, html_can_begin_conversion(), html_finish_conversion(), html_forms_get_forms(), html_script_exec(), libdom_hubbub_error_to_nserror(), node_name(), NSERROR_DOM, NSERROR_NOMEM, NSERROR_OK, NSERROR_STOPPED, NSLOG, nsurl_access(), nsurl_join(), nsurl_unref(), html_content::parse_completed, html_content::parser, and form::prev.
Referenced by convert_script_async_cb(), convert_script_defer_cb(), convert_script_sync_cb(), html_convert(), and html_convert_css_callback().
bool html_can_begin_conversion | ( | html_content * | htmlc | ) |
Test if an HTML content conversion can begin.
htmlc | html content to test |
Definition at line 814 of file html.c.
References content::active, html_content::base, html_stylesheet::modified, html_content::stylesheet_count, and html_content::stylesheets.
Referenced by convert_script_async_cb(), convert_script_defer_cb(), convert_script_sync_cb(), html_begin_conversion(), html_convert(), and html_convert_css_callback().
Definition at line 305 of file css_fetcher.c.
References html_css_fetcher_item::base_url, current_key, html_css_fetcher_item::data, items, html_css_fetcher_item::key, NSERROR_NOMEM, NSERROR_OK, nsurl_ref(), and RING_INSERT.
Referenced by html_stylesheet_from_domnode().
nserror html_css_fetcher_register | ( | void | ) |
Register the fetcher for the pseudo x-ns-css scheme.
Definition at line 286 of file css_fetcher.c.
References fetcher_add(), html_css_fetcher_abort(), html_css_fetcher_can_fetch(), html_css_fetcher_finalise(), html_css_fetcher_free(), html_css_fetcher_initialise(), html_css_fetcher_poll(), html_css_fetcher_setup(), html_css_fetcher_start(), and fetcher_operation_table::initialise.
Referenced by html_css_init().
bool html_exec | ( | struct content * | c, |
const char * | src, | ||
size_t | srclen | ||
) |
execute some text as a script element
Definition at line 2090 of file html.c.
References html_content::document, NSLOG, and result.
Referenced by mouse_action_drag_none().
void html_finish_conversion | ( | html_content * | htmlc | ) |
Complete conversion of an HTML document.
htmlc | Content to convert |
Definition at line 341 of file html.c.
References html_content::aborted, html_content::base, html_content::box_conversion_context, content_broadcast(), content_broadcast_error(), CONTENT_MSG_STATUS, content_set_error(), content_set_status(), html_content::document, dom_to_box(), content_msg_data::explicit_status_text, html_box_convert_done(), html_css_new_selection_context(), html_get_dimensions(), html_object_free_objects(), js_fire_event(), html_content::jsthread, messages_get(), NSERROR_DOM, NSERROR_OK, NSERROR_STOPPED, NSLOG, and html_content::select_ctx.
Referenced by html_begin_conversion().
struct form_control * html_forms_get_control_for_node | ( | struct form * | forms, |
dom_node * | node | ||
) |
Definition at line 545 of file forms.c.
References form::controls, invent_fake_gadget(), form_control::next, form_control::node, parse_button_element(), parse_input_element(), parse_select_element(), parse_textarea_element(), and form::prev.
Referenced by box_button(), box_input(), box_select(), and box_textarea().
struct form * html_forms_get_forms | ( | const char * | docenc, |
dom_html_document * | doc | ||
) |
Definition at line 126 of file forms.c.
References form::node, parse_form_element(), and form::prev.
Referenced by html_begin_conversion().
nserror html_proceed_to_done | ( | html_content * | html | ) |
Complete the HTML content state machine iff all scripts are finished.
Definition at line 285 of file html.c.
References content::active, html_content::base, content__get_status(), content_set_done(), CONTENT_STATUS_DONE, CONTENT_STATUS_LOADING, CONTENT_STATUS_READY, NSERROR_OK, NSERROR_UNKNOWN, and NSLOG.
Referenced by html_box_convert_done(), and html_script_exec().
dom_hubbub_error html_process_script | ( | void * | ctx, |
dom_node * | node | ||
) |
process script node parser callback
Definition at line 566 of file script.c.
References html_content::base, content_broadcast(), CONTENT_MSG_GETTHREAD, exec_inline_script(), exec_src_script(), content_msg_data::jsthread, html_content::jsthread, html_script::mimetype, NSLOG, html_content::parser, and content_msg_data::src.
Referenced by dom_SCRIPT_showed_up(), html_create_html_data(), and html_process_encoding_change().
bool html_redraw | ( | struct content * | c, |
struct content_redraw_data * | data, | ||
const struct rect * | clip, | ||
const struct redraw_context * | ctx | ||
) |
Draw a CONTENT_HTML using the current set of plotters (plot).
c | content of type CONTENT_HTML |
data | redraw data for this content redraw |
clip | current clip region |
ctx | current redraw context |
x, y, clip_[xy][01] are in target coordinates.
Definition at line 1944 of file redraw.c.
References html_content::background_colour, content_redraw_data::background_colour, box::border, BOTTOM, form_control::box, box_coords(), clip(), plotter_table::clip, form_control::data, plot_style_s::fill_colour, plot_style_s::fill_type, form_clip_inside_select_menu(), form_redraw_select_menu(), box::height, form_control::html, html_redraw_box(), redraw_context::interactive, html_content::layout, LEFT, NS_TRANSPARENT, NSERROR_OK, box::padding, redraw_context::plot, PLOT_OP_TYPE_SOLID, plotter_table::rectangle, result, form_control::select, TOP, html_content::visible_select_menu, and box_border::width.
bool html_redraw_borders | ( | struct box * | box, |
int | x_parent, | ||
int | y_parent, | ||
int | p_width, | ||
int | p_height, | ||
const struct rect * | clip, | ||
float | scale, | ||
const struct redraw_context * | ctx | ||
) |
Draw borders for a box.
box | box to draw |
x_parent | coordinate of left padding edge of parent of box |
y_parent | coordinate of top padding edge of parent of box |
p_width | width of padding box |
p_height | height of padding box |
clip | cliping area for redrawing border. |
scale | scale for redraw |
ctx | current redraw context |
Definition at line 444 of file redraw_border.c.
References box::border, BOTTOM, box_border::c, clip(), html_redraw_border_plot(), LEFT, nscss_color_is_transparent, nscss_color_to_ns, NSERROR_OK, RIGHT, box_border::style, box::style, TOP, box_border::width, box::x, and box::y.
Referenced by html_redraw_box().
bool html_redraw_inline_borders | ( | struct box * | box, |
struct rect | b, | ||
const struct rect * | clip, | ||
float | scale, | ||
bool | first, | ||
bool | last, | ||
const struct redraw_context * | ctx | ||
) |
Draw an inline's borders.
box | BOX_INLINE which created the border |
b | coordinates of border edge rectangle |
clip | cliping area for redrawing border. |
scale | scale for redraw |
first | true if this is the first rectangle associated with the inline |
last | true if this is the last rectangle associated with the inline |
ctx | current redraw context |
Definition at line 707 of file redraw_border.c.
References box::border, BOTTOM, box_border::c, clip(), html_redraw_border_plot(), LEFT, nscss_color_is_transparent, nscss_color_to_ns, NSERROR_OK, RIGHT, box_border::style, box::style, TOP, box_border::width, rect::x0, rect::x1, rect::y0, and rect::y1.
Referenced by html_redraw_box().
bool html_saw_insecure_scripts | ( | html_content * | htmlc | ) |
Check if any of the scripts loaded were insecure.
Definition at line 611 of file script.c.
References content_saw_insecure_objects(), html_script::data, html_script::handle, html_script::HTML_SCRIPT_INLINE, html_content::scripts, html_content::scripts_count, and html_script::type.
Referenced by html_saw_insecure_objects().
nserror html_script_exec | ( | html_content * | htmlc, |
bool | allow_defer | ||
) |
Attempt script execution for defer and async scripts.
execute scripts using algorithm found in: http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#the-script-element
htmlc | html content. |
allow_defer | allow deferred execution, if not, only async scripts. |
Definition at line 59 of file script.c.
References html_script::already_started, content_get_source_data(), content_get_status(), content_get_type(), CONTENT_STATUS_DONE, CONTENT_STATUS_ERROR, html_script::data, html_script::handle, hlcache_handle_get_url(), html_proceed_to_done(), html_script::HTML_SCRIPT_ASYNC, html_script::HTML_SCRIPT_DEFER, html_content::jsthread, NSERROR_BAD_PARAMETER, NSERROR_OK, nsurl_access(), html_content::scripts, html_content::scripts_count, select_script_handler(), and html_script::type.
Referenced by convert_script_async_cb(), and html_begin_conversion().
nserror html_script_free | ( | html_content * | htmlc | ) |
Free all script resources and references for a html content.
htmlc | html content. |
Definition at line 636 of file script.c.
References html_script::data, html_script::handle, hlcache_handle_release(), html_script::HTML_SCRIPT_ASYNC, html_script::HTML_SCRIPT_DEFER, html_script::HTML_SCRIPT_INLINE, html_script::HTML_SCRIPT_SYNC, html_script::mimetype, NSERROR_OK, html_content::scripts, html_content::scripts_count, html_script::string, and html_script::type.
Referenced by html_destroy().
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Render padding and margin box outlines in html_redraw().
Definition at line 68 of file redraw.c.
Referenced by html_redraw_box().