OLD | NEW |
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 Loading... |
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 |
OLD | NEW |