#include "scan_filter.h"
Public Member Functions | |
ScanFilter (RewriteDriver *driver) | |
virtual void | StartDocument () |
virtual void | StartElement (HtmlElement *element) |
virtual void | Cdata (HtmlCdataNode *cdata) |
Called for CDATA blocks (e.g. <![CDATA[foobar]]>). | |
virtual void | Comment (HtmlCommentNode *comment) |
Called for HTML comments that aren't IE directives (e.g. ). | |
virtual void | IEDirective (HtmlIEDirectiveNode *directive) |
virtual void | Characters (HtmlCharactersNode *characters) |
Called for raw characters between tags. | |
virtual void | Directive (HtmlDirectiveNode *directive) |
Called for HTML directives (e.g. <!doctype foobar>). | |
virtual void | Flush () |
virtual const char * | Name () const |
The name of this filter -- used for logging and debugging. |
Filter that is run before any other, to help track base-tag usage and changes to help identify and deal conservatively with situation where HTML files update the base-tag more than once or use the base-tag prior to it being changed. Such situations are not well-defined and what we want to do is avoid rewriting any resources whose interpretation might be hard to predict due to browser differences.
virtual void net_instaweb::ScanFilter::Flush | ( | ) | [virtual] |
Notifies the Filter that a flush is occurring. A filter that's generating streamed output should flush at this time. A filter that's mutating elements can mutate any element seen since the most recent flush; once an element is flushed it is already on the wire to its destination and it's too late to mutate. Flush is initiated by an application calling HttpParse::Flush().
Flush() is called after all other handlers during a HttpParse::Flush().
Reimplemented from net_instaweb::EmptyHtmlFilter.
virtual void net_instaweb::ScanFilter::IEDirective | ( | HtmlIEDirectiveNode * | directive | ) | [virtual] |
Called for an IE directive; typically used for CSS styling. See http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx
Reimplemented from net_instaweb::EmptyHtmlFilter.
virtual void net_instaweb::ScanFilter::StartDocument | ( | ) | [virtual] |
Starts a new document. Filters should clear their state in this function, as the same Filter instance may be used for multiple HTML documents.
Reimplemented from net_instaweb::EmptyHtmlFilter.
virtual void net_instaweb::ScanFilter::StartElement | ( | HtmlElement * | element | ) | [virtual] |
When an HTML element is encountered during parsing, each filter's StartElement method is called. The HtmlElement lives for the entire duration of the document.
Reimplemented from net_instaweb::EmptyHtmlFilter.