Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: Source/core/css/MediaQueryEvaluator.h

Issue 171383002: A thread-safe Media Query Parser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Another attempt to fix Android build issues Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * CSS Media Query Evaluator 2 * CSS Media Query Evaluator
3 * 3 *
4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>. 4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 /** Creates evaluator which evaluates only simple media queries 57 /** Creates evaluator which evaluates only simple media queries
58 * Evaluator returns true for "all", and returns value of \mediaFeatureResu lt 58 * Evaluator returns true for "all", and returns value of \mediaFeatureResu lt
59 * for any media features 59 * for any media features
60 */ 60 */
61 explicit MediaQueryEvaluator(bool mediaFeatureResult = false); 61 explicit MediaQueryEvaluator(bool mediaFeatureResult = false);
62 62
63 /** Creates evaluator which evaluates only simple media queries 63 /** Creates evaluator which evaluates only simple media queries
64 * Evaluator returns true for acceptedMediaType and returns value of \medi afeatureResult 64 * Evaluator returns true for acceptedMediaType and returns value of \medi afeatureResult
65 * for any media features 65 * for any media features
66 */ 66 */
67 MediaQueryEvaluator(const AtomicString& acceptedMediaType, bool mediaFeature Result = false); 67 MediaQueryEvaluator(const String& acceptedMediaType, bool mediaFeatureResult = false);
68 MediaQueryEvaluator(const char* acceptedMediaType, bool mediaFeatureResult = false); 68 MediaQueryEvaluator(const char* acceptedMediaType, bool mediaFeatureResult = false);
69 69
70 /** Creates evaluator which evaluates full media queries */ 70 /** Creates evaluator which evaluates full media queries */
71 MediaQueryEvaluator(const AtomicString& acceptedMediaType, LocalFrame*, Rend erStyle*); 71 MediaQueryEvaluator(const String& acceptedMediaType, LocalFrame*, RenderStyl e*);
72 72
73 ~MediaQueryEvaluator(); 73 ~MediaQueryEvaluator();
74 74
75 bool mediaTypeMatch(const AtomicString& mediaTypeToMatch) const; 75 bool mediaTypeMatch(const String& mediaTypeToMatch) const;
76 bool mediaTypeMatchSpecific(const char* mediaTypeToMatch) const; 76 bool mediaTypeMatchSpecific(const char* mediaTypeToMatch) const;
77 77
78 /** Evaluates a list of media queries */ 78 /** Evaluates a list of media queries */
79 bool eval(const MediaQuerySet*, MediaQueryResultList* = 0) const; 79 bool eval(const MediaQuerySet*, MediaQueryResultList* = 0) const;
80 80
81 /** Evaluates media query subexpression, ie "and (media-feature: value)" par t */ 81 /** Evaluates media query subexpression, ie "and (media-feature: value)" par t */
82 bool eval(const MediaQueryExp*) const; 82 bool eval(const MediaQueryExp*) const;
83 83
84 private: 84 private:
85 AtomicString m_mediaType; 85 String m_mediaType;
86 LocalFrame* m_frame; // Not owned. 86 LocalFrame* m_frame; // Not owned.
87 RefPtr<RenderStyle> m_style; 87 RefPtr<RenderStyle> m_style;
88 bool m_expResult; 88 bool m_expResult;
89 }; 89 };
90 90
91 } // namespace 91 } // namespace
92 #endif 92 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698