Page Speed Optimization Libraries
1.11.33.2
|
#include "add_ids_filter.h"
Public Member Functions | |
AddIdsFilter (RewriteDriver *driver) | |
virtual void | StartDocument () |
virtual void | StartElement (HtmlElement *element) |
virtual void | EndElement (HtmlElement *element) |
virtual const char * | Name () const |
Static Public Attributes | |
static const char | kIdPrefix [] |
This filter as it stands adds an id to all div-like DOM elements that lack one. The ids represent the div's location in the DOM, based on the tag structure of the page. The hope is that this is moderately stable between page accesses.
Ids are of the form PageSpeed-nearestParentId-n-n-n... where -n-n-n is a path encoded as a series of indexes at that depth below nearestParentId. For example: PageSpeed-7-0 : The 0th child of the 7th child of the root of the document PageSpeed-content-11: The 11th child of the node with id='content'.