view src/doctree.hh @ 763:df8153796f48

initial implementation of a CSS selector matching optimization The idea is to avoid repeated checks of CssSimpleSelector against the same part of the doctree. E.g .navigation * { background-color:green } Would result in checking for class="navigation" all the way down to the document root for all elements. The optimization shortcuts this, for parts of the doctree that have been checked before.
author Johannes Hofmann <>
date Tue, 13 Jan 2009 09:02:41 +0100
parents 145b8a4d65b3
children a913df1621ac
line wrap: on
line source
#ifndef __DOCTREE_HH__
#define __DOCTREE_HH__

class DoctreeNode {
      int num; // unique ascending id
      int depth;
      int element;
      const char *klass;
      const char *pseudo;
      const char *id;

class Doctree {
      virtual ~Doctree () {};
      virtual const DoctreeNode *top () = 0;
      virtual const DoctreeNode *parent (const DoctreeNode *node) = 0;