25 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_CRITICAL_SELECTOR_FILTER_H_
26 #define NET_INSTAWEB_REWRITER_PUBLIC_CRITICAL_SELECTOR_FILTER_H_
47 namespace net_instaweb {
51 static const char kAddStylesFunction[];
52 static const char kAddStylesInvocation[];
53 static const char kNoscriptStylesClass[];
58 virtual const char*
Name()
const {
return "CriticalSelectorFilter"; }
59 virtual const char* id()
const {
return "cl"; }
68 return driver()->
options()->HasInlineUnauthorizedResourceType(
69 semantic_type::kStylesheet) ?
70 RewriteDriver::kInlineUnauthorizedResources :
71 RewriteDriver::kInlineOnlyAuthorizedResources;
84 void Summarize(Css::Stylesheet* stylesheet,
89 bool* is_element_deleted)
override;
108 class CssStyleElement;
109 typedef std::vector<CssElement*> CssElementVector;
111 void RememberFullCss(
int pos,
118 StringSet critical_selectors_;
126 CssElementVector css_elements_;
129 bool saw_end_document_;
135 bool is_flush_script_added_;
Leaf node representing raw characters in HTML.
Definition: html_node.h:167
void RenderSummary(int pos, HtmlElement *element, HtmlCharactersNode *char_node, bool *is_element_deleted) override
virtual void EndDocument()
Definition: critical_selector_filter.h:49
Definition: html_element.h:42
virtual void RenderDone()
void WillNotRenderSummary(int pos, HtmlElement *element, HtmlCharactersNode *char_node) override
virtual RewriteDriver::InlineAuthorizationPolicy AllowUnauthorizedDomain() const
Definition: critical_selector_filter.h:66
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual const char * Name() const
The name of this filter – used for logging and debugging.
Definition: critical_selector_filter.h:58
virtual bool IntendedForInlining() const
Selectors are inlined into the html.
Definition: critical_selector_filter.h:75
ScriptUsage
Describes a filter's relationship with scripts.
Definition: html_filter.h:38
Definition: rewrite_driver.h:100
void Summarize(Css::Stylesheet *stylesheet, GoogleString *out) const override
InlineAuthorizationPolicy
See CreateInputResource.
Definition: rewrite_driver.h:137
ScriptUsage GetScriptUsage() const override
Definition: critical_selector_filter.h:76
Definition: html_filter.h:43
virtual void StartDocumentImpl()
Parser callbacks.
virtual void DetermineEnabled(GoogleString *disabled_reason)
Filter control API.
const RewriteOptions * options() const
Return the options used for this RewriteDriver.
Definition: rewrite_driver.h:496
virtual GoogleString CacheKeySuffix() const
Definition: css_summarizer_base.h:52