Index: Source/core/css/MediaQueryEvaluator.h |
diff --git a/Source/core/css/MediaQueryEvaluator.h b/Source/core/css/MediaQueryEvaluator.h |
index bf047a0a41ab4d4120171f45048582f4e0e39170..ae61df2cb99c8a01fada99ec599c6f72b35f824d 100644 |
--- a/Source/core/css/MediaQueryEvaluator.h |
+++ b/Source/core/css/MediaQueryEvaluator.h |
@@ -37,56 +37,58 @@ class MediaQueryExp; |
class MediaQueryResult; |
class MediaQuerySet; |
class RenderStyle; |
+class MediaValues; |
typedef WillBeHeapVector<RefPtrWillBeMember<MediaQueryResult> > MediaQueryResultList; |
-/** |
- * Class that evaluates css media queries as defined in |
- * CSS3 Module "Media Queries" (http://www.w3.org/TR/css3-mediaqueries/) |
- * Special constructors are needed, if simple media queries are to be |
- * evaluated without knowledge of the medium features. This can happen |
- * for example when parsing UA stylesheets, if evaluation is done |
- * right after parsing. |
- * |
- * the boolean parameter is used to approximate results of evaluation, if |
- * the device characteristics are not known. This can be used to prune the loading |
- * of stylesheets to only those which are probable to match. |
- */ |
+// Class that evaluates css media queries as defined in |
+// CSS3 Module "Media Queries" (http://www.w3.org/TR/css3-mediaqueries/) |
+// Special constructors are needed, if simple media queries are to be |
+// evaluated without knowledge of the medium features. This can happen |
+// for example when parsing UA stylesheets, if evaluation is done |
+// right after parsing. |
+// |
+// the boolean parameter is used to approximate results of evaluation, if |
+// the device characteristics are not known. This can be used to prune the loading |
+// of stylesheets to only those which are probable to match. |
+ |
class MediaQueryEvaluator { |
WTF_MAKE_NONCOPYABLE(MediaQueryEvaluator); WTF_MAKE_FAST_ALLOCATED; |
public: |
- /** Creates evaluator which evaluates only simple media queries |
- * Evaluator returns true for "all", and returns value of \mediaFeatureResult |
- * for any media features |
- */ |
+ // Creates evaluator which evaluates only simple media queries |
+ // Evaluator returns true for "all", and returns value of \mediaFeatureResult |
+ // for any media features |
+ |
explicit MediaQueryEvaluator(bool mediaFeatureResult = false); |
- /** Creates evaluator which evaluates only simple media queries |
- * Evaluator returns true for acceptedMediaType and returns value of \mediafeatureResult |
- * for any media features |
- */ |
+ // Creates evaluator which evaluates only simple media queries |
+ // Evaluator returns true for acceptedMediaType and returns value of \mediafeatureResult |
+ // for any media features |
+ |
MediaQueryEvaluator(const String& acceptedMediaType, bool mediaFeatureResult = false); |
MediaQueryEvaluator(const char* acceptedMediaType, bool mediaFeatureResult = false); |
- /** Creates evaluator which evaluates full media queries */ |
+ // Creates evaluator which evaluates full media queries |
MediaQueryEvaluator(const String& acceptedMediaType, LocalFrame*, RenderStyle*); |
+ // Creates evaluator which evaluates in a thread-safe manner a subset of media values |
+ MediaQueryEvaluator(const String& acceptedMediaType, const MediaValues&); |
+ |
~MediaQueryEvaluator(); |
bool mediaTypeMatch(const String& mediaTypeToMatch) const; |
bool mediaTypeMatchSpecific(const char* mediaTypeToMatch) const; |
- /** Evaluates a list of media queries */ |
+ // Evaluates a list of media queries |
bool eval(const MediaQuerySet*, MediaQueryResultList* = 0) const; |
- /** Evaluates media query subexpression, ie "and (media-feature: value)" part */ |
+ // Evaluates media query subexpression, ie "and (media-feature: value)" part |
bool eval(const MediaQueryExp*) const; |
private: |
String m_mediaType; |
- LocalFrame* m_frame; // Not owned. |
- RefPtr<RenderStyle> m_style; |
- bool m_expResult; |
+ bool m_expectedResult; |
+ RefPtr<MediaValues> m_mediaValues; |
}; |
} // namespace |