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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h

Issue 1808753002: Make consumeCustomIdent exclude css wide keywords (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add subtests Created 4 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 CSSPropertyParserHelpers_h 5 #ifndef CSSPropertyParserHelpers_h
6 #define CSSPropertyParserHelpers_h 6 #define CSSPropertyParserHelpers_h
7 7
8 #include "core/css/CSSValuePool.h" 8 #include "core/css/CSSValuePool.h"
9 #include "core/css/parser/CSSParserMode.h" 9 #include "core/css/parser/CSSParserMode.h"
10 #include "core/css/parser/CSSParserTokenRange.h" 10 #include "core/css/parser/CSSParserTokenRange.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 return id == head || identMatches<tail...>(id); 61 return id == head || identMatches<tail...>(id);
62 } 62 }
63 63
64 template<CSSValueID... names> PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeI dent(CSSParserTokenRange& range) 64 template<CSSValueID... names> PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeI dent(CSSParserTokenRange& range)
65 { 65 {
66 if (range.peek().type() != IdentToken || !identMatches<names...>(range.peek( ).id())) 66 if (range.peek().type() != IdentToken || !identMatches<names...>(range.peek( ).id()))
67 return nullptr; 67 return nullptr;
68 return cssValuePool().createIdentifierValue(range.consumeIncludingWhitespace ().id()); 68 return cssValuePool().createIdentifierValue(range.consumeIncludingWhitespace ().id());
69 } 69 }
70 70
71 static inline bool isCSSWideKeyword(const CSSValueID& id)
72 {
73 return id == CSSValueInitial || id == CSSValueInherit || id == CSSValueUnset || id == CSSValueDefault;
74 }
75
71 } // namespace CSSPropertyParserHelpers 76 } // namespace CSSPropertyParserHelpers
72 77
73 } // namespace blink 78 } // namespace blink
74 79
75 #endif // CSSPropertyParserHelpers_h 80 #endif // CSSPropertyParserHelpers_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698