ELinks 0.18.0
css_selector_set Struct Reference

A set of struct css_selector. More...

#include <stylesheet.h>

Collaboration diagram for css_selector_set:

Data Fields

unsigned char may_contain_rel_ancestor_or_parent
 
struct css_selector list list
 The list of selectors in this set.
 

Detailed Description

A set of struct css_selector.

This is currently represented as a list but that may be changed later. Therefore please try not to access the contents directly; instead define new wrapper macros.

According to CSS2 section 7.1 "Cascading order", if two rules have the same weight, then the latter specified wins. Regardless, the order of rules need not be represented in struct css_selector_set, because all rules for the same selector have already been merged into one struct css_selector.

Field Documentation

◆ list

struct css_selector list css_selector_set::list

The list of selectors in this set.

Sets are currently represented as lists that find_css_selector() then has to search linearly. Hashing was also tested but did not help in practice: each find_css_selector() call runs approximately one strcasecmp(), and a hash function is unlikely to be faster than that. See ELinks bug 789 for details.

Keep this away from the beginning of the structure, so that nobody can cast the struct css_selector_set * to LIST_OF(struct css_selector) * and get away with it.

◆ may_contain_rel_ancestor_or_parent

unsigned char css_selector_set::may_contain_rel_ancestor_or_parent

The documentation for this struct was generated from the following file: