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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 | 606 |
607 static CSSValue* consumeSpacing(CSSParserTokenRange& range, | 607 static CSSValue* consumeSpacing(CSSParserTokenRange& range, |
608 CSSParserMode cssParserMode) { | 608 CSSParserMode cssParserMode) { |
609 if (range.peek().id() == CSSValueNormal) | 609 if (range.peek().id() == CSSValueNormal) |
610 return consumeIdent(range); | 610 return consumeIdent(range); |
611 // TODO(timloh): allow <percentage>s in word-spacing. | 611 // TODO(timloh): allow <percentage>s in word-spacing. |
612 return consumeLength(range, cssParserMode, ValueRangeAll, | 612 return consumeLength(range, cssParserMode, ValueRangeAll, |
613 UnitlessQuirk::Allow); | 613 UnitlessQuirk::Allow); |
614 } | 614 } |
615 | 615 |
616 static CSSValue* consumeTabSize(CSSParserTokenRange& range, | |
617 CSSParserMode cssParserMode) { | |
618 CSSPrimitiveValue* parsedValue = consumeInteger(range, 0); | |
619 if (parsedValue) | |
620 return parsedValue; | |
621 return consumeLength(range, cssParserMode, ValueRangeNonNegative); | |
622 } | |
623 | |
624 static CSSValue* consumeTextSizeAdjust(CSSParserTokenRange& range, | 616 static CSSValue* consumeTextSizeAdjust(CSSParserTokenRange& range, |
625 CSSParserMode cssParserMode) { | 617 CSSParserMode cssParserMode) { |
626 if (range.peek().id() == CSSValueAuto) | 618 if (range.peek().id() == CSSValueAuto) |
627 return consumeIdent(range); | 619 return consumeIdent(range); |
628 if (range.peek().id() == CSSValueNone) | 620 if (range.peek().id() == CSSValueNone) |
629 return consumeIdent(range); | 621 return consumeIdent(range); |
630 return consumePercent(range, ValueRangeNonNegative); | 622 return consumePercent(range, ValueRangeNonNegative); |
631 } | 623 } |
632 | 624 |
633 static CSSValue* consumeFontSize( | 625 static CSSValue* consumeFontSize( |
(...skipping 2465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3099 return consumeFontVariantNumeric(m_range); | 3091 return consumeFontVariantNumeric(m_range); |
3100 case CSSPropertyFontFeatureSettings: | 3092 case CSSPropertyFontFeatureSettings: |
3101 return consumeFontFeatureSettings(m_range); | 3093 return consumeFontFeatureSettings(m_range); |
3102 case CSSPropertyFontFamily: | 3094 case CSSPropertyFontFamily: |
3103 return consumeFontFamily(m_range); | 3095 return consumeFontFamily(m_range); |
3104 case CSSPropertyFontWeight: | 3096 case CSSPropertyFontWeight: |
3105 return consumeFontWeight(m_range); | 3097 return consumeFontWeight(m_range); |
3106 case CSSPropertyLetterSpacing: | 3098 case CSSPropertyLetterSpacing: |
3107 case CSSPropertyWordSpacing: | 3099 case CSSPropertyWordSpacing: |
3108 return consumeSpacing(m_range, m_context->mode()); | 3100 return consumeSpacing(m_range, m_context->mode()); |
3109 case CSSPropertyTabSize: | |
3110 return consumeTabSize(m_range, m_context->mode()); | |
3111 case CSSPropertyTextSizeAdjust: | 3101 case CSSPropertyTextSizeAdjust: |
3112 return consumeTextSizeAdjust(m_range, m_context->mode()); | 3102 return consumeTextSizeAdjust(m_range, m_context->mode()); |
3113 case CSSPropertyFontSize: | 3103 case CSSPropertyFontSize: |
3114 return consumeFontSize(m_range, m_context->mode(), UnitlessQuirk::Allow); | 3104 return consumeFontSize(m_range, m_context->mode(), UnitlessQuirk::Allow); |
3115 case CSSPropertyLineHeight: | 3105 case CSSPropertyLineHeight: |
3116 return consumeLineHeight(m_range, m_context->mode()); | 3106 return consumeLineHeight(m_range, m_context->mode()); |
3117 case CSSPropertyScale: | 3107 case CSSPropertyScale: |
3118 return consumeScale(m_range); | 3108 return consumeScale(m_range); |
3119 case CSSPropertyWebkitBorderHorizontalSpacing: | 3109 case CSSPropertyWebkitBorderHorizontalSpacing: |
3120 case CSSPropertyWebkitBorderVerticalSpacing: | 3110 case CSSPropertyWebkitBorderVerticalSpacing: |
(...skipping 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4928 case CSSPropertyGridTemplate: | 4918 case CSSPropertyGridTemplate: |
4929 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); | 4919 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); |
4930 case CSSPropertyGrid: | 4920 case CSSPropertyGrid: |
4931 return consumeGridShorthand(important); | 4921 return consumeGridShorthand(important); |
4932 default: | 4922 default: |
4933 return false; | 4923 return false; |
4934 } | 4924 } |
4935 } | 4925 } |
4936 | 4926 |
4937 } // namespace blink | 4927 } // namespace blink |
OLD | NEW |