Dillo v3.1.1-119-g140d9ebd
Loading...
Searching...
No Matches
CssStyleSheet Class Reference

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
 

Detailed Description

A list of CssRules.

In apply () all matching rules are applied.

Definition at line 476 of file css.hh.

Constructor & Destructor Documentation

◆ CssStyleSheet()

CssStyleSheet::CssStyleSheet ( )
inline

Definition at line 508 of file css.hh.

References requiredMatchCache.

Member Function Documentation

◆ addRule()

◆ apply()

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().

◆ getRequiredMatchCache()

int CssStyleSheet::getRequiredMatchCache ( )
inline

Definition at line 512 of file css.hh.

References requiredMatchCache.

Member Data Documentation

◆ anyTable

RuleList CssStyleSheet::anyTable
private

Definition at line 503 of file css.hh.

Referenced by addRule(), and apply().

◆ classTable

RuleMap CssStyleSheet::classTable
private

Definition at line 504 of file css.hh.

Referenced by addRule(), and apply().

◆ elementTable

RuleList CssStyleSheet::elementTable[ntags]
private

Definition at line 503 of file css.hh.

Referenced by addRule(), and apply().

◆ idTable

RuleMap CssStyleSheet::idTable
private

Definition at line 504 of file css.hh.

Referenced by addRule(), and apply().

◆ ntags

const int CssStyleSheet::ntags = HTML_NTAGS
staticprivate

Definition at line 501 of file css.hh.

Referenced by addRule().

◆ requiredMatchCache

int CssStyleSheet::requiredMatchCache
private

Definition at line 505 of file css.hh.

Referenced by addRule(), CssStyleSheet(), and getRequiredMatchCache().


The documentation for this class was generated from the following files: