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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 CSSStringValue* parsedValue = consumeString(range); | 337 CSSStringValue* parsedValue = consumeString(range); |
338 if (!parsedValue) | 338 if (!parsedValue) |
339 return nullptr; | 339 return nullptr; |
340 values->append(*parsedValue); | 340 values->append(*parsedValue); |
341 } | 341 } |
342 if (values->length() && values->length() % 2 == 0) | 342 if (values->length() && values->length() % 2 == 0) |
343 return values; | 343 return values; |
344 return nullptr; | 344 return nullptr; |
345 } | 345 } |
346 | 346 |
347 static CSSValue* consumeWebkitHighlight(CSSParserTokenRange& range) { | |
348 if (range.peek().id() == CSSValueNone) | |
349 return consumeIdent(range); | |
350 return consumeString(range); | |
351 } | |
352 | |
353 class FontVariantLigaturesParser { | 347 class FontVariantLigaturesParser { |
354 STACK_ALLOCATED(); | 348 STACK_ALLOCATED(); |
355 | 349 |
356 public: | 350 public: |
357 FontVariantLigaturesParser() | 351 FontVariantLigaturesParser() |
358 : m_sawCommonLigaturesValue(false), | 352 : m_sawCommonLigaturesValue(false), |
359 m_sawDiscretionaryLigaturesValue(false), | 353 m_sawDiscretionaryLigaturesValue(false), |
360 m_sawHistoricalLigaturesValue(false), | 354 m_sawHistoricalLigaturesValue(false), |
361 m_sawContextualLigaturesValue(false), | 355 m_sawContextualLigaturesValue(false), |
362 m_result(CSSValueList::createSpaceSeparated()) {} | 356 m_result(CSSValueList::createSpaceSeparated()) {} |
(...skipping 2669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3032 // other properties, those properties will be taken out of the switch | 3026 // other properties, those properties will be taken out of the switch |
3033 // statement. | 3027 // statement. |
3034 const CSSPropertyDescriptor& cssPropertyDesc = | 3028 const CSSPropertyDescriptor& cssPropertyDesc = |
3035 CSSPropertyDescriptor::get(property); | 3029 CSSPropertyDescriptor::get(property); |
3036 if (cssPropertyDesc.temporaryCanReadValue) | 3030 if (cssPropertyDesc.temporaryCanReadValue) |
3037 return cssPropertyDesc.parseSingleValue(m_range, m_context); | 3031 return cssPropertyDesc.parseSingleValue(m_range, m_context); |
3038 | 3032 |
3039 switch (property) { | 3033 switch (property) { |
3040 case CSSPropertyQuotes: | 3034 case CSSPropertyQuotes: |
3041 return consumeQuotes(m_range); | 3035 return consumeQuotes(m_range); |
3042 case CSSPropertyWebkitHighlight: | |
3043 return consumeWebkitHighlight(m_range); | |
3044 case CSSPropertyFontVariantCaps: | 3036 case CSSPropertyFontVariantCaps: |
3045 return consumeFontVariantCaps(m_range); | 3037 return consumeFontVariantCaps(m_range); |
3046 case CSSPropertyFontVariantLigatures: | 3038 case CSSPropertyFontVariantLigatures: |
3047 return consumeFontVariantLigatures(m_range); | 3039 return consumeFontVariantLigatures(m_range); |
3048 case CSSPropertyFontVariantNumeric: | 3040 case CSSPropertyFontVariantNumeric: |
3049 return consumeFontVariantNumeric(m_range); | 3041 return consumeFontVariantNumeric(m_range); |
3050 case CSSPropertyFontFeatureSettings: | 3042 case CSSPropertyFontFeatureSettings: |
3051 return consumeFontFeatureSettings(m_range); | 3043 return consumeFontFeatureSettings(m_range); |
3052 case CSSPropertyFontFamily: | 3044 case CSSPropertyFontFamily: |
3053 return consumeFontFamily(m_range); | 3045 return consumeFontFamily(m_range); |
(...skipping 1818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4872 case CSSPropertyGridTemplate: | 4864 case CSSPropertyGridTemplate: |
4873 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); | 4865 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); |
4874 case CSSPropertyGrid: | 4866 case CSSPropertyGrid: |
4875 return consumeGridShorthand(important); | 4867 return consumeGridShorthand(important); |
4876 default: | 4868 default: |
4877 return false; | 4869 return false; |
4878 } | 4870 } |
4879 } | 4871 } |
4880 | 4872 |
4881 } // namespace blink | 4873 } // namespace blink |
OLD | NEW |