NetSurf
|
Implementation of HTML content handling. More...
#include <assert.h>
#include <stdint.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include <nsutils/time.h>
#include "utils/utils.h"
#include "utils/config.h"
#include "utils/corestrings.h"
#include "utils/http.h"
#include "utils/libdom.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/talloc.h"
#include "utils/utf8.h"
#include "utils/nsoption.h"
#include "utils/ascii.h"
#include "netsurf/content.h"
#include "netsurf/browser_window.h"
#include "netsurf/utf8.h"
#include "netsurf/keypress.h"
#include "netsurf/layout.h"
#include "netsurf/misc.h"
#include "content/hlcache.h"
#include "content/content_factory.h"
#include "content/textsearch.h"
#include "desktop/selection.h"
#include "desktop/scrollbar.h"
#include "desktop/textarea.h"
#include "netsurf/bitmap.h"
#include "javascript/js.h"
#include "desktop/gui_internal.h"
#include "html/html.h"
#include "html/private.h"
#include "html/dom_event.h"
#include "html/css.h"
#include "html/object.h"
#include "html/html_save.h"
#include "html/interaction.h"
#include "html/box.h"
#include "html/box_construct.h"
#include "html/box_inspect.h"
#include "html/form_internal.h"
#include "html/imagemap.h"
#include "html/layout.h"
#include "html/textselection.h"
Go to the source code of this file.
Macros | |
#define | CHUNK 4096 |
#define | ALWAYS_DUMP_FRAMESET 0 |
#define | ALWAYS_DUMP_BOX 0 |
Functions | |
static bool | fire_dom_event (dom_event *event, dom_node *target) |
Fire an event at the DOM. More... | |
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... | |
static void | html_box_convert_done (html_content *c, bool success) |
Perform post-box-creation conversion of a document. More... | |
nserror | html_proceed_to_done (html_content *html) |
Complete the HTML content state machine iff all scripts are finished. More... | |
static void | html_get_dimensions (html_content *htmlc) |
void | html_finish_conversion (html_content *htmlc) |
Complete conversion of an HTML document. More... | |
static void | html_document_user_data_handler (dom_node_operation operation, dom_string *key, void *data, struct dom_node *src, struct dom_node *dst) |
static nserror | html_create_html_data (html_content *c, const http_parameter *params) |
static nserror | html_create (const content_handler *handler, lwc_string *imime_type, const http_parameter *params, llcache_handle *llcache, const char *fallback_charset, bool quirks, struct content **c) |
Create a CONTENT_HTML. More... | |
static nserror | html_process_encoding_change (struct content *c, const char *data, unsigned int size) |
static bool | html_process_data (struct content *c, const char *data, unsigned int size) |
Process data for CONTENT_HTML. More... | |
static bool | html_convert (struct content *c) |
Convert a CONTENT_HTML for display. 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... | |
static void | html_stop (struct content *c) |
Stop loading a CONTENT_HTML. More... | |
static void | html_reformat (struct content *c, int width, int height) |
Reformat a CONTENT_HTML to a new width. More... | |
void | html_redraw_a_box (hlcache_handle *h, struct box *box) |
Redraw a box. More... | |
void | html__redraw_a_box (struct html_content *html, struct box *box) |
Redraw a box. More... | |
static void | html_destroy_frameset (struct content_html_frames *frameset) |
static void | html_destroy_iframe (struct content_html_iframe *iframe) |
static void | html_free_layout (html_content *htmlc) |
static void | html_destroy (struct content *c) |
Destroy a CONTENT_HTML and free all resources it owns. More... | |
static nserror | html_clone (const struct content *old, struct content **newc) |
static nserror | html_open (struct content *c, struct browser_window *bw, struct content *page, struct object_params *params) |
Handle a window containing a CONTENT_HTML being opened. More... | |
static nserror | html_close (struct content *c) |
Handle a window containing a CONTENT_HTML being closed. More... | |
static void | html_clear_selection (struct content *c) |
Return an HTML content's selection context. More... | |
static char * | html_get_selection (struct content *c) |
Return an HTML content's selection context. More... | |
static nserror | html_get_contextual_content (struct content *c, int x, int y, struct browser_window_features *data) |
Get access to any content, link URLs and objects (images) currently at the given (x, y) coordinates. More... | |
static bool | html_scroll_at_point (struct content *c, int x, int y, int scrx, int scry) |
Scroll deepest thing within the content which can be scrolled at given point. More... | |
static void | html__dom_user_data_handler (dom_node_operation operation, dom_string *key, void *_data, struct dom_node *src, struct dom_node *dst) |
Helper for file gadgets to store their filename unencoded on the dom node associated with the gadget. More... | |
static void | html__set_file_gadget_filename (struct content *c, struct form_control *gadget, const char *fn) |
void | html_set_file_gadget_filename (struct hlcache_handle *hl, struct form_control *gadget, const char *fn) |
set filename on a file gadget More... | |
static bool | html_drop_file_at_point (struct content *c, int x, int y, char *file) |
Drop a file onto a content at a particular point, or determine if a file may be dropped onto the content at given point. More... | |
static nserror | html_debug (struct content *c, enum content_debug op) |
set debug status. More... | |
static nserror | html_debug_dump (struct content *c, FILE *f, enum content_debug op) |
Dump debug info concerning the html_content. More... | |
dom_document * | html_get_document (hlcache_handle *h) |
Retrieve HTML document tree. More... | |
struct box * | html_get_box_tree (hlcache_handle *h) |
Retrieve box tree. More... | |
static const char * | html_encoding (const struct content *c, enum content_encoding_type op) |
Retrieve the charset of an HTML document. More... | |
struct content_html_frames * | html_get_frameset (hlcache_handle *h) |
Retrieve framesets used in an HTML document. More... | |
struct content_html_iframe * | html_get_iframe (hlcache_handle *h) |
Retrieve iframes used in an HTML document. More... | |
nsurl * | html_get_base_url (hlcache_handle *h) |
Retrieve an HTML content's base URL. More... | |
const char * | html_get_base_target (hlcache_handle *h) |
Retrieve an HTML content's base target. More... | |
bool | html_get_id_offset (hlcache_handle *h, lwc_string *frag_id, int *x, int *y) |
Retrieve layout coordinates of box with given id. More... | |
bool | html_exec (struct content *c, const char *src, size_t srclen) |
execute some text as a script element More... | |
static bool | html_saw_insecure_objects (struct content *c) |
static content_type | html_content_type (void) |
Compute the type of a content. More... | |
static void | html_fini (void) |
static nserror | find_occurrences_html_box (const char *pattern, int p_len, struct box *cur, bool case_sens, struct textsearch_context *context) |
Finds all occurrences of a given string in an html box. More... | |
static nserror | html_textsearch_find (struct content *c, struct textsearch_context *context, const char *pattern, int p_len, bool csens) |
Finds all occurrences of a given string in the html box tree. More... | |
static nserror | html_textsearch_bounds (struct content *c, unsigned start_idx, unsigned end_idx, struct box *start_box, struct box *end_box, struct rect *bounds) |
nserror | html_init (void) |
initialise content handler More... | |
Variables | |
static const char * | html_types [] |
static const content_handler | html_content_handler |
HTML content handler function table. More... | |
Implementation of HTML content handling.
Definition in file html.c.
|
static |
Finds all occurrences of a given string in an html box.
pattern | the string pattern to search for |
p_len | pattern length |
cur | pointer to the current box |
case_sens | whether to perform a case sensitive search |
context | The search context to add the entry to. |
Definition at line 2230 of file html.c.
References box::byte_offset, box::children, content_textsearch_add_match(), content_textsearch_find_pattern(), find_occurrences_html_box(), box::length, box::next, NSERROR_OK, box::object, box::text, and text().
Referenced by find_occurrences_html_box(), and html_textsearch_find().
|
static |
Fire an event at the DOM.
Helper that swallows DOM errors.
[in] | event | the event to fire at the DOM |
[in] | target | the event target |
Definition at line 97 of file html.c.
References result.
Referenced by fire_dom_keyboard_event(), and fire_generic_dom_event().
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().
|
static |
Helper for file gadgets to store their filename unencoded on the dom node associated with the gadget.
Definition at line 1597 of file html.c.
References html__dom_user_data_handler(), and NSLOG.
Referenced by html__dom_user_data_handler(), and html__set_file_gadget_filename().
void html__redraw_a_box | ( | struct html_content * | html, |
struct box * | box | ||
) |
Redraw a box.
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().
|
static |
Definition at line 1634 of file html.c.
References form_control::box, form_gadget_update_value(), box::gadget, guit, html__dom_user_data_handler(), html__redraw_a_box(), gui_utf8_table::local_to_utf8, form_control::node, NSERROR_BAD_ENCODING, NSERROR_OK, NSLOG, and netsurf_table::utf8.
Referenced by html_drop_file_at_point(), and html_set_file_gadget_filename().
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().
|
static |
Perform post-box-creation conversion of a document.
c | HTML content to complete conversion of |
success | Whether box tree construction was successful |
Definition at line 216 of file html.c.
References html_content::aborted, html_content::base, html_content::box_conversion_context, box_dump(), box::children, content_broadcast_error(), content_set_error(), content_set_ready(), html_content::document, html_content::frameset, html_object_free_objects(), html_proceed_to_done(), imagemap_extract(), html_content::layout, NSERROR_BOX_CONVERT, NSERROR_DOM, NSERROR_OK, NSERROR_STOPPED, NSLOG, and html_content::parser.
Referenced by html_finish_conversion().
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().
|
static |
Return an HTML content's selection context.
Definition at line 1383 of file html.c.
References html_selection_owner::content, content_clear_selection(), HTML_SELECTION_CONTENT, HTML_SELECTION_NONE, HTML_SELECTION_SELF, HTML_SELECTION_TEXTAREA, html_selection_owner::none, box::object, html_content::sel, selection_clear(), html_content::selection_owner, html_content::selection_type, box::text, html_selection_owner::textarea, and textarea_clear_selection().
Handle a window containing a CONTENT_HTML being closed.
Definition at line 1357 of file html.c.
References html_content::bw, html_object_close_objects(), js_closethread(), html_content::jsthread, NSERROR_OK, html_content::sel, and selection_clear().
|
static |
Compute the type of a content.
Definition at line 2208 of file html.c.
References CONTENT_HTML.
|
static |
Convert a CONTENT_HTML for display.
The following steps are carried out in order:
On exit, the content status will be either CONTENT_STATUS_DONE if the document is completely loaded or CONTENT_STATUS_READY if objects are still being fetched.
Definition at line 777 of file html.c.
References content::active, html_content::base, html_content::document, html_begin_conversion(), html_can_begin_conversion(), html_css_quirks_stylesheets(), NSLOG, and html_content::quirks.
|
static |
Create a CONTENT_HTML.
The content_html_data structure is initialized and the HTML parser is created.
Definition at line 605 of file html.c.
References html_content::base, content__init(), content_broadcast_error(), html_create_html_data(), html_css_new_stylesheets(), llcache, NSERROR_NOMEM, and NSERROR_OK.
|
static |
Definition at line 453 of file html.c.
References html_content::aborted, content::active, html_content::background_colour, html_content::base, html_content::base_target, html_content::base_url, html_content::bctx, html_content::bw, content_get_url(), html_content::conversion_begun, html_content::document, html_content::drag_owner, html_content::drag_type, html_content::enable_scripting, html_content::encoding, html_content::encoding_source, html_content::focus_owner, html_content::focus_type, html_content::font_func, html_content::forms, html_content::frameset, guit, html_document_user_data_handler(), html_dom_event_fetcher(), HTML_DRAG_NONE, HTML_FOCUS_SELF, html_process_script(), HTML_SELECTION_NONE, http_parameter_list_find_item(), html_content::iframe, html_content::imagemaps, html_content::jsthread, html_content::layout, netsurf_table::layout, libdom_hubbub_error_to_nserror(), html_content::media, html_drag_owner::no_owner, html_selection_owner::none, NS_TRANSPARENT, NSERROR_DOM, NSERROR_NOMEM, NSERROR_OK, NSLOG, nsoption_bool, nsurl_ref(), nsurl_unref(), html_content::num_objects, html_content::object_list, html_content::page, html_content::parse_completed, html_content::parser, html_content::quirks, html_content::reflowing, html_content::refresh, html_content::scripts, html_content::scripts_count, html_content::sel, html_content::select_ctx, selection_create(), html_content::selection_owner, html_content::selection_type, html_focus_owner::self, SLEN, html_content::stylesheet_count, html_content::stylesheets, html_content::title, and html_content::universal.
Referenced by html_create().
|
static |
set debug status.
c | The content to debug |
op | The debug operation type |
Definition at line 1841 of file html.c.
References html_redraw_debug, and NSERROR_OK.
|
static |
Dump debug info concerning the html_content.
c | The content to debug |
f | The file to dump to |
op | The debug dump type |
Definition at line 1857 of file html.c.
References box_dump(), CONTENT_DEBUG_RENDER, html_content::document, html_content::layout, libdom_dump_structure(), NSERROR_DOM, NSERROR_OK, and NSLOG.
|
static |
Destroy a CONTENT_HTML and free all resources it owns.
Definition at line 1202 of file html.c.
References html_content::base_target, html_content::base_url, html_content::box_conversion_context, cancel_dom_to_box(), html_content::document, html_content::encoding, form_free(), html_content::forms, html_content::frameset, html_css_free_stylesheets(), html_destroy_frameset(), html_destroy_iframe(), html_free_layout(), html_object_free_objects(), html_script_free(), html_content::iframe, imagemap_destroy(), js_destroythread(), html_content::jsthread, html_content::media, NSERROR_OK, NSLOG, nsurl_unref(), html_content::parser, form::prev, content::refresh, html_content::sel, html_content::select_ctx, selection_destroy(), talloc_free(), html_content::title, and html_content::universal.
|
static |
Definition at line 1141 of file html.c.
References content_html_frames::children, content_html_frames::cols, html_destroy_frameset(), content_html_frames::name, nsurl_unref(), content_html_frames::rows, talloc_free(), and content_html_frames::url.
Referenced by html_destroy(), and html_destroy_frameset().
|
static |
Definition at line 1171 of file html.c.
References content_html_iframe::name, content_html_iframe::next, nsurl_unref(), talloc_free(), and content_html_iframe::url.
Referenced by html_destroy().
|
static |
Definition at line 419 of file html.c.
References NSLOG.
Referenced by html_create_html_data().
|
static |
Drop a file onto a content at a particular point, or determine if a file may be dropped onto the content at given point.
c | html content to look inside |
x | x-coordinate of point of interest |
y | y-coordinate of point of interest |
file | path to file to be dropped, or NULL to know if drop allowed |
Definition at line 1683 of file html.c.
References box_at_point(), box_coords(), BROWSER_MOUSE_PRESS_1, browser_window_drop_file_at_point(), browser_window_get_scale(), buffer, content_drop_file_at_point(), form_control::data, box::gadget, GADGET_FILE, GADGET_PASSWORD, GADGET_TEXTAREA, GADGET_TEXTBOX, guit, html__set_file_gadget_filename(), box::iframe, html_content::layout, gui_utf8_table::local_to_utf8, messages_get_errorcode(), box::next, NSERROR_BAD_ENCODING, NSERROR_OK, NSLOG, box::object, box::style, textarea_drop_text(), textarea_mouse_action(), form_control::type, html_content::unit_len_ctx, netsurf_table::utf8, box::x, and box::y.
|
static |
Retrieve the charset of an HTML document.
c | Content to retrieve charset from |
op | The content encoding operation to perform. |
Definition at line 1987 of file html.c.
References CONTENT_ENCODING_SOURCE, html_content::encoding, html_content::encoding_source, and messages_get().
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().
|
static |
Definition at line 2214 of file html.c.
References html_css_fini().
Referenced by html_init().
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().
|
static |
Definition at line 1188 of file html.c.
References html_content::bctx, and talloc_free().
Referenced by html_destroy().
const char * html_get_base_target | ( | hlcache_handle * | h | ) |
Retrieve an HTML content's base target.
obtain html base target from handle
h | Content to retrieve base target from |
Definition at line 2054 of file html.c.
References html_content::base_target, and hlcache_handle_get_content().
Referenced by browser_window_find_target().
nsurl * html_get_base_url | ( | hlcache_handle * | h | ) |
Retrieve an HTML content's base URL.
get the base url of an html content from a handle
h | Content to retrieve base target from |
Definition at line 2039 of file html.c.
References html_content::base_url, and hlcache_handle_get_content().
Referenced by save_complete_save_html_document().
struct box * html_get_box_tree | ( | hlcache_handle * | h | ) |
Retrieve box tree.
get the render box tree of a html content from a handle
h | HTML content to retrieve tree from |
Definition at line 1971 of file html.c.
References hlcache_handle_get_content(), and html_content::layout.
Referenced by html_get_id_offset(), layout_minmax_block(), and save_as_text().
|
static |
Get access to any content, link URLs and objects (images) currently at the given (x, y) coordinates.
[in] | c | html content to look inside |
[in] | x | x-coordinate of point of interest |
[in] | y | y-coordinate of point of interest |
[out] | data | Positional features struct to be updated with any relevent content, or set to NULL if none. |
Definition at line 1455 of file html.c.
References box_at_point(), browser_window_get_features(), browser_window_get_scale(), content_get_contextual_content(), browser_window_features::form_features, box::gadget, GADGET_FILE, GADGET_PASSWORD, GADGET_TEXTAREA, GADGET_TEXTBOX, box::href, box::iframe, imagemap_get(), html_content::layout, browser_window_features::link, box::next, NSERROR_OK, box::object, browser_window_features::object, box::style, box::target, form_control::type, html_content::unit_len_ctx, box::usemap, box::x, and box::y.
|
static |
Definition at line 306 of file html.c.
References html_content::base, content_broadcast(), CONTENT_MSG_GETDIMS, content_msg_data::getdims, html_content::media, nscss_screen_dpi, nsoption_int, html_content::unit_len_ctx, and content_msg_data::viewport_width.
Referenced by html_finish_conversion().
dom_document * html_get_document | ( | hlcache_handle * | h | ) |
Retrieve HTML document tree.
get the dom document of a html content from a handle
h | HTML content to retrieve document tree from |
Definition at line 1953 of file html.c.
References html_content::document, and hlcache_handle_get_content().
Referenced by save_complete_save_html_document().
struct content_html_frames * html_get_frameset | ( | hlcache_handle * | h | ) |
Retrieve framesets used in an HTML document.
obtain html frame content from handle
h | Content to inspect |
Definition at line 2009 of file html.c.
References html_content::frameset, and hlcache_handle_get_content().
Referenced by browser_window_create_frameset(), and browser_window_recalculate_frameset().
bool html_get_id_offset | ( | hlcache_handle * | h, |
lwc_string * | frag_id, | ||
int * | x, | ||
int * | y | ||
) |
Retrieve layout coordinates of box with given id.
get the offset within the docuemnt of a fragment id
h | HTML document to search |
frag_id | String containing an element id |
x | Updated to global x coord iff id found |
y | Updated to global y coord iff id found |
Definition at line 2073 of file html.c.
References box_coords(), box_find_by_id(), content_get_type(), CONTENT_HTML, html_get_box_tree(), box::x, and box::y.
Referenced by frag_scroll().
struct content_html_iframe * html_get_iframe | ( | hlcache_handle * | h | ) |
Retrieve iframes used in an HTML document.
obtain html iframe content from handle
h | Content to inspect |
Definition at line 2024 of file html.c.
References hlcache_handle_get_content(), and html_content::iframe.
Referenced by browser_window_create_iframes().
|
static |
Return an HTML content's selection context.
Definition at line 1417 of file html.c.
References html_selection_owner::content, content_get_selection(), HTML_SELECTION_CONTENT, HTML_SELECTION_NONE, HTML_SELECTION_SELF, HTML_SELECTION_TEXTAREA, html_selection_owner::none, box::object, html_content::sel, selection_get_copy(), html_content::selection_owner, html_content::selection_type, box::text, html_selection_owner::textarea, and textarea_get_selection().
nserror html_init | ( | void | ) |
initialise content handler
Definition at line 2382 of file html.c.
References content_factory_register_handler(), html_content_handler, html_css_init(), html_fini(), html_types, NOF_ELEMENTS, and NSERROR_OK.
Referenced by netsurf_init().
|
static |
Handle a window containing a CONTENT_HTML being opened.
Definition at line 1329 of file html.c.
References html_content::bw, html_content::drag_owner, html_content::drag_type, HTML_DRAG_NONE, html_object_open_objects(), HTML_SELECTION_NONE, html_drag_owner::no_owner, html_selection_owner::none, NSERROR_OK, html_content::page, html_content::sel, selection_init(), html_content::selection_owner, and html_content::selection_type.
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().
|
static |
Process data for CONTENT_HTML.
Definition at line 736 of file html.c.
References content_broadcast_error(), html_process_encoding_change(), libdom_hubbub_error_to_nserror(), NSERROR_ENCODING_CHANGE, NSERROR_OK, html_content::parser, and content::size.
|
static |
Definition at line 649 of file html.c.
References content__get_source_data(), html_content::document, html_content::enable_scripting, html_content::encoding, html_content::encoding_source, html_dom_event_fetcher(), html_process_script(), libdom_hubbub_error_to_nserror(), NSERROR_NOMEM, and html_content::parser.
Referenced by html_process_data().
void html_redraw_a_box | ( | hlcache_handle * | h, |
struct box * | box | ||
) |
Redraw a box.
redraw a specific box
h | content containing the box, of type CONTENT_HTML |
box | box to redraw |
Definition at line 1111 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 browser_window_invalidate_iframe(), and browser_window_scroll_callback().
|
static |
Reformat a CONTENT_HTML to a new width.
Definition at line 1053 of file html.c.
References box::border, BOTTOM, box::descendant_x1, box::descendant_y1, html_content::had_initial_layout, content::height, box::height, height, html_content::layout, layout_document(), LEFT, box::margin, nsoption_uint, box::padding, html_content::reflowing, content::reformat_time, RIGHT, html_content::sel, selection_reinit(), box::style, TOP, html_content::unit_len_ctx, content::width, box_border::width, box::width, width, box::x, and box::y.
|
static |
Definition at line 2176 of file html.c.
References content_html_object::content, content_saw_insecure_objects(), html_css_saw_insecure_stylesheets(), html_saw_insecure_scripts(), content_html_object::next, and html_content::object_list.
|
static |
Scroll deepest thing within the content which can be scrolled at given point.
c | html content to look inside |
x | x-coordinate of point of interest |
y | y-coordinate of point of interest |
scrx | number of px try to scroll something in x direction |
scry | number of px try to scroll something in y direction |
Definition at line 1534 of file html.c.
References box_at_point(), browser_window_get_scale(), browser_window_scroll_at_point(), content_scroll_at_point(), form_control::data, box::gadget, GADGET_PASSWORD, GADGET_TEXTAREA, GADGET_TEXTBOX, box::iframe, html_content::layout, box::next, box::object, box::scroll_x, box::scroll_y, scrollbar_scroll(), box::style, textarea_scroll(), form_control::type, html_content::unit_len_ctx, box::x, and box::y.
void html_set_file_gadget_filename | ( | struct hlcache_handle * | hl, |
struct form_control * | gadget, | ||
const char * | fn | ||
) |
set filename on a file gadget
used by core browser
Definition at line 1666 of file html.c.
References box::gadget, hl, hlcache_handle_get_content(), and html__set_file_gadget_filename().
Referenced by browser_window_set_gadget_filename().
|
static |
Stop loading a CONTENT_HTML.
called when the content is aborted. This must clean up any state created during the fetch.
Definition at line 1011 of file html.c.
References html_content::aborted, content::active, content_set_done(), CONTENT_STATUS_DONE, CONTENT_STATUS_LOADING, CONTENT_STATUS_READY, html_object_abort_objects(), js_closethread(), html_content::jsthread, NSLOG, and content::status.
|
static |
Definition at line 2324 of file html.c.
References box_coords(), box::height, NSERROR_OK, box::width, rect::x0, rect::x1, rect::y0, and rect::y1.
|
static |
Finds all occurrences of a given string in the html box tree.
pattern | the string pattern to search for |
p_len | pattern length |
c | The content to search |
csens | whether to perform a case sensitive search |
context | The search context to add the entry to. |
Definition at line 2303 of file html.c.
References find_occurrences_html_box(), html_content::layout, and NSERROR_INVALID.
|
static |
HTML content handler function table.
Definition at line 2346 of file html.c.
Referenced by html_init().
|
static |
Definition at line 83 of file html.c.
Referenced by html_init().