19 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_SPLIT_HTML_CONFIG_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_SPLIT_HTML_CONFIG_H_
25 #include "pagespeed/kernel/base/basictypes.h"
26 #include "pagespeed/kernel/base/string.h"
28 namespace net_instaweb {
30 class CriticalLineInfo;
38 GoogleString tag_name;
39 GoogleString attribute_value;
43 typedef std::map<GoogleString, const Panel*> PanelIdToSpecMap;
44 typedef std::vector<XpathUnit> XpathUnits;
46 typedef std::map<GoogleString, XpathUnits*>
XpathMap;
60 static void Terminate();
62 const CriticalLineInfo* critical_line_info()
const {
63 return critical_line_info_;
70 const PanelIdToSpecMap* panel_id_to_spec()
const {
71 return &panel_id_to_spec_;
80 const CriticalLineInfo* critical_line_info_;
86 PanelIdToSpecMap panel_id_to_spec_;
97 std::vector<int>* num_children_stack() {
return &num_children_stack_; }
99 bool ElementMatchesXpath(
100 const HtmlElement* element,
101 const std::vector<XpathUnit>& xpath_units)
const;
117 const HtmlElement* current_panel_parent_element()
const {
118 return current_panel_parent_element_;
121 void set_current_panel_parent_element(HtmlElement* element) {
122 current_panel_parent_element_ = element;
125 const GoogleString& current_panel_id()
const {
126 return current_panel_id_;
129 void set_current_panel_id(
const GoogleString& panel_id) {
130 current_panel_id_ = panel_id;
133 void UpdateNumChildrenStack(
const HtmlElement* element);
140 std::vector<int> num_children_stack_;
143 HtmlElement* current_panel_parent_element_;
145 GoogleString current_panel_id_;
std::map< GoogleString, XpathUnits * > XpathMap
Map of xpath to XpathUnits.
Definition: split_html_config.h:46
SplitHtmlConfig(RewriteDriver *driver)
bool IsEndMarkerForCurrentPanel(HtmlElement *element) const
GoogleString MatchPanelIdForElement(HtmlElement *element) const
Returns the panel id of the panel whose xpath matched with element.
bool IsElementParentOfCurrentPanel(HtmlElement *element) const
Returns true if element is the parent of current panel.
Definition: split_html_config.h:50
Definition: rewrite_driver.h:98
Represents the filter state necessary to perform the split.
Definition: split_html_config.h:92
static void Initialize()
Initialize & Terminate must be paired.
bool IsElementSiblingOfCurrentPanel(HtmlElement *element) const
Definition: split_html_config.h:35