Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 * for any media features | 65 * for any media features |
| 66 */ | 66 */ |
| 67 MediaQueryEvaluator(const AtomicString& acceptedMediaType, bool mediaFeature Result = false); | 67 MediaQueryEvaluator(const AtomicString& acceptedMediaType, bool mediaFeature Result = 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, Frame*, RenderSty le*); | 71 MediaQueryEvaluator(const AtomicString& acceptedMediaType, Frame*, RenderSty le*); |
| 72 | 72 |
| 73 ~MediaQueryEvaluator(); | 73 ~MediaQueryEvaluator(); |
| 74 | 74 |
| 75 bool mediaTypeMatch(const AtomicString& mediaTypeToMatch) const; | 75 bool mediaTypeMatch(const String& mediaTypeToMatch) const; |
|
eseidel
2013/12/09 18:24:21
I would have expected media queries to be atomic s
Inactive
2013/12/09 18:49:32
Media queries are not really a small set of values
Inactive
2013/12/09 19:10:59
Done. I kept this as an AtomicString.
| |
| 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 AtomicString m_mediaType; |
| 86 Frame* m_frame; // Not owned. | 86 Frame* 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 |
| OLD | NEW |