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 3825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3836 if (url.isNull()) | 3836 if (url.isNull()) |
3837 return nullptr; | 3837 return nullptr; |
3838 CSSFontFaceSrcValue* uriValue(CSSFontFaceSrcValue::create(url, context.compl
eteURL(url), context.shouldCheckContentSecurityPolicy())); | 3838 CSSFontFaceSrcValue* uriValue(CSSFontFaceSrcValue::create(url, context.compl
eteURL(url), context.shouldCheckContentSecurityPolicy())); |
3839 uriValue->setReferrer(context.referrer()); | 3839 uriValue->setReferrer(context.referrer()); |
3840 | 3840 |
3841 if (range.peek().functionId() != CSSValueFormat) | 3841 if (range.peek().functionId() != CSSValueFormat) |
3842 return uriValue; | 3842 return uriValue; |
3843 | 3843 |
3844 // FIXME: https://drafts.csswg.org/css-fonts says that format() contains a c
omma-separated list of strings, | 3844 // FIXME: https://drafts.csswg.org/css-fonts says that format() contains a c
omma-separated list of strings, |
3845 // but CSSFontFaceSrcValue stores only one format. Allowing one format for n
ow. | 3845 // but CSSFontFaceSrcValue stores only one format. Allowing one format for n
ow. |
3846 // FIXME: IdentToken should not be supported here. | |
3847 CSSParserTokenRange args = consumeFunction(range); | 3846 CSSParserTokenRange args = consumeFunction(range); |
3848 const CSSParserToken& arg = args.consumeIncludingWhitespace(); | 3847 const CSSParserToken& arg = args.consumeIncludingWhitespace(); |
3849 if ((arg.type() != StringToken && arg.type() != IdentToken) || !args.atEnd()
) | 3848 if ((arg.type() != StringToken) || !args.atEnd()) |
3850 return nullptr; | 3849 return nullptr; |
3851 uriValue->setFormat(arg.value()); | 3850 uriValue->setFormat(arg.value()); |
3852 return uriValue; | 3851 return uriValue; |
3853 } | 3852 } |
3854 | 3853 |
3855 static CSSValue* consumeFontFaceSrcLocal(CSSParserTokenRange& range, const CSSPa
rserContext& context) | 3854 static CSSValue* consumeFontFaceSrcLocal(CSSParserTokenRange& range, const CSSPa
rserContext& context) |
3856 { | 3855 { |
3857 CSSParserTokenRange args = consumeFunction(range); | 3856 CSSParserTokenRange args = consumeFunction(range); |
3858 ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy = context.
shouldCheckContentSecurityPolicy(); | 3857 ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy = context.
shouldCheckContentSecurityPolicy(); |
3859 if (args.peek().type() == StringToken) { | 3858 if (args.peek().type() == StringToken) { |
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4957 case CSSPropertyGridTemplate: | 4956 case CSSPropertyGridTemplate: |
4958 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); | 4957 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); |
4959 case CSSPropertyGrid: | 4958 case CSSPropertyGrid: |
4960 return consumeGridShorthand(important); | 4959 return consumeGridShorthand(important); |
4961 default: | 4960 default: |
4962 return false; | 4961 return false; |
4963 } | 4962 } |
4964 } | 4963 } |
4965 | 4964 |
4966 } // namespace blink | 4965 } // namespace blink |
OLD | NEW |