OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/CSSParser.h" | 5 #include "core/css/parser/CSSParser.h" |
6 | 6 |
7 #include "core/css/CSSColorValue.h" | 7 #include "core/css/CSSColorValue.h" |
8 #include "core/css/CSSKeyframeRule.h" | 8 #include "core/css/CSSKeyframeRule.h" |
9 #include "core/css/StyleColor.h" | 9 #include "core/css/StyleColor.h" |
10 #include "core/css/StylePropertySet.h" | 10 #include "core/css/StylePropertySet.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 return false; | 82 return false; |
83 CSSParserMode parserMode = declaration->cssParserMode(); | 83 CSSParserMode parserMode = declaration->cssParserMode(); |
84 CSSParserContext context(parserMode, 0); | 84 CSSParserContext context(parserMode, 0); |
85 if (styleSheet) { | 85 if (styleSheet) { |
86 context = styleSheet->parserContext(); | 86 context = styleSheet->parserContext(); |
87 context.setMode(parserMode); | 87 context.setMode(parserMode); |
88 } | 88 } |
89 return CSSParserImpl::parseVariableValue(declaration, propertyName, value, i
mportant, context); | 89 return CSSParserImpl::parseVariableValue(declaration, propertyName, value, i
mportant, context); |
90 } | 90 } |
91 | 91 |
| 92 PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> CSSParser::parseCustomProperty
Set(CSSParserTokenRange range) |
| 93 { |
| 94 return CSSParserImpl::parseCustomPropertySet(range); |
| 95 } |
| 96 |
92 bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID u
nresolvedProperty, const String& string, bool important, const CSSParserContext&
context) | 97 bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID u
nresolvedProperty, const String& string, bool important, const CSSParserContext&
context) |
93 { | 98 { |
94 return CSSParserImpl::parseValue(declaration, unresolvedProperty, string, im
portant, context); | 99 return CSSParserImpl::parseValue(declaration, unresolvedProperty, string, im
portant, context); |
95 } | 100 } |
96 | 101 |
97 PassRefPtrWillBeRawPtr<CSSValue> CSSParser::parseSingleValue(CSSPropertyID prope
rtyID, const String& string, const CSSParserContext& context) | 102 PassRefPtrWillBeRawPtr<CSSValue> CSSParser::parseSingleValue(CSSPropertyID prope
rtyID, const String& string, const CSSParserContext& context) |
98 { | 103 { |
99 if (string.isEmpty()) | 104 if (string.isEmpty()) |
100 return nullptr; | 105 return nullptr; |
101 if (RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue
(propertyID, string, context.mode())) | 106 if (RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue
(propertyID, string, context.mode())) |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 builder.appendLiteral(" : "); | 178 builder.appendLiteral(" : "); |
174 builder.append(propertyValue); | 179 builder.append(propertyValue); |
175 builder.appendLiteral("; }"); | 180 builder.appendLiteral("; }"); |
176 RefPtrWillBeRawPtr<StyleRuleBase> rule = parseRule(context, nullptr, builder
.toString()); | 181 RefPtrWillBeRawPtr<StyleRuleBase> rule = parseRule(context, nullptr, builder
.toString()); |
177 if (!rule || !rule->isFontFaceRule()) | 182 if (!rule || !rule->isFontFaceRule()) |
178 return nullptr; | 183 return nullptr; |
179 return toStyleRuleFontFace(rule.get())->properties().getPropertyCSSValue(pro
pertyID); | 184 return toStyleRuleFontFace(rule.get())->properties().getPropertyCSSValue(pro
pertyID); |
180 } | 185 } |
181 | 186 |
182 } // namespace blink | 187 } // namespace blink |
OLD | NEW |