OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/CSSPropertyParser.h" | 5 #include "core/css/parser/CSSPropertyParser.h" |
6 | 6 |
7 #include "core/StylePropertyShorthand.h" | 7 #include "core/StylePropertyShorthand.h" |
8 #include "core/css/CSSBasicShapeValues.h" | 8 #include "core/css/CSSBasicShapeValues.h" |
9 #include "core/css/CSSBorderImage.h" | 9 #include "core/css/CSSBorderImage.h" |
10 #include "core/css/CSSContentDistributionValue.h" | 10 #include "core/css/CSSContentDistributionValue.h" |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 CSSStringValue* parsedValue = consumeString(range); | 402 CSSStringValue* parsedValue = consumeString(range); |
403 if (!parsedValue) | 403 if (!parsedValue) |
404 return nullptr; | 404 return nullptr; |
405 values->append(*parsedValue); | 405 values->append(*parsedValue); |
406 } | 406 } |
407 if (values->length() && values->length() % 2 == 0) | 407 if (values->length() && values->length() % 2 == 0) |
408 return values; | 408 return values; |
409 return nullptr; | 409 return nullptr; |
410 } | 410 } |
411 | 411 |
412 static CSSValue* consumeWebkitHighlight(CSSParserTokenRange& range) { | |
413 if (range.peek().id() == CSSValueNone) | |
414 return consumeIdent(range); | |
415 return consumeString(range); | |
416 } | |
417 | |
418 class FontVariantLigaturesParser { | 412 class FontVariantLigaturesParser { |
419 STACK_ALLOCATED(); | 413 STACK_ALLOCATED(); |
420 | 414 |
421 public: | 415 public: |
422 FontVariantLigaturesParser() | 416 FontVariantLigaturesParser() |
423 : m_sawCommonLigaturesValue(false), | 417 : m_sawCommonLigaturesValue(false), |
424 m_sawDiscretionaryLigaturesValue(false), | 418 m_sawDiscretionaryLigaturesValue(false), |
425 m_sawHistoricalLigaturesValue(false), | 419 m_sawHistoricalLigaturesValue(false), |
426 m_sawContextualLigaturesValue(false), | 420 m_sawContextualLigaturesValue(false), |
427 m_result(CSSValueList::createSpaceSeparated()) {} | 421 m_result(CSSValueList::createSpaceSeparated()) {} |
(...skipping 2982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3410 const CSSPropertyDescriptor& cssPropertyDesc = | 3404 const CSSPropertyDescriptor& cssPropertyDesc = |
3411 CSSPropertyDescriptor::get(property); | 3405 CSSPropertyDescriptor::get(property); |
3412 if (cssPropertyDesc.temporaryCanReadValue) | 3406 if (cssPropertyDesc.temporaryCanReadValue) |
3413 return cssPropertyDesc.parseSingleValue(m_range, m_context); | 3407 return cssPropertyDesc.parseSingleValue(m_range, m_context); |
3414 | 3408 |
3415 switch (property) { | 3409 switch (property) { |
3416 case CSSPropertyPage: | 3410 case CSSPropertyPage: |
3417 return consumePage(m_range); | 3411 return consumePage(m_range); |
3418 case CSSPropertyQuotes: | 3412 case CSSPropertyQuotes: |
3419 return consumeQuotes(m_range); | 3413 return consumeQuotes(m_range); |
3420 case CSSPropertyWebkitHighlight: | |
3421 return consumeWebkitHighlight(m_range); | |
3422 case CSSPropertyFontVariantCaps: | 3414 case CSSPropertyFontVariantCaps: |
3423 return consumeFontVariantCaps(m_range); | 3415 return consumeFontVariantCaps(m_range); |
3424 case CSSPropertyFontVariantLigatures: | 3416 case CSSPropertyFontVariantLigatures: |
3425 return consumeFontVariantLigatures(m_range); | 3417 return consumeFontVariantLigatures(m_range); |
3426 case CSSPropertyFontVariantNumeric: | 3418 case CSSPropertyFontVariantNumeric: |
3427 return consumeFontVariantNumeric(m_range); | 3419 return consumeFontVariantNumeric(m_range); |
3428 case CSSPropertyFontFeatureSettings: | 3420 case CSSPropertyFontFeatureSettings: |
3429 return consumeFontFeatureSettings(m_range); | 3421 return consumeFontFeatureSettings(m_range); |
3430 case CSSPropertyFontFamily: | 3422 case CSSPropertyFontFamily: |
3431 return consumeFontFamily(m_range); | 3423 return consumeFontFamily(m_range); |
(...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5296 case CSSPropertyGridTemplate: | 5288 case CSSPropertyGridTemplate: |
5297 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); | 5289 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); |
5298 case CSSPropertyGrid: | 5290 case CSSPropertyGrid: |
5299 return consumeGridShorthand(important); | 5291 return consumeGridShorthand(important); |
5300 default: | 5292 default: |
5301 return false; | 5293 return false; |
5302 } | 5294 } |
5303 } | 5295 } |
5304 | 5296 |
5305 } // namespace blink | 5297 } // namespace blink |
OLD | NEW |