Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Friends | List of all members
net_instaweb::HtmlNode Class Referenceabstract

#include "html_node.h"

Inheritance diagram for net_instaweb::HtmlNode:
net_instaweb::HtmlElement net_instaweb::HtmlLeafNode net_instaweb::HtmlCdataNode net_instaweb::HtmlCharactersNode net_instaweb::HtmlCommentNode net_instaweb::HtmlDirectiveNode net_instaweb::HtmlIEDirectiveNode

Public Member Functions

HtmlElementparent () const
 
virtual bool live () const =0
 
virtual GoogleString ToString () const =0
 
virtual void MarkAsDead (const HtmlEventListIterator &end)=0
 
void * operator new (size_t size, Arena< HtmlNode > *arena)
 
void operator delete (void *ptr, Arena< HtmlNode > *arena)
 

Protected Member Functions

 HtmlNode (HtmlElement *parent)
 
virtual void SynthesizeEvents (const HtmlEventListIterator &iter, HtmlEventList *queue)=0
 
virtual HtmlEventListIterator begin () const =0
 Return an iterator pointing to the first event associated with this node.
 
virtual HtmlEventListIterator end () const =0
 Return an iterator pointing to the last event associated with this node.
 
void operator delete (void *ptr)
 Version that affects visibility of the destructor.
 

Friends

class HtmlParse
 
class HtmlLexer
 
class HtmlTestingPeer
 

Detailed Description

Base class for HtmlElement and HtmlLeafNode. Generally represents all lexical tokens in HTML, except that for subclass HtmlElement, which represents both the opening & closing token.

Constructor & Destructor Documentation

net_instaweb::HtmlNode::HtmlNode ( HtmlElement parent)
inlineexplicitprotected
Todo:
TODO(jmarantz): jmaessen suggests instantiating the html nodes without parents and computing them from context at the time they are instantiated from the lexer. This is a little more difficult when synthesizing new nodes, however. We assert sanity, however, when calling HtmlParse::ApplyFilter.

Member Function Documentation

virtual void net_instaweb::HtmlNode::MarkAsDead ( const HtmlEventListIterator &  end)
pure virtual

Marks a node as dead. The queue's end iterator should be passed in, to remove references to stale iterators, and to force IsRewritable to return false.

Implemented in net_instaweb::HtmlElement, and net_instaweb::HtmlLeafNode.

virtual void net_instaweb::HtmlNode::SynthesizeEvents ( const HtmlEventListIterator &  iter,
HtmlEventList *  queue 
)
protectedpure virtual

Create new event object(s) representing this node, and insert them into the queue just before the given iterator; also, update this node object as necessary so that begin() and end() will return iterators pointing to the new event(s). The line number for each event should probably be -1.

Implemented in net_instaweb::HtmlElement, net_instaweb::HtmlDirectiveNode, net_instaweb::HtmlIEDirectiveNode, net_instaweb::HtmlCommentNode, net_instaweb::HtmlCharactersNode, and net_instaweb::HtmlCdataNode.


The documentation for this class was generated from the following file: