#include "collapse_whitespace_filter.h"
Public Member Functions | |
CollapseWhitespaceFilter (HtmlParse *html_parse) | |
virtual void | StartDocument () |
virtual void | StartElement (HtmlElement *element) |
virtual void | EndElement (HtmlElement *element) |
virtual void | Characters (HtmlCharactersNode *characters) |
Called for raw characters between tags. | |
virtual const char * | Name () const |
The name of this filter -- used for logging and debugging. |
Reduce the size of the HTML by collapsing whitespace (except within certain tags, e.g.
and <script>). Note that this is a dangerous filter, as CSS can be used to make the HTML whitespace-sensitive in unpredictable places; thus, it should only be used for content that you are sure will not do this.
virtual void net_instaweb::CollapseWhitespaceFilter::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::CollapseWhitespaceFilter::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.