| 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/CSSParserValues.h" | 8 #include "core/css/CSSParserValues.h" |
| 9 #include "core/css/MediaList.h" | 9 #include "core/css/MediaList.h" |
| 10 #include "core/css/MediaQuery.h" | 10 #include "core/css/MediaQuery.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 inline bool currentMediaQueryChanged() const | 38 inline bool currentMediaQueryChanged() const |
| 39 { | 39 { |
| 40 return (m_restrictor != MediaQuery::None || m_mediaTypeSet || m_expressi
ons->size() > 0); | 40 return (m_restrictor != MediaQuery::None || m_mediaTypeSet || m_expressi
ons->size() > 0); |
| 41 } | 41 } |
| 42 | 42 |
| 43 inline void setRestrictor(MediaQuery::Restrictor restrictor) { m_restrictor
= restrictor; } | 43 inline void setRestrictor(MediaQuery::Restrictor restrictor) { m_restrictor
= restrictor; } |
| 44 | 44 |
| 45 inline void setMediaFeature(const String& str) { m_mediaFeature = str; } | 45 inline void setMediaFeature(const String& str) { m_mediaFeature = str; } |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 typedef Vector<MediaQueryToken> TokenList; |
| 49 typedef TokenList::iterator TokenIterator; |
| 50 |
| 48 class MediaQueryParser { | 51 class MediaQueryParser { |
| 49 STACK_ALLOCATED(); | 52 STACK_ALLOCATED(); |
| 50 public: | 53 public: |
| 51 typedef Vector<MediaQueryToken>::iterator TokenIterator; | |
| 52 | 54 |
| 53 static PassRefPtrWillBeRawPtr<MediaQuerySet> parseMediaQuerySet(const String
&); | 55 static PassRefPtrWillBeRawPtr<MediaQuerySet> parseMediaQuerySet(const String
&); |
| 54 static PassRefPtrWillBeRawPtr<MediaQuerySet> parseMediaCondition(TokenIterat
or, TokenIterator endToken); | 56 static PassRefPtrWillBeRawPtr<MediaQuerySet> parseMediaCondition(TokenIterat
or, TokenIterator endToken); |
| 55 | 57 |
| 56 private: | 58 private: |
| 57 enum ParserType { | 59 enum ParserType { |
| 58 MediaQuerySetParser, | 60 MediaQuerySetParser, |
| 59 MediaConditionParser, | 61 MediaConditionParser, |
| 60 }; | 62 }; |
| 61 | 63 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 const static State ReadFeatureEnd; | 120 const static State ReadFeatureEnd; |
| 119 const static State SkipUntilComma; | 121 const static State SkipUntilComma; |
| 120 const static State SkipUntilBlockEnd; | 122 const static State SkipUntilBlockEnd; |
| 121 const static State Done; | 123 const static State Done; |
| 122 | 124 |
| 123 }; | 125 }; |
| 124 | 126 |
| 125 } // namespace WebCore | 127 } // namespace WebCore |
| 126 | 128 |
| 127 #endif // MediaQueryParser_h | 129 #endif // MediaQueryParser_h |
| OLD | NEW |