Page Speed Optimization Libraries  1.2.24.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
net_instaweb::ComputeVisibleTextFilter Class Reference

#include "compute_visible_text_filter.h"

Inheritance diagram for net_instaweb::ComputeVisibleTextFilter:
net_instaweb::HtmlWriterFilter net_instaweb::HtmlFilter

List of all members.

Public Member Functions

 ComputeVisibleTextFilter (RewriteDriver *rewrite_driver)
virtual void StartDocument ()
virtual void StartElement (HtmlElement *element)
virtual void EndElement (HtmlElement *element)
virtual void Cdata (HtmlCdataNode *cdata)
 Called for CDATA blocks (e.g. <![CDATA[foobar]]>)
virtual void Characters (HtmlCharactersNode *characters)
 Called for raw characters between tags.
virtual void Comment (HtmlCommentNode *comment)
 Called for HTML comments that aren't IE directives (e.g. ).
virtual void IEDirective (HtmlIEDirectiveNode *directive)
virtual void Directive (HtmlDirectiveNode *directive)
 Called for HTML directives (e.g. <!doctype foobar>).
virtual void EndDocument ()
 Note: EndDocument will be called imediately before the last Flush call.
virtual const char * Name () const
 The name of this filter -- used for logging and debugging.

Detailed Description

This rewriter allows only the raw characters between the tags to be written. Following tags are entirely deleted by this filter: script style cdata directive iedirective noscript This is an experimental rewriter and should be used carefully.


Member Function Documentation

Called for an IE directive; typically used for CSS styling. See http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx

Todo:
TODO(mdsteele): Should we try to maintain the nested structure of the conditionals, in the same way that we maintain nesting of elements?

Reimplemented from net_instaweb::HtmlWriterFilter.

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::HtmlWriterFilter.

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.

Todo:
TODO(jmarantz): consider passing handles rather than pointers and reference-counting them instead to save memory on long documents.

Reimplemented from net_instaweb::HtmlWriterFilter.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines