NetSurf
Data Structures | Typedefs | Functions
select.h File Reference
#include <stdint.h>
#include <dom/dom.h>
#include <libcss/libcss.h>
Include dependency graph for select.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  nscss_select_ctx
 Selection context. More...
 

Typedefs

typedef struct nscss_select_ctx nscss_select_ctx
 Selection context. More...
 

Functions

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. More...
 
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. More...
 
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. More...
 
css_error named_ancestor_node (void *pw, void *node, const css_qname *qname, void **ancestor)
 Callback to find a named ancestor node. More...
 
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. More...
 

Typedef Documentation

◆ nscss_select_ctx

Selection context.

Function Documentation

◆ named_ancestor_node()

css_error named_ancestor_node ( void *  pw,
void *  node,
const css_qname *  qname,
void **  ancestor 
)

Callback to find a named ancestor node.

Parameters
pwHTML document
nodeDOM node
qnameNode name to search for
ancestorPointer to location to receive ancestor
Returns
CSS_OK.
Postcondition
ancestor will contain the result, or NULL if there is no match

Definition at line 471 of file select.c.

Referenced by css_hint_anchor_color(), and css_hint_table_cell_border_padding().

Here is the caller graph for this function:

◆ node_is_visited()

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.

Parameters
pwHTML document
nodeDOM node
matchPointer to location to receive result
Returns
CSS_OK.
Postcondition
match will contain true if the node matches and false otherwise.

Definition at line 1471 of file select.c.

References nscss_select_ctx::base_url, NSERROR_OK, nsurl_join(), nsurl_unref(), urldb_get_url_data(), and url_data::visits.

Referenced by css_hint_anchor_color().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nscss_create_inline_style()

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.

Parameters
dataSource data
lenLength of data in bytes
charsetCharset of data, or NULL if unknown
urlBase URL of document containing data
allow_quirksTrue to permit CSS parsing quirks
Returns
Pointer to stylesheet, or NULL on failure.

Definition at line 148 of file select.c.

References ns_system_colour(), nscss_resolve_url(), and NSLOG.

Referenced by box_get_style().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nscss_get_blank_style()

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.

Parameters
ctxCSS selection context
unit_unit_len_ctxUnit length conversion context
parentParent style to cascade inherited properties from
Returns
Pointer to blank style, or NULL on failure

Definition at line 334 of file select.c.

References nscss_select_ctx::ctx, parent, and selection_handler.

Referenced by box_normalise_block(), box_normalise_flex(), box_normalise_table(), box_normalise_table_row(), box_normalise_table_row_group(), and box_normalise_table_spans().

Here is the caller graph for this function:

◆ nscss_get_style()

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.

Parameters
ctxCSS selection context
nElement to select for
mediaPermitted media types
unit_unit_len_ctxUnit length conversion context
inline_styleInline style associated with element, or NULL
Returns
Pointer to selection results (containing computed styles), or NULL on failure

Definition at line 253 of file select.c.

References nscss_select_ctx::ctx, nscss_select_ctx::parent_style, and selection_handler.

Referenced by box_get_style().

Here is the caller graph for this function: