Dillo v3.1.1-91-g6d5b3ee3
|
CSS selector class. More...
#include <css.hh>
Classes | |
struct | CombinatorAndSelector |
Public Types | |
enum | Combinator { COMB_NONE , COMB_DESCENDANT , COMB_CHILD , COMB_ADJACENT_SIBLING } |
Public Member Functions | |
CssSelector () | |
~CssSelector () | |
void | addSimpleSelector (Combinator c) |
CssSimpleSelector * | top () |
int | size () |
bool | match (Doctree *dt, const DoctreeNode *node, MatchCache *matchCache) |
void | setMatchCacheOffset (int mo) |
int | getRequiredMatchCache () |
int | specificity () |
Return the specificity of the selector. | |
bool | checksPseudoClass () |
void | print () |
void | ref () |
void | unref () |
Private Member Functions | |
bool | match (Doctree *dt, const DoctreeNode *node, int i, Combinator comb, MatchCache *matchCache) |
Return whether selector matches at a given node in the document tree. | |
Private Attributes | |
int | refCount |
int | matchCacheOffset |
lout::misc::SimpleVector< struct CombinatorAndSelector > | selectorList |
CssSelector::CssSelector | ( | ) |
Definition at line 107 of file css.cc.
References COMB_NONE, CssSelector::CombinatorAndSelector::combinator, matchCacheOffset, refCount, CssSelector::CombinatorAndSelector::selector, and selectorList.
CssSelector::~CssSelector | ( | ) |
Definition at line 119 of file css.cc.
References selectorList.
void CssSelector::addSimpleSelector | ( | Combinator | c | ) |
Definition at line 173 of file css.cc.
References CssSelector::CombinatorAndSelector::combinator, matchCacheOffset, CssSelector::CombinatorAndSelector::selector, and selectorList.
Referenced by CssParser::parseSelector().
bool CssSelector::checksPseudoClass | ( | ) |
|
inline |
Definition at line 435 of file css.hh.
References matchCacheOffset, and size().
Referenced by CssStyleSheet::addRule(), and CssContext::addRule().
|
private |
Return whether selector matches at a given node in the document tree.
Definition at line 127 of file css.cc.
References COMB_ADJACENT_SIBLING, COMB_CHILD, COMB_DESCENDANT, COMB_NONE, CssSelector::CombinatorAndSelector::combinator, lout::misc::SimpleVector< T >::getRef(), CssSimpleSelector::match(), match(), matchCacheOffset, DoctreeNode::num, Doctree::parent(), CssSelector::CombinatorAndSelector::selector, selectorList, and Doctree::sibling().
Referenced by CssRule::apply(), match(), and match().
|
inline |
Definition at line 426 of file css.hh.
References COMB_NONE, match(), and selectorList.
void CssSelector::print | ( | ) |
Definition at line 206 of file css.cc.
References COMB_ADJACENT_SIBLING, COMB_CHILD, COMB_DESCENDANT, and selectorList.
Referenced by CssRule::print().
|
inline |
Definition at line 441 of file css.hh.
References refCount.
Referenced by CssRule::CssRule(), and CssParser::parseRuleset().
|
inline |
Definition at line 431 of file css.hh.
References matchCacheOffset.
Referenced by CssContext::addRule().
|
inline |
Definition at line 425 of file css.hh.
References selectorList.
Referenced by CssRule::CssRule(), and getRequiredMatchCache().
int CssSelector::specificity | ( | ) |
Return the specificity of the selector.
The specificity of a CSS selector is defined in http://www.w3.org/TR/CSS21/cascade.html#specificity
Definition at line 197 of file css.cc.
References selectorList.
Referenced by CssRule::CssRule().
|
inline |
Definition at line 422 of file css.hh.
References selectorList.
Referenced by CssStyleSheet::addRule(), and CssParser::parseSelector().
|
inline |
Definition at line 442 of file css.hh.
References refCount.
Referenced by CssParser::parseRuleset(), and CssRule::~CssRule().
|
private |
Definition at line 412 of file css.hh.
Referenced by addSimpleSelector(), CssSelector(), getRequiredMatchCache(), match(), and setMatchCacheOffset().
|
private |
Definition at line 412 of file css.hh.
Referenced by CssSelector(), ref(), and unref().
|
private |
Definition at line 413 of file css.hh.
Referenced by addSimpleSelector(), checksPseudoClass(), CssSelector(), match(), match(), print(), size(), specificity(), top(), and ~CssSelector().