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/CSSParserImpl.h" | 5 #include "core/css/parser/CSSParserImpl.h" |
6 | 6 |
7 #include "core/css/CSSCustomIdentValue.h" | 7 #include "core/css/CSSCustomIdentValue.h" |
8 #include "core/css/CSSCustomPropertyDeclaration.h" | 8 #include "core/css/CSSCustomPropertyDeclaration.h" |
9 #include "core/css/CSSKeyframesRule.h" | 9 #include "core/css/CSSKeyframesRule.h" |
10 #include "core/css/CSSStyleSheet.h" | 10 #include "core/css/CSSStyleSheet.h" |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 void CSSParserImpl::consumeDeclarationValue(CSSParserTokenRange range, | 941 void CSSParserImpl::consumeDeclarationValue(CSSParserTokenRange range, |
942 CSSPropertyID unresolvedProperty, | 942 CSSPropertyID unresolvedProperty, |
943 bool important, | 943 bool important, |
944 StyleRule::RuleType ruleType) { | 944 StyleRule::RuleType ruleType) { |
945 CSSPropertyParser::parseValue(unresolvedProperty, important, range, m_context, | 945 CSSPropertyParser::parseValue(unresolvedProperty, important, range, m_context, |
946 m_parsedProperties, ruleType); | 946 m_parsedProperties, ruleType); |
947 } | 947 } |
948 | 948 |
949 std::unique_ptr<Vector<double>> CSSParserImpl::consumeKeyframeKeyList( | 949 std::unique_ptr<Vector<double>> CSSParserImpl::consumeKeyframeKeyList( |
950 CSSParserTokenRange range) { | 950 CSSParserTokenRange range) { |
951 std::unique_ptr<Vector<double>> result = wrapUnique(new Vector<double>); | 951 std::unique_ptr<Vector<double>> result = WTF::wrapUnique(new Vector<double>); |
952 while (true) { | 952 while (true) { |
953 range.consumeWhitespace(); | 953 range.consumeWhitespace(); |
954 const CSSParserToken& token = range.consumeIncludingWhitespace(); | 954 const CSSParserToken& token = range.consumeIncludingWhitespace(); |
955 if (token.type() == PercentageToken && token.numericValue() >= 0 && | 955 if (token.type() == PercentageToken && token.numericValue() >= 0 && |
956 token.numericValue() <= 100) | 956 token.numericValue() <= 100) |
957 result->append(token.numericValue() / 100); | 957 result->append(token.numericValue() / 100); |
958 else if (token.type() == IdentToken && | 958 else if (token.type() == IdentToken && |
959 equalIgnoringASCIICase(token.value(), "from")) | 959 equalIgnoringASCIICase(token.value(), "from")) |
960 result->append(0); | 960 result->append(0); |
961 else if (token.type() == IdentToken && | 961 else if (token.type() == IdentToken && |
962 equalIgnoringASCIICase(token.value(), "to")) | 962 equalIgnoringASCIICase(token.value(), "to")) |
963 result->append(1); | 963 result->append(1); |
964 else | 964 else |
965 return nullptr; // Parser error, invalid value in keyframe selector | 965 return nullptr; // Parser error, invalid value in keyframe selector |
966 if (range.atEnd()) | 966 if (range.atEnd()) |
967 return result; | 967 return result; |
968 if (range.consume().type() != CommaToken) | 968 if (range.consume().type() != CommaToken) |
969 return nullptr; // Parser error | 969 return nullptr; // Parser error |
970 } | 970 } |
971 } | 971 } |
972 | 972 |
973 } // namespace blink | 973 } // namespace blink |
OLD | NEW |