dillo
3.0.5
About: dillo is a small, fast, extensible Web browser particularly suitable for older or smaller computers and embedded systems (but only limited or no support for frames, CSS, JavaScript, Java).
![]() ![]() |
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. More... | |
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. More... | |
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 416 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(), matchCacheOffset, DoctreeNode::num, Doctree::parent(), CssSelector::CombinatorAndSelector::selector, selectorList, and Doctree::sibling().
Referenced by CssRule::apply(), and match().
|
inline |
Definition at line 407 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 422 of file css.hh.
References refCount.
Referenced by CssRule::CssRule(), and CssParser::parseRuleset().
|
inline |
Definition at line 412 of file css.hh.
References matchCacheOffset.
Referenced by CssContext::addRule().
|
inline |
Definition at line 406 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 403 of file css.hh.
References selectorList.
Referenced by CssStyleSheet::addRule(), and CssParser::parseSelector().
|
inline |
Definition at line 423 of file css.hh.
References refCount.
Referenced by CssParser::parseRuleset(), and CssRule::~CssRule().
|
private |
Definition at line 393 of file css.hh.
Referenced by addSimpleSelector(), CssSelector(), getRequiredMatchCache(), match(), and setMatchCacheOffset().
|
private |
Definition at line 393 of file css.hh.
Referenced by CssSelector(), ref(), and unref().
|
private |
Definition at line 394 of file css.hh.
Referenced by addSimpleSelector(), checksPseudoClass(), CssSelector(), match(), print(), size(), specificity(), top(), and ~CssSelector().