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). Fossies Dox: dillo-3.0.5.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) 
|
Go to the documentation of this file. 13 #include "../dlib/dlib.h" 21 fprintf (stderr,
"%s - %d\n",
32 for (
int i = 0; i <
size (); i++) {
51 for (
int i = 0; i <
size (); i++)
65 for (
int i = 0; i <
size (); i++) {
68 if (prop->
name == name) {
88 for (
int i = 0; i <
size (); i++) {
103 for (
int i = 0; i <
size (); i++)
129 int *matchCacheEntry;
142 node = docTree->
parent (node);
145 node = docTree->
sibling (node);
148 node = docTree->
parent (node);
152 n && n->
num > *matchCacheEntry; n = docTree->
parent (n))
153 if (sel->
match (n) &&
158 *matchCacheEntry = node->
num;
166 if (!node || !sel->
match (node))
186 if (
selectorList.getRef (i)->selector->getPseudoClass ())
201 spec +=
selectorList.getRef (i)->selector->specificity ();
213 fprintf (stderr,
"> ");
216 fprintf (stderr,
"\" \" ");
219 fprintf (stderr,
"+ ");
222 fprintf (stderr,
"? ");
228 fprintf (stderr,
"\n");
276 for (
int i = 0; i <
klass.
size (); i++) {
278 if (n->
klass != NULL) {
279 for (
int j = 0; j < n->
klass->
size (); j++) {
313 fprintf (stderr,
"Element %d, pseudo %s, id %s ",
315 fprintf (stderr,
"class ");
317 fprintf (stderr,
".%s",
klass.
get (i));
324 this->selector->
ref ();
380 if (ruleList == NULL) {
389 if (ruleList == NULL) {
419 static const int maxLists = 32;
421 int numLists = 0, index[maxLists] = {0};
427 if (ruleList[numLists])
432 for (
int i = 0; i < node->
klass->
size (); i++) {
433 if (i >= maxLists - 4) {
434 MSG_WARN(
"Maximum number of classes per element exceeded.\n");
441 if (ruleList[numLists])
447 if (ruleList[numLists])
451 if (ruleList[numLists])
459 int minSpec = 1 << 30;
460 int minPos = 1 << 30;
461 int minSpecIndex = -1;
463 for (
int i = 0; i < numLists; i++) {
466 if (rl && rl->
size () > index[i] &&
477 if (minSpecIndex >= 0) {
478 CssRule *rule = ruleList[minSpecIndex]->
get (index[minSpecIndex]);
479 rule->
apply(props, docTree, node, matchCache);
480 index[minSpecIndex]++;
491 matchCache.setSize (userAgentSheet.getRequiredMatchCache (), -1);
508 userAgentSheet.apply (props, docTree, node, &matchCache);
513 nonCssHints->
apply (props);
518 tagStyle->
apply (props);
523 if (tagStyleImportant)
524 tagStyleImportant->
apply (props);
532 if (props->
size () > 0) {
538 MSG_WARN (
"Ignoring unsafe author style that might reveal browsing history\n");
546 userAgentSheet.addRule (rule);
548 sheet[order].addRule (rule);
int specificity()
Return the specificity of the selector.
HTML document tree interface.
void insert(CssRule *rule)
A CssSelector CssPropertyList pair.
int getRequiredMatchCache()
This class holds a CSS property and value pair.
T get(int i) const
Return the one element, explicitly.
CssProperty * getRef(int i) const
Return the reference of one element.
void increase()
Increase the vector size by one.
An object::Object wrapper for constant strings (char*).
static const char * propertyNameString(CssPropertyName name)
void put(K *key, V *value)
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.
lout::misc::SimpleVector< char * > * getClass()
void apply(CssPropertyList *props, Doctree *docTree, const DoctreeNode *node, MatchCache *matchCache) const
void setMatchCacheOffset(int mo)
void apply(CssPropertyList *props)
Merge properties into argument property list.
lout::misc::SimpleVector< struct CombinatorAndSelector > selectorList
lout::misc::SimpleVector< char * > * klass
void apply(CssPropertyList *props, Doctree *docTree, DoctreeNode *node, CssPropertyList *tagStyle, CssPropertyList *tagStyleImportant, CssPropertyList *nonCssHints)
Apply a CSS context to a property list.
int size() const
Return the number of elements put into this vector.
RuleList elementTable[ntags]
void set(int i, T t)
Store an object in the vector.
static CssStyleSheet userAgentSheet
int dStrAsciiCasecmp(const char *s1, const char *s2)
int specificity()
Return the specificity of the simple selector.
bool match(const DoctreeNode *node)
Return whether simple selector matches at a given node of the document tree.
CssSimpleSelector * top()
DoctreeNode * parent(const DoctreeNode *node)
void set(CssPropertyName name, CssValueType type, CssPropertyValue value)
Set property to a given name and type.
void apply(CssPropertyList *props, Doctree *docTree, const DoctreeNode *node, MatchCache *matchCache) const
Apply a stylesheet to a property list.
void addSimpleSelector(Combinator c)
DoctreeNode * sibling(const DoctreeNode *node)
CssPropertyList(bool ownerOfStrings=false)
CssSimpleSelector * selector
void setSelect(SelectType t, const char *v)
A list of CssProperty objects.
CssRule(CssSelector *selector, CssPropertyList *props, int pos)
lout::misc::SimpleVector< char * > klass
void addRule(CssRule *rule)
Insert a rule into CssStyleSheet.
char * dStrdup(const char *s)
Anything related to Dillo Widget styles is defined here.
void addRule(CssSelector *sel, CssPropertyList *props, CssPrimaryOrder order)