23 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_CSS_UTIL_H_
24 #define NET_INSTAWEB_REWRITER_PUBLIC_CSS_UTIL_H_
40 namespace net_instaweb {
48 static const char kAllMedia[] =
"all";
49 static const int kNoValue = -1;
77 int width()
const {
return width_px_; }
78 int height()
const {
return height_px_; }
87 static Css::Declarations* GetDeclsFromElement(
HtmlElement* element);
105 StringVector* output_vector);
123 StringVector* out_vector);
130 Css::MediaQueries* out_vector);
151 const std::vector<T>& sorted_outer) {
152 if (!sorted_outer.empty()) {
153 if (sorted_inner->empty()) {
154 *sorted_inner = sorted_outer;
156 typename std::vector<T>::const_iterator outer_iter = sorted_outer.begin();
157 typename std::vector<T>::iterator inner_iter = sorted_inner->begin();
159 while (inner_iter != sorted_inner->end()) {
160 if (outer_iter == sorted_outer.end()) {
162 inner_iter = sorted_inner->erase(inner_iter, sorted_inner->end());
163 }
else if (*outer_iter == *inner_iter) {
167 }
else if (*outer_iter < *inner_iter) {
172 inner_iter = sorted_inner->erase(inner_iter);
Found height only.
Definition: css_util.h:53
void ClearVectorIfContainsMediaAll(StringVector *media)
void EliminateElementsNotIn(std::vector< T > *sorted_inner, const std::vector< T > &sorted_outer)
Definition: css_util.h:150
Found both width and height.
Definition: css_util.h:55
void ConvertStringVectorToMediaQueries(const StringVector &in_vector, Css::MediaQueries *out_vector)
GoogleString JsDetectableSelector(const Css::Selector &selector)
No dimensions found.
Definition: css_util.h:52
void VectorizeMediaAttribute(const StringPiece &input_media, StringVector *output_vector)
Definition: html_element.h:42
Found width only.
Definition: css_util.h:54
DimensionState
Definition: css_util.h:51
DimensionState GetDimensions(Css::Declarations *decls, int *width, int *height)
bool IsComplexMediaQuery(const Css::MediaQuery &query)
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
GoogleString StringifyMediaVector(const StringVector &import_media)
Found a dimension, but couldn't extract a value.
Definition: css_util.h:56
bool ConvertMediaQueriesToStringVector(const Css::MediaQueries &in_vector, StringVector *out_vector)
bool CanMediaAffectScreen(const StringPiece &media)
Can this media attribute include some kind of screen?