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

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

Issue 867363002: Some invalid media queries are parsed as valid (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add a test 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 22 matching lines...) Expand all
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698