NetSurf
css.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Vincent Sanders <vince@netsurf-browser.org>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/**
20 * \file
21 * HTML content handler CSS interface.
22 */
23
24#ifndef NETSURF_HTML_CSS_H
25#define NETSURF_HTML_CSS_H
26
27/**
28 * Initialise html content css handling.
29 *
30 * \return NSERROR_OK on success else error code
31 */
33
34/**
35 * Finalise html content css handling.
36 */
37void html_css_fini(void);
38
39/**
40 * create a new css selection context for an html content.
41 *
42 * \param c The html content to create css selction on.
43 * \param select_ctx A pointer to receive the new context.
44 * \return NSERROR_OK on success and \a select_ctx updated else error code
45 */
46nserror html_css_new_selection_context(struct html_content *c, css_select_ctx **select_ctx);
47
48/**
49 * Initialise core stylesheets for a content
50 *
51 * \param c content structure to update
52 * \return NSERROR_OK on success or error code
53 */
55
56/**
57 * Initialise quirk stylesheets for a content
58 *
59 * \param c content structure to update
60 * \return NSERROR_OK on success or error code
61 */
63
64/**
65 * Free all css stylesheets associated with an HTML content.
66 *
67 * \param html The HTML content to free stylesheets from.
68 * \return NSERROR_OK on success or error code.
69 */
71
72/**
73 * determine if any of the stylesheets were loaded insecurely
74 *
75 * \param htmlc The HTML content to check.
76 * \return true if there were insecurely loadd stylesheets else false.
77 */
79
80/**
81 * process a css stylesheet dom LINK node
82 *
83 * \param htmlc The HTML content.
84 * \param node the DOM link node to process.
85 * \return true on success else false.
86 */
87bool html_css_process_link(struct html_content *htmlc, dom_node *node);
88
89/**
90 * process a css style dom node
91 *
92 * \param htmlc The HTML content.
93 * \param node the DOM node to process.
94 * \return true on success else false.
95 */
96bool html_css_process_style(struct html_content *htmlc, dom_node *node);
97
98/**
99 * process a css style dom node update
100 *
101 * \param htmlc The HTML content.
102 * \param node the DOM node to process.
103 * \return true on success else false.
104 */
105bool html_css_update_style(struct html_content *htmlc, dom_node *node);
106
107
108
109#endif
nserror html_css_new_selection_context(struct html_content *c, css_select_ctx **select_ctx)
create a new css selection context for an html content.
Definition: css.c:653
nserror html_css_init(void)
Initialise html content css handling.
Definition: css.c:716
void html_css_fini(void)
Finalise html content css handling.
Definition: css.c:747
nserror html_css_free_stylesheets(struct html_content *html)
Free all css stylesheets associated with an HTML content.
Definition: css.c:531
bool html_css_update_style(struct html_content *htmlc, dom_node *node)
process a css style dom node update
Definition: css.c:323
nserror html_css_quirks_stylesheets(struct html_content *c)
Initialise quirk stylesheets for a content.
Definition: css.c:552
bool html_css_process_style(struct html_content *htmlc, dom_node *node)
process a css style dom node
Definition: css.c:352
nserror html_css_new_stylesheets(struct html_content *c)
Initialise core stylesheets for a content.
Definition: css.c:581
bool html_css_saw_insecure_stylesheets(struct html_content *htmlc)
determine if any of the stylesheets were loaded insecurely
Definition: css.c:512
bool html_css_process_link(struct html_content *htmlc, dom_node *node)
process a css stylesheet dom LINK node
Definition: css.c:385
nserror
Enumeration of error codes.
Definition: errors.h:29
Data specific to CONTENT_HTML.
Definition: private.h:93