Dillo v3.1.1-98-g318d1f14
|
A list of CssRules. More...
#include <css.hh>
Classes | |
class | RuleList |
class | RuleMap |
Public Member Functions | |
CssStyleSheet () | |
void | addRule (CssRule *rule) |
Insert a rule into CssStyleSheet. | |
void | apply (CssPropertyList *props, Doctree *docTree, const DoctreeNode *node, MatchCache *matchCache) const |
Apply a stylesheet to a property list. | |
int | getRequiredMatchCache () |
Private Attributes | |
RuleList | elementTable [ntags] |
RuleList | anyTable |
RuleMap | idTable |
RuleMap | classTable |
int | requiredMatchCache |
Static Private Attributes | |
static const int | ntags = HTML_NTAGS |
A list of CssRules.
In apply () all matching rules are applied.
|
inline |
Definition at line 508 of file css.hh.
References requiredMatchCache.
void CssStyleSheet::addRule | ( | CssRule * | rule | ) |
Insert a rule into CssStyleSheet.
To improve matching performance the rules are organized into rule lists based on the topmost simple selector of their selector.
Definition at line 372 of file css.cc.
References anyTable, classTable, CssSimpleSelector::ELEMENT_ANY, CssSimpleSelector::ELEMENT_NONE, elementTable, lout::misc::SimpleVector< T >::get(), lout::container::typed::HashTable< K, V >::get(), CssSimpleSelector::getClass(), CssSimpleSelector::getElement(), CssSimpleSelector::getId(), CssSelector::getRequiredMatchCache(), idTable, CssStyleSheet::RuleList::insert(), ntags, lout::container::typed::HashTable< K, V >::put(), requiredMatchCache, CssRule::selector, lout::misc::SimpleVector< T >::size(), and CssSelector::top().
void CssStyleSheet::apply | ( | CssPropertyList * | props, |
Doctree * | docTree, | ||
const DoctreeNode * | node, | ||
MatchCache * | matchCache | ||
) | const |
Apply a stylesheet to a property list.
The properties are set as defined by the rules in the stylesheet that match at the given node in the document tree.
Definition at line 417 of file css.cc.
References anyTable, CssRule::apply(), classTable, DoctreeNode::element, elementTable, lout::misc::SimpleVector< T >::get(), lout::container::typed::HashTable< K, V >::get(), DoctreeNode::id, idTable, DoctreeNode::klass, MSG_WARN, CssRule::position(), lout::misc::SimpleVector< T >::size(), and CssRule::specificity().
Referenced by CssContext::apply().
|
inline |
Definition at line 512 of file css.hh.
References requiredMatchCache.
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
Definition at line 505 of file css.hh.
Referenced by addRule(), CssStyleSheet(), and getRequiredMatchCache().