NetSurf
|
Implementation of HTML content DOM event handling. More...
#include <string.h>
#include "utils/config.h"
#include "utils/utils.h"
#include "utils/corestrings.h"
#include "utils/nsoption.h"
#include "utils/log.h"
#include "utils/ascii.h"
#include "utils/nsurl.h"
#include "content/content.h"
#include "javascript/js.h"
#include "netsurf/bitmap.h"
#include "html/private.h"
#include "html/object.h"
#include "html/css.h"
#include "html/box.h"
#include "html/box_construct.h"
#include "html/form_internal.h"
#include "html/dom_event.h"
Go to the source code of this file.
Functions | |
static bool | html_process_inserted_base (html_content *htmlc, dom_node *node) |
process a base element being inserted into the DOM More... | |
static bool | html_process_inserted_img (html_content *htmlc, dom_node *node) |
Process img element being inserted into the DOM. More... | |
static bool | html_process_inserted_link (html_content *c, dom_node *node) |
process a LINK element being inserted into the DOM More... | |
static void | dom_SCRIPT_showed_up (html_content *htmlc, dom_html_script_element *script) |
static nserror | html_process_inserted_meta (html_content *c, dom_node *n) |
process a META element being inserted into the DOM More... | |
static nserror | html_process_inserted_title (html_content *htmlc, dom_node *node) |
Process title element being inserted into the DOM. More... | |
static bool | html_process_title (html_content *c, dom_node *node) |
process title node More... | |
static void | html_texty_element_update (html_content *htmlc, dom_node *node) |
Deal with input elements being modified by resyncing their gadget if they have one. More... | |
static void | dom_default_action_DOMNodeInserted_cb (struct dom_event *evt, void *pw) |
callback for DOMNodeInserted end type More... | |
static void | dom_default_action_DOMNodeInsertedIntoDocument_cb (struct dom_event *evt, void *pw) |
callback for DOMNodeInsertedIntoDocument end type More... | |
static void | dom_default_action_DOMSubtreeModified_cb (struct dom_event *evt, void *pw) |
callback for DOMSubtreeModified end type More... | |
static void | dom_default_action_finished_cb (struct dom_event *evt, void *pw) |
callback for default action finished More... | |
dom_default_action_callback | html_dom_event_fetcher (dom_string *type, dom_default_action_phase phase, void **pw) |
html content DOM action callback function selector More... | |
Implementation of HTML content DOM event handling.
Definition in file dom_event.c.
|
static |
callback for DOMNodeInserted end type
Definition at line 585 of file dom_event.c.
References html_content::base, content_broadcast(), CONTENT_MSG_GETTHREAD, dom_SCRIPT_showed_up(), html_content::enable_scripting, html_css_process_style(), html_process_inserted_base(), html_process_inserted_img(), html_process_inserted_link(), html_process_inserted_meta(), html_process_inserted_title(), js_handle_new_element(), content_msg_data::jsthread, html_content::jsthread, box::node, NSLOG, nsoption_bool, and type.
Referenced by html_dom_event_fetcher().
|
static |
callback for DOMNodeInsertedIntoDocument end type
Definition at line 672 of file dom_event.c.
References dom_SCRIPT_showed_up(), fallthrough, and type.
Referenced by html_dom_event_fetcher().
|
static |
callback for DOMSubtreeModified end type
Definition at line 709 of file dom_event.c.
References fallthrough, html_css_update_style(), html_process_title(), html_texty_element_update(), nsoption_bool, html_content::title, and type.
Referenced by html_dom_event_fetcher().
|
static |
callback for default action finished
Definition at line 759 of file dom_event.c.
References js_event_cleanup(), and html_content::jsthread.
Referenced by html_dom_event_fetcher().
|
static |
Definition at line 258 of file dom_event.c.
References html_content::document, html_content::enable_scripting, html_process_script(), and NSLOG.
Referenced by dom_default_action_DOMNodeInserted_cb(), and dom_default_action_DOMNodeInsertedIntoDocument_cb().
dom_default_action_callback html_dom_event_fetcher | ( | dom_string * | type, |
dom_default_action_phase | phase, | ||
void ** | pw | ||
) |
html content DOM action callback function selector
selects a callback function for libdom to call based on the type and phase. dom_default_action_phase from events/document_event.h
The principle events are: DOMSubtreeModified DOMAttrModified DOMNodeInserted DOMNodeInsertedIntoDocument
Definition at line 770 of file dom_event.c.
References dom_default_action_DOMNodeInserted_cb(), dom_default_action_DOMNodeInsertedIntoDocument_cb(), dom_default_action_DOMSubtreeModified_cb(), dom_default_action_finished_cb(), NSLOG, and type.
Referenced by html_create_html_data(), and html_process_encoding_change().
|
static |
process a base element being inserted into the DOM
htmlc | The html content containing the DOM |
node | The DOM node being inserted |
Definition at line 56 of file dom_event.c.
References html_content::base_target, html_content::base_url, NSERROR_OK, nsurl_create(), and nsurl_unref().
Referenced by dom_default_action_DOMNodeInserted_cb().
|
static |
Process img element being inserted into the DOM.
htmlc | The html content containing the DOM |
node | The DOM node being inserted |
Definition at line 119 of file dom_event.c.
References html_content::base_url, CONTENT_IMAGE, html_fetch_object(), NSERROR_OK, nsoption_bool, nsurl_join(), and nsurl_unref().
Referenced by dom_default_action_DOMNodeInserted_cb().
|
static |
process a LINK element being inserted into the DOM
htmlc | The html content containing the DOM |
n | The DOM node being inserted |
Definition at line 161 of file dom_event.c.
References html_content::base, html_content::base_url, content__add_rfc5988_link(), content_rfc5988_link::href, content_rfc5988_link::hreflang, html_css_process_link(), content_rfc5988_link::media, NSERROR_OK, nsurl_join(), nsurl_unref(), content_rfc5988_link::rel, content_rfc5988_link::sizes, and content_rfc5988_link::type.
Referenced by dom_default_action_DOMNodeInserted_cb().
|
static |
process a META element being inserted into the DOM
htmlc | The html content containing the DOM |
n | The DOM node being inserted |
Definition at line 316 of file dom_event.c.
References ascii_is_space(), html_content::base, html_content::base_url, content_msg_data::content, content_broadcast(), content_get_url(), CONTENT_MSG_REFRESH, content_msg_data::delay, NSERROR_DOM, NSERROR_NOMEM, NSERROR_OK, nsurl_join(), nsurl_ref(), content::refresh, html_content::refresh, strndup(), and content_msg_data::url.
Referenced by dom_default_action_DOMNodeInserted_cb().
|
static |
Process title element being inserted into the DOM.
https://html.spec.whatwg.org/multipage/semantics.html#the-title-element
htmlc | The html content containing the DOM |
node | The DOM node being inserted |
Definition at line 524 of file dom_event.c.
References NSERROR_OK, and html_content::title.
Referenced by dom_default_action_DOMNodeInserted_cb().
|
static |
process title node
Definition at line 535 of file dom_event.c.
References html_content::base, content__set_title(), squash_whitespace(), and content_msg_data::title.
Referenced by dom_default_action_DOMSubtreeModified_cb().
|
static |
Deal with input elements being modified by resyncing their gadget if they have one.
Definition at line 566 of file dom_event.c.
References box_for_node(), form_gadget_sync_with_dom(), box::gadget, html__redraw_a_box(), and box::node.
Referenced by dom_default_action_DOMSubtreeModified_cb().