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 #include "core/css/parser/CSSPropertyParserHelpers.h" | 5 #include "core/css/parser/CSSPropertyParserHelpers.h" |
6 | 6 |
7 #include "core/css/CSSCalculationValue.h" | 7 #include "core/css/CSSCalculationValue.h" |
8 #include "core/css/CSSStringValue.h" | 8 #include "core/css/CSSStringValue.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 281 |
282 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeIdentRange(CSSParserTokenRange&
range, CSSValueID lower, CSSValueID upper) | 282 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeIdentRange(CSSParserTokenRange&
range, CSSValueID lower, CSSValueID upper) |
283 { | 283 { |
284 if (range.peek().id() < lower || range.peek().id() > upper) | 284 if (range.peek().id() < lower || range.peek().id() > upper) |
285 return nullptr; | 285 return nullptr; |
286 return consumeIdent(range); | 286 return consumeIdent(range); |
287 } | 287 } |
288 | 288 |
289 PassRefPtrWillBeRawPtr<CSSCustomIdentValue> consumeCustomIdent(CSSParserTokenRan
ge& range) | 289 PassRefPtrWillBeRawPtr<CSSCustomIdentValue> consumeCustomIdent(CSSParserTokenRan
ge& range) |
290 { | 290 { |
291 if (range.peek().type() != IdentToken) | 291 if (range.peek().type() != IdentToken || isCSSWideKeyword(range.peek().id())
) |
292 return nullptr; | 292 return nullptr; |
293 return CSSCustomIdentValue::create(range.consumeIncludingWhitespace().value(
)); | 293 return CSSCustomIdentValue::create(range.consumeIncludingWhitespace().value(
)); |
294 } | 294 } |
295 | 295 |
296 PassRefPtrWillBeRawPtr<CSSStringValue> consumeString(CSSParserTokenRange& range) | 296 PassRefPtrWillBeRawPtr<CSSStringValue> consumeString(CSSParserTokenRange& range) |
297 { | 297 { |
298 if (range.peek().type() != StringToken) | 298 if (range.peek().type() != StringToken) |
299 return nullptr; | 299 return nullptr; |
300 return CSSStringValue::create(range.consumeIncludingWhitespace().value()); | 300 return CSSStringValue::create(range.consumeIncludingWhitespace().value()); |
301 } | 301 } |
(...skipping 16 matching lines...) Expand all Loading... |
318 range.consumeWhitespace(); | 318 range.consumeWhitespace(); |
319 return next.value(); | 319 return next.value(); |
320 } | 320 } |
321 | 321 |
322 return String(); | 322 return String(); |
323 } | 323 } |
324 | 324 |
325 } // namespace CSSPropertyParserHelpers | 325 } // namespace CSSPropertyParserHelpers |
326 | 326 |
327 } // namespace blink | 327 } // namespace blink |
OLD | NEW |