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

Side by Side Diff: Source/core/css/parser/MediaQueryParser.h

Issue 836373002: Make media query feature values more strict (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add two more tests Created 5 years, 11 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 // 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 14 matching lines...) Expand all
25 String m_mediaType; 25 String m_mediaType;
26 OwnPtrWillBeMember<ExpressionHeapVector> m_expressions; 26 OwnPtrWillBeMember<ExpressionHeapVector> m_expressions;
27 String m_mediaFeature; 27 String m_mediaFeature;
28 CSSParserValueList m_valueList; 28 CSSParserValueList m_valueList;
29 bool m_mediaTypeSet; 29 bool m_mediaTypeSet;
30 30
31 public: 31 public:
32 MediaQueryData(); 32 MediaQueryData();
33 void clear(); 33 void clear();
34 bool addExpression(); 34 bool addExpression();
35 void addParserValue(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 43
44 inline void setRestrictor(MediaQuery::Restrictor restrictor) { m_restrictor = restrictor; } 44 inline void setRestrictor(MediaQuery::Restrictor restrictor) { m_restrictor = restrictor; }
45 45
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 const static State ReadFeatureEnd; 100 const static State ReadFeatureEnd;
101 const static State SkipUntilComma; 101 const static State SkipUntilComma;
102 const static State SkipUntilBlockEnd; 102 const static State SkipUntilBlockEnd;
103 const static State Done; 103 const static State Done;
104 104
105 }; 105 };
106 106
107 } // namespace blink 107 } // namespace blink
108 108
109 #endif // MediaQueryParser_h 109 #endif // MediaQueryParser_h
OLDNEW
« no previous file with comments | « Source/core/css/MediaQueryEvaluatorTest.cpp ('k') | Source/core/css/parser/MediaQueryParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698