19 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_CSS_MINIFY_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_CSS_MINIFY_H_
31 class MediaExpression;
36 class SimpleSelectors;
41 class FunctionParameters;
47 namespace net_instaweb {
64 static bool Stylesheet(
const Css::Stylesheet& stylesheet,
69 static bool Declarations(
const Css::Declarations& declarations,
81 void Write(
const StringPiece& str);
82 void WriteURL(
const UnicodeText& url);
84 template<
typename Container>
85 void JoinMinify(
const Container& container,
const StringPiece& sep);
86 template<
typename Iterator>
87 void JoinMinifyIter(
const Iterator& begin,
const Iterator& end,
88 const StringPiece& sep);
92 void Minify(
const Css::Stylesheet& stylesheet);
93 void Minify(
const Css::Charsets& charsets);
94 void Minify(
const Css::Import&
import);
95 void Minify(
const Css::MediaQuery& media_query);
96 void Minify(
const Css::MediaExpression& expression);
97 void Minify(
const Css::Selector& selector);
98 void Minify(
const Css::SimpleSelectors& sselectors,
bool isfirst =
false);
99 void Minify(
const Css::SimpleSelector& sselector);
100 void Minify(
const Css::Declaration& declaration);
101 void Minify(
const Css::Value& value);
102 void Minify(
const Css::FunctionParameters& parameters);
103 void Minify(
const Css::UnparsedRegion& unparsed_region);
110 void MinifyMediaStart(
const Css::MediaQueries& media_queries);
112 void MinifyMediaEnd(
const Css::MediaQueries& media_queries);
115 void MinifyFontFaceIgnoringMedia(
const Css::FontFace& font_face);
116 void MinifyRulesetIgnoringMedia(
const Css::Ruleset& ruleset);
119 void MinifyFont(
const Css::Values& font_values);
121 bool Equals(
const Css::MediaQueries& a,
const Css::MediaQueries& b)
const;
122 bool Equals(
const Css::MediaQuery& a,
const Css::MediaQuery& b)
const;
123 bool Equals(
const Css::MediaExpression& a,
124 const Css::MediaExpression& b)
const;
126 bool UnitsRequiredForValueZero(
const GoogleString& unit);
133 StringVector* url_collector_;
134 bool in_css_calc_function_;
bool ParseStylesheet(StringPiece stylesheet_text)
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
static bool Declarations(const Css::Declarations &declarations, Writer *writer, MessageHandler *handler)
Writes minified Declarations (style attribute contents).
static bool Stylesheet(const Css::Stylesheet &stylesheet, Writer *writer, MessageHandler *handler)
Writes minified Stylesheet from already-parsed stylesheet object.
Interface for writing bytes to an output stream.
Definition: writer.h:29
Definition: css_minify.h:53
Definition: message_handler.h:39
void set_error_writer(Writer *writer)
Definition: css_minify.h:78
void set_url_collector(StringVector *urls)
Establishes a string-vector to collect all parsed URLs.
Definition: css_minify.h:74