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