2009-07-24 03:05:34 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2009 John-Mark Bell <jmb@netsurf-browser.org>
|
|
|
|
*
|
|
|
|
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
|
|
|
*
|
|
|
|
* NetSurf is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* NetSurf is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NETSURF_CSS_SELECT_H_
|
|
|
|
#define NETSURF_CSS_SELECT_H_
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2012-03-24 22:48:14 +04:00
|
|
|
#include <dom/dom.h>
|
2009-07-24 03:05:34 +04:00
|
|
|
|
2016-05-26 13:18:41 +03:00
|
|
|
#include <libcss/libcss.h>
|
2009-07-24 03:05:34 +04:00
|
|
|
|
|
|
|
struct content;
|
2015-02-26 20:01:04 +03:00
|
|
|
struct nsurl;
|
2009-07-24 03:05:34 +04:00
|
|
|
|
2011-05-07 00:40:09 +04:00
|
|
|
/**
|
|
|
|
* Selection context
|
|
|
|
*/
|
|
|
|
typedef struct nscss_select_ctx
|
|
|
|
{
|
|
|
|
css_select_ctx *ctx;
|
|
|
|
bool quirks;
|
2015-02-26 20:01:04 +03:00
|
|
|
struct nsurl *base_url;
|
2011-10-08 04:21:59 +04:00
|
|
|
lwc_string *universal;
|
2018-01-03 19:59:58 +03:00
|
|
|
const css_computed_style *root_style;
|
2013-12-19 18:21:15 +04:00
|
|
|
const css_computed_style *parent_style;
|
2011-05-07 00:40:09 +04:00
|
|
|
} nscss_select_ctx;
|
|
|
|
|
2009-07-24 03:05:34 +04:00
|
|
|
css_stylesheet *nscss_create_inline_style(const uint8_t *data, size_t len,
|
2013-12-14 00:25:08 +04:00
|
|
|
const char *charset, const char *url, bool allow_quirks);
|
2009-07-24 03:05:34 +04:00
|
|
|
|
2012-03-24 22:48:14 +04:00
|
|
|
css_select_results *nscss_get_style(nscss_select_ctx *ctx, dom_node *n,
|
2019-05-04 14:02:55 +03:00
|
|
|
const css_media *media, const css_stylesheet *inline_style);
|
2009-07-24 03:05:34 +04:00
|
|
|
|
2011-05-07 00:40:09 +04:00
|
|
|
css_computed_style *nscss_get_blank_style(nscss_select_ctx *ctx,
|
2013-12-14 00:25:08 +04:00
|
|
|
const css_computed_style *parent);
|
2009-07-24 03:05:34 +04:00
|
|
|
|
|
|
|
|
2015-05-03 18:10:15 +03:00
|
|
|
css_error named_ancestor_node(void *pw, void *node,
|
|
|
|
const css_qname *qname, void **ancestor);
|
2016-05-26 13:18:41 +03:00
|
|
|
|
2015-05-03 18:10:15 +03:00
|
|
|
css_error node_is_visited(void *pw, void *node, bool *match);
|
2009-07-24 03:05:34 +04:00
|
|
|
|
|
|
|
#endif
|