NetSurf
select.h
Go to the documentation of this file.
1/*
2 * Copyright 2009 John-Mark Bell <jmb@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#ifndef NETSURF_CSS_SELECT_H_
20#define NETSURF_CSS_SELECT_H_
21
22#include <stdint.h>
23
24#include <dom/dom.h>
25
26#include <libcss/libcss.h>
27
28struct content;
29struct nsurl;
30
31/**
32 * Selection context
33 */
34typedef struct nscss_select_ctx
35{
36 css_select_ctx *ctx;
37 bool quirks;
38 struct nsurl *base_url;
39 lwc_string *universal;
40 const css_computed_style *root_style;
41 const css_computed_style *parent_style;
43
44css_stylesheet *nscss_create_inline_style(const uint8_t *data, size_t len,
45 const char *charset, const char *url, bool allow_quirks);
46
47css_select_results *nscss_get_style(nscss_select_ctx *ctx, dom_node *n,
48 const css_media *media,
49 const css_unit_ctx *unit_len_ctx,
50 const css_stylesheet *inline_style);
51
52css_computed_style *nscss_get_blank_style(nscss_select_ctx *ctx,
53 const css_unit_ctx *unit_len_ctx,
54 const css_computed_style *parent);
55
56
57css_error named_ancestor_node(void *pw, void *node,
58 const css_qname *qname, void **ancestor);
59
60css_error node_is_visited(void *pw, void *node, bool *match);
61
62#endif
wimp_w parent
Definition: dialog.c:88
struct nsurl nsurl
NetSurf URL object.
Definition: nsurl.h:31
css_select_results * nscss_get_style(nscss_select_ctx *ctx, dom_node *n, const css_media *media, const css_unit_ctx *unit_len_ctx, const css_stylesheet *inline_style)
Get style selection results for an element.
Definition: select.c:253
css_stylesheet * nscss_create_inline_style(const uint8_t *data, size_t len, const char *charset, const char *url, bool allow_quirks)
Create an inline style.
Definition: select.c:148
css_error node_is_visited(void *pw, void *node, bool *match)
Callback to determine if a node is a linking element whose target has been visited.
Definition: select.c:1471
css_error named_ancestor_node(void *pw, void *node, const css_qname *qname, void **ancestor)
Callback to find a named ancestor node.
Definition: select.c:471
css_computed_style * nscss_get_blank_style(nscss_select_ctx *ctx, const css_unit_ctx *unit_len_ctx, const css_computed_style *parent)
Get a blank style.
Definition: select.c:334
struct nscss_select_ctx nscss_select_ctx
Selection context.
Content which corresponds to a single URL.
Selection context.
Definition: select.h:35
struct nsurl * base_url
Definition: select.h:38
css_select_ctx * ctx
Definition: select.h:36
lwc_string * universal
Definition: select.h:39
const css_computed_style * parent_style
Definition: select.h:41
const css_computed_style * root_style
Definition: select.h:40