NetSurf
|
Processing for html content css operations. More...
#include "utils/config.h"
#include <assert.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include "utils/nsoption.h"
#include "utils/corestrings.h"
#include "utils/log.h"
#include "netsurf/misc.h"
#include "netsurf/content.h"
#include "content/hlcache.h"
#include "css/css.h"
#include "desktop/gui_internal.h"
#include "html/html.h"
#include "html/html_internal.h"
Go to the source code of this file.
Macros | |
#define | _GNU_SOURCE /* strcasestr needs this for string.h */ |
Variables | |
static nsurl * | html_default_stylesheet_url |
static nsurl * | html_adblock_stylesheet_url |
static nsurl * | html_quirks_stylesheet_url |
static nsurl * | html_user_stylesheet_url |
Processing for html content css operations.
Definition in file html_css.c.
#define _GNU_SOURCE /* strcasestr needs this for string.h */ |
Definition at line 26 of file html_css.c.
|
static |
Definition at line 52 of file html_css.c.
References NSERROR_BAD_ENCODING, NSERROR_BAD_PARAMETER, NSERROR_CSS, NSERROR_INVALID, NSERROR_NEED_DATA, NSERROR_NOMEM, NSERROR_NOT_FOUND, and NSERROR_OK.
Referenced by html_css_new_selection_context().
|
static |
Callback for fetchcache() for stylesheets.
Definition at line 90 of file html_css.c.
References content::active, html_content::base, content_add_error(), CONTENT_MSG_DONE, CONTENT_MSG_ERROR, CONTENT_MSG_POINTER, hlcache_event::data, content_msg_data::errordata, content_msg_data::errormsg, hlcache_handle_get_url(), hlcache_handle_release(), html_begin_conversion(), html_can_begin_conversion(), NSERROR_OK, NSLOG, nsurl_access(), parent, html_stylesheet::sheet, html_content::stylesheet_count, html_content::stylesheets, and hlcache_event::type.
Referenced by html_css_new_stylesheets(), html_css_process_link(), html_css_quirks_stylesheets(), and html_stylesheet_from_domnode().
|
static |
Process an inline stylesheet in the document.
c | content structure |
style | xml node of style element |
Definition at line 207 of file html_css.c.
References html_content::base, content_broadcast_error(), html_stylesheet::modified, html_stylesheet::node, NSERROR_NOMEM, html_stylesheet::sheet, strcasestr(), html_content::stylesheet_count, html_content::stylesheets, and html_stylesheet::unused.
Referenced by html_css_update_style().
void html_css_fini | ( | void | ) |
Definition at line 718 of file html_css.c.
References html_adblock_stylesheet_url, html_default_stylesheet_url, html_quirks_stylesheet_url, html_user_stylesheet_url, and nsurl_unref().
Referenced by html_fini().
nserror html_css_free_stylesheets | ( | html_content * | html | ) |
Definition at line 510 of file html_css.c.
References guit, hlcache_handle_release(), html_css_process_modified_styles(), netsurf_table::misc, html_stylesheet::node, NSERROR_OK, gui_misc_table::schedule, html_stylesheet::sheet, html_content::stylesheet_count, and html_content::stylesheets.
Referenced by html_destroy().
nserror html_css_init | ( | void | ) |
Definition at line 689 of file html_css.c.
References html_adblock_stylesheet_url, html_css_fetcher_register(), html_default_stylesheet_url, html_quirks_stylesheet_url, html_user_stylesheet_url, NSERROR_OK, and nsurl_create().
Referenced by html_init().
nserror html_css_new_selection_context | ( | html_content * | c, |
css_select_ctx ** | ret_select_ctx | ||
) |
Definition at line 628 of file html_css.c.
References css_error_to_nserror(), nscss_get_stylesheet(), NSERROR_CSS_BASE, NSERROR_OK, html_stylesheet::sheet, STYLESHEET_BASE, html_content::stylesheet_count, STYLESHEET_START, STYLESHEET_USER, html_content::stylesheets, and html_stylesheet::unused.
Referenced by html_finish_conversion().
nserror html_css_new_stylesheets | ( | html_content * | c | ) |
Initialise core stylesheets for a content.
c | content structure to update |
Definition at line 558 of file html_css.c.
References content::active, html_content::base, hlcache_child_context::charset, CONTENT_CSS, content_get_url(), html_content::encoding, hlcache_handle_retrieve(), html_adblock_stylesheet_url, html_convert_css_callback(), html_default_stylesheet_url, html_user_stylesheet_url, NSERROR_NOMEM, NSERROR_OK, NSLOG, nsoption_bool, hlcache_child_context::quirks, content::quirks, html_stylesheet::sheet, STYLESHEET_ADBLOCK, STYLESHEET_BASE, html_content::stylesheet_count, STYLESHEET_QUIRKS, STYLESHEET_START, STYLESHEET_USER, and html_content::stylesheets.
Referenced by html_create().
bool html_css_process_link | ( | html_content * | htmlc, |
dom_node * | node | ||
) |
Definition at line 371 of file html_css.c.
References content::active, html_content::base, html_content::base_url, hlcache_child_context::charset, content_broadcast_error(), CONTENT_CSS, content_get_url(), html_content::encoding, hlcache_handle_retrieve(), html_convert_css_callback(), html_stylesheet::modified, html_stylesheet::node, NSERROR_NOMEM, NSERROR_OK, NSLOG, nsurl_access(), nsurl_join(), nsurl_unref(), hlcache_child_context::quirks, content::quirks, html_stylesheet::sheet, strcasestr(), html_content::stylesheet_count, html_content::stylesheets, and html_stylesheet::unused.
Referenced by dom_default_action_DOMNodeInserted_cb().
|
static |
Definition at line 257 of file html_css.c.
References content::active, html_content::base, content_broadcast_error(), content_get_status(), CONTENT_STATUS_DONE, hlcache_handle_abort(), hlcache_handle_release(), html_stylesheet_from_domnode(), html_stylesheet::modified, html_stylesheet::node, NSERROR_OK, NSLOG, and html_stylesheet::sheet.
Referenced by html_css_process_modified_styles().
|
static |
Definition at line 294 of file html_css.c.
References guit, html_css_process_modified_style(), netsurf_table::misc, html_stylesheet::modified, gui_misc_table::schedule, html_content::stylesheet_count, and html_content::stylesheets.
Referenced by html_css_free_stylesheets(), and html_css_update_style().
bool html_css_process_style | ( | html_content * | c, |
dom_node * | node | ||
) |
Definition at line 340 of file html_css.c.
References html_stylesheet::node, strcasestr(), html_content::stylesheet_count, html_content::stylesheets, and html_stylesheet::unused.
Referenced by dom_default_action_DOMNodeInserted_cb().
nserror html_css_quirks_stylesheets | ( | html_content * | c | ) |
Definition at line 530 of file html_css.c.
References content::active, html_content::base, hlcache_child_context::charset, CONTENT_CSS, content_get_url(), html_content::encoding, hlcache_handle_retrieve(), html_convert_css_callback(), html_quirks_stylesheet_url, NSERROR_OK, NSLOG, hlcache_child_context::quirks, html_content::quirks, content::quirks, html_stylesheet::sheet, STYLESHEET_QUIRKS, and html_content::stylesheets.
Referenced by html_convert().
bool html_css_update_style | ( | html_content * | c, |
dom_node * | style | ||
) |
Definition at line 313 of file html_css.c.
References guit, html_create_style_element(), html_css_process_modified_styles(), netsurf_table::misc, html_stylesheet::modified, html_stylesheet::node, NSLOG, gui_misc_table::schedule, html_content::stylesheet_count, and html_content::stylesheets.
Referenced by dom_default_action_DOMSubtreeModified_cb().
struct html_stylesheet* html_get_stylesheets | ( | struct hlcache_handle * | h, |
unsigned int * | n | ||
) |
Retrieve stylesheets used by HTML document.
h | Content to retrieve stylesheets from |
n | Pointer to location to receive number of sheets |
Definition at line 479 of file html_css.c.
References hlcache_handle_get_content(), html_content::stylesheet_count, and html_content::stylesheets.
Referenced by browser_window_reload(), and save_complete_save_html_stylesheets().
bool html_saw_insecure_stylesheets | ( | html_content * | html | ) |
Return if any of the stylesheets were loaded insecurely.
Definition at line 492 of file html_css.c.
References content_saw_insecure_objects(), html_stylesheet::sheet, and html_content::stylesheets.
Referenced by html_saw_insecure_objects().
|
static |
Definition at line 145 of file html_css.c.
References content::active, html_content::base, html_content::base_url, hlcache_child_context::charset, CONTENT_CSS, content_get_url(), html_content::encoding, hlcache_handle_retrieve(), html_convert_css_callback(), html_css_fetcher_add_item(), NSERROR_OK, NSLOG, nsurl_create(), nsurl_unref(), hlcache_child_context::quirks, and content::quirks.
Referenced by html_css_process_modified_style().
|
static |
Definition at line 48 of file html_css.c.
Referenced by html_css_fini(), html_css_init(), and html_css_new_stylesheets().
|
static |
Definition at line 47 of file html_css.c.
Referenced by html_css_fini(), html_css_init(), and html_css_new_stylesheets().
|
static |
Definition at line 49 of file html_css.c.
Referenced by html_css_fini(), html_css_init(), and html_css_quirks_stylesheets().
|
static |
Definition at line 50 of file html_css.c.
Referenced by html_css_fini(), html_css_init(), and html_css_new_stylesheets().