Mercurial > dillo_port1.3
annotate src/doctree.hh @ 1214:e9729d5a1416
support multiple classes per doctree node
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> |
---|---|
date | Sat, 11 Jul 2009 10:54:22 +0200 |
parents | a913df1621ac |
children | 9225a90ad7dd |
rev | line source |
---|---|
501 | 1 #ifndef __DOCTREE_HH__ |
2 #define __DOCTREE_HH__ | |
3 | |
1214
e9729d5a1416
support multiple classes per doctree node
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
1049
diff
changeset
|
4 #include "lout/misc.hh" |
e9729d5a1416
support multiple classes per doctree node
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
1049
diff
changeset
|
5 |
501 | 6 class DoctreeNode { |
7 public: | |
763
df8153796f48
initial implementation of a CSS selector matching optimization
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
562
diff
changeset
|
8 int num; // unique ascending id |
503
00b31843839b
implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
501
diff
changeset
|
9 int depth; |
562 | 10 int element; |
1214
e9729d5a1416
support multiple classes per doctree node
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
1049
diff
changeset
|
11 lout::misc::SimpleVector<char*> *klass; |
558
be6295157b10
adjust pseudo class handling
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
536
diff
changeset
|
12 const char *pseudo; |
501 | 13 const char *id; |
14 }; | |
15 | |
1049 | 16 /** |
17 * \brief HTML document tree interface. | |
18 * | |
19 * The Doctree class defines the interface to the parsed HTML document tree | |
20 * as it is used for CSS selector matching. | |
21 * Currently the Doctree can be represented as stack, however to support | |
22 * CSS adjacent siblings or for future JavaScript support it may have to | |
23 * be extended to a real tree. | |
24 */ | |
501 | 25 class Doctree { |
26 public: | |
503
00b31843839b
implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
501
diff
changeset
|
27 virtual ~Doctree () {}; |
501 | 28 virtual const DoctreeNode *top () = 0; |
29 virtual const DoctreeNode *parent (const DoctreeNode *node) = 0; | |
30 }; | |
31 | |
32 #endif |