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 1921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1932 } | 1932 } |
1933 | 1933 |
1934 static CSSPrimitiveValue* consumeBaselineShift(CSSParserTokenRange& range) | 1934 static CSSPrimitiveValue* consumeBaselineShift(CSSParserTokenRange& range) |
1935 { | 1935 { |
1936 CSSValueID id = range.peek().id(); | 1936 CSSValueID id = range.peek().id(); |
1937 if (id == CSSValueBaseline || id == CSSValueSub || id == CSSValueSuper) | 1937 if (id == CSSValueBaseline || id == CSSValueSub || id == CSSValueSuper) |
1938 return consumeIdent(range); | 1938 return consumeIdent(range); |
1939 return consumeLengthOrPercent(range, SVGAttributeMode, ValueRangeAll); | 1939 return consumeLengthOrPercent(range, SVGAttributeMode, ValueRangeAll); |
1940 } | 1940 } |
1941 | 1941 |
| 1942 static CSSPrimitiveValue* consumeRxOrRy(CSSParserTokenRange& range) |
| 1943 { |
| 1944 if (range.peek().id() == CSSValueAuto) |
| 1945 return consumeIdent(range); |
| 1946 return consumeLengthOrPercent(range, SVGAttributeMode, ValueRangeAll, Unitle
ssQuirk::Forbid); |
| 1947 } |
| 1948 |
1942 static CSSValue* createCSSImageValueWithReferrer(const AtomicString& rawValue, c
onst CSSParserContext& context) | 1949 static CSSValue* createCSSImageValueWithReferrer(const AtomicString& rawValue, c
onst CSSParserContext& context) |
1943 { | 1950 { |
1944 CSSValue* imageValue = CSSImageValue::create(rawValue, context.completeURL(r
awValue)); | 1951 CSSValue* imageValue = CSSImageValue::create(rawValue, context.completeURL(r
awValue)); |
1945 toCSSImageValue(imageValue)->setReferrer(context.referrer()); | 1952 toCSSImageValue(imageValue)->setReferrer(context.referrer()); |
1946 return imageValue; | 1953 return imageValue; |
1947 } | 1954 } |
1948 | 1955 |
1949 static CSSValue* consumeImageSet(CSSParserTokenRange& range, const CSSParserCont
ext& context) | 1956 static CSSValue* consumeImageSet(CSSParserTokenRange& range, const CSSParserCont
ext& context) |
1950 { | 1957 { |
1951 CSSParserTokenRange rangeCopy = range; | 1958 CSSParserTokenRange rangeCopy = range; |
(...skipping 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3842 return consumeBaselineShift(m_range); | 3849 return consumeBaselineShift(m_range); |
3843 case CSSPropertyStrokeMiterlimit: | 3850 case CSSPropertyStrokeMiterlimit: |
3844 return consumeNumber(m_range, ValueRangeNonNegative); | 3851 return consumeNumber(m_range, ValueRangeNonNegative); |
3845 case CSSPropertyStrokeWidth: | 3852 case CSSPropertyStrokeWidth: |
3846 case CSSPropertyStrokeDashoffset: | 3853 case CSSPropertyStrokeDashoffset: |
3847 case CSSPropertyCx: | 3854 case CSSPropertyCx: |
3848 case CSSPropertyCy: | 3855 case CSSPropertyCy: |
3849 case CSSPropertyX: | 3856 case CSSPropertyX: |
3850 case CSSPropertyY: | 3857 case CSSPropertyY: |
3851 case CSSPropertyR: | 3858 case CSSPropertyR: |
| 3859 return consumeLengthOrPercent(m_range, SVGAttributeMode, ValueRangeAll,
UnitlessQuirk::Forbid); |
3852 case CSSPropertyRx: | 3860 case CSSPropertyRx: |
3853 case CSSPropertyRy: | 3861 case CSSPropertyRy: |
3854 return consumeLengthOrPercent(m_range, SVGAttributeMode, ValueRangeAll,
UnitlessQuirk::Forbid); | 3862 return consumeRxOrRy(m_range); |
3855 case CSSPropertyCursor: | 3863 case CSSPropertyCursor: |
3856 return consumeCursor(m_range, m_context, inQuirksMode()); | 3864 return consumeCursor(m_range, m_context, inQuirksMode()); |
3857 case CSSPropertyContain: | 3865 case CSSPropertyContain: |
3858 return consumeContain(m_range); | 3866 return consumeContain(m_range); |
3859 case CSSPropertyTransformOrigin: | 3867 case CSSPropertyTransformOrigin: |
3860 return consumeTransformOrigin(m_range, m_context.mode(), UnitlessQuirk::
Forbid); | 3868 return consumeTransformOrigin(m_range, m_context.mode(), UnitlessQuirk::
Forbid); |
3861 case CSSPropertyContent: | 3869 case CSSPropertyContent: |
3862 return consumeContent(m_range, m_context); | 3870 return consumeContent(m_range, m_context); |
3863 case CSSPropertyListStyleImage: | 3871 case CSSPropertyListStyleImage: |
3864 case CSSPropertyBorderImageSource: | 3872 case CSSPropertyBorderImageSource: |
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5169 case CSSPropertyGridTemplate: | 5177 case CSSPropertyGridTemplate: |
5170 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); | 5178 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); |
5171 case CSSPropertyGrid: | 5179 case CSSPropertyGrid: |
5172 return consumeGridShorthand(important); | 5180 return consumeGridShorthand(important); |
5173 default: | 5181 default: |
5174 return false; | 5182 return false; |
5175 } | 5183 } |
5176 } | 5184 } |
5177 | 5185 |
5178 } // namespace blink | 5186 } // namespace blink |
OLD | NEW |