| 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" |
| 11 #include "core/css/StyleRule.h" | 11 #include "core/css/StyleRule.h" |
| 12 #include "core/css/StyleSheetContents.h" | 12 #include "core/css/StyleSheetContents.h" |
| 13 #include "core/css/parser/CSSParserFastPaths.h" | 13 #include "core/css/parser/CSSParserFastPaths.h" |
| 14 #include "core/css/parser/CSSParserImpl.h" | 14 #include "core/css/parser/CSSParserImpl.h" |
| 15 #include "core/css/parser/CSSPropertyParser.h" | 15 #include "core/css/parser/CSSPropertyParser.h" |
| 16 #include "core/css/parser/CSSSelectorParser.h" | 16 #include "core/css/parser/CSSSelectorParser.h" |
| 17 #include "core/css/parser/CSSSupportsParser.h" | 17 #include "core/css/parser/CSSSupportsParser.h" |
| 18 #include "core/css/parser/CSSTokenizer.h" | 18 #include "core/css/parser/CSSTokenizer.h" |
| 19 #include "core/css/parser/CSSVariableParser.h" | 19 #include "core/css/parser/CSSVariableParser.h" |
| 20 #include "core/layout/LayoutTheme.h" | 20 #include "core/layout/LayoutTheme.h" |
| 21 #include <memory> |
| 21 | 22 |
| 22 namespace blink { | 23 namespace blink { |
| 23 | 24 |
| 24 bool CSSParser::parseDeclarationList(const CSSParserContext& context, MutableSty
lePropertySet* propertySet, const String& declaration) | 25 bool CSSParser::parseDeclarationList(const CSSParserContext& context, MutableSty
lePropertySet* propertySet, const String& declaration) |
| 25 { | 26 { |
| 26 return CSSParserImpl::parseDeclarationList(propertySet, declaration, context
); | 27 return CSSParserImpl::parseDeclarationList(propertySet, declaration, context
); |
| 27 } | 28 } |
| 28 | 29 |
| 29 void CSSParser::parseDeclarationListForInspector(const CSSParserContext& context
, const String& declaration, CSSParserObserver& observer) | 30 void CSSParser::parseDeclarationListForInspector(const CSSParserContext& context
, const String& declaration, CSSParserObserver& observer) |
| 30 { | 31 { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 return value; | 108 return value; |
| 108 CSSTokenizer::Scope scope(string); | 109 CSSTokenizer::Scope scope(string); |
| 109 return CSSPropertyParser::parseSingleValue(propertyID, scope.tokenRange(), c
ontext); | 110 return CSSPropertyParser::parseSingleValue(propertyID, scope.tokenRange(), c
ontext); |
| 110 } | 111 } |
| 111 | 112 |
| 112 ImmutableStylePropertySet* CSSParser::parseInlineStyleDeclaration(const String&
styleString, Element* element) | 113 ImmutableStylePropertySet* CSSParser::parseInlineStyleDeclaration(const String&
styleString, Element* element) |
| 113 { | 114 { |
| 114 return CSSParserImpl::parseInlineStyleDeclaration(styleString, element); | 115 return CSSParserImpl::parseInlineStyleDeclaration(styleString, element); |
| 115 } | 116 } |
| 116 | 117 |
| 117 PassOwnPtr<Vector<double>> CSSParser::parseKeyframeKeyList(const String& keyList
) | 118 std::unique_ptr<Vector<double>> CSSParser::parseKeyframeKeyList(const String& ke
yList) |
| 118 { | 119 { |
| 119 return CSSParserImpl::parseKeyframeKeyList(keyList); | 120 return CSSParserImpl::parseKeyframeKeyList(keyList); |
| 120 } | 121 } |
| 121 | 122 |
| 122 StyleRuleKeyframe* CSSParser::parseKeyframeRule(const CSSParserContext& context,
const String& rule) | 123 StyleRuleKeyframe* CSSParser::parseKeyframeRule(const CSSParserContext& context,
const String& rule) |
| 123 { | 124 { |
| 124 StyleRuleBase* keyframe = CSSParserImpl::parseRule(rule, context, nullptr, C
SSParserImpl::KeyframeRules); | 125 StyleRuleBase* keyframe = CSSParserImpl::parseRule(rule, context, nullptr, C
SSParserImpl::KeyframeRules); |
| 125 return toStyleRuleKeyframe(keyframe); | 126 return toStyleRuleKeyframe(keyframe); |
| 126 } | 127 } |
| 127 | 128 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 builder.append(" : "); | 175 builder.append(" : "); |
| 175 builder.append(propertyValue); | 176 builder.append(propertyValue); |
| 176 builder.append("; }"); | 177 builder.append("; }"); |
| 177 StyleRuleBase* rule = parseRule(context, nullptr, builder.toString()); | 178 StyleRuleBase* rule = parseRule(context, nullptr, builder.toString()); |
| 178 if (!rule || !rule->isFontFaceRule()) | 179 if (!rule || !rule->isFontFaceRule()) |
| 179 return nullptr; | 180 return nullptr; |
| 180 return toStyleRuleFontFace(rule)->properties().getPropertyCSSValue(propertyI
D); | 181 return toStyleRuleFontFace(rule)->properties().getPropertyCSSValue(propertyI
D); |
| 181 } | 182 } |
| 182 | 183 |
| 183 } // namespace blink | 184 } // namespace blink |
| OLD | NEW |