OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MediaQueryParser_h | 5 #ifndef MediaQueryParser_h |
6 #define MediaQueryParser_h | 6 #define MediaQueryParser_h |
7 | 7 |
8 #include "core/css/MediaList.h" | 8 #include "core/css/MediaList.h" |
9 #include "core/css/MediaQuery.h" | 9 #include "core/css/MediaQuery.h" |
10 #include "core/css/MediaQueryExp.h" | 10 #include "core/css/MediaQueryExp.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 void clear(); | 33 void clear(); |
34 bool addExpression(); | 34 bool addExpression(); |
35 bool tryAddParserValue(CSSParserTokenType, const CSSParserToken&); | 35 bool tryAddParserValue(CSSParserTokenType, const CSSParserToken&); |
36 void setMediaType(const String&); | 36 void setMediaType(const String&); |
37 PassOwnPtrWillBeRawPtr<MediaQuery> takeMediaQuery(); | 37 PassOwnPtrWillBeRawPtr<MediaQuery> takeMediaQuery(); |
38 | 38 |
39 inline bool currentMediaQueryChanged() const | 39 inline bool currentMediaQueryChanged() const |
40 { | 40 { |
41 return (m_restrictor != MediaQuery::None || m_mediaTypeSet || m_expressi
ons->size() > 0); | 41 return (m_restrictor != MediaQuery::None || m_mediaTypeSet || m_expressi
ons->size() > 0); |
42 } | 42 } |
| 43 inline MediaQuery::Restrictor restrictor() { return m_restrictor; } |
43 | 44 |
44 inline void setRestrictor(MediaQuery::Restrictor restrictor) { m_restrictor
= restrictor; } | 45 inline void setRestrictor(MediaQuery::Restrictor restrictor) { m_restrictor
= restrictor; } |
45 | 46 |
46 inline void setMediaFeature(const String& str) { m_mediaFeature = str; } | 47 inline void setMediaFeature(const String& str) { m_mediaFeature = str; } |
47 }; | 48 }; |
48 | 49 |
49 class MediaQueryParser { | 50 class MediaQueryParser { |
50 STACK_ALLOCATED(); | 51 STACK_ALLOCATED(); |
51 public: | 52 public: |
52 static PassRefPtrWillBeRawPtr<MediaQuerySet> parseMediaQuerySet(const String
&); | 53 static PassRefPtrWillBeRawPtr<MediaQuerySet> parseMediaQuerySet(const String
&); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 const static State ReadFeatureEnd; | 102 const static State ReadFeatureEnd; |
102 const static State SkipUntilComma; | 103 const static State SkipUntilComma; |
103 const static State SkipUntilBlockEnd; | 104 const static State SkipUntilBlockEnd; |
104 const static State Done; | 105 const static State Done; |
105 | 106 |
106 }; | 107 }; |
107 | 108 |
108 } // namespace blink | 109 } // namespace blink |
109 | 110 |
110 #endif // MediaQueryParser_h | 111 #endif // MediaQueryParser_h |
OLD | NEW |