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 "config.h" | 5 #include "config.h" |
6 #include "core/css/parser/CSSParserImpl.h" | 6 #include "core/css/parser/CSSParserImpl.h" |
7 | 7 |
8 #include "core/css/CSSKeyframesRule.h" | 8 #include "core/css/CSSKeyframesRule.h" |
9 #include "core/css/CSSStyleSheet.h" | 9 #include "core/css/CSSStyleSheet.h" |
10 #include "core/css/StylePropertySet.h" | 10 #include "core/css/StylePropertySet.h" |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 if (nameToken.type() == IdentToken) { | 302 if (nameToken.type() == IdentToken) { |
303 name = nameToken.value(); | 303 name = nameToken.value(); |
304 } else if (nameToken.type() == StringToken && webkitPrefixed) { | 304 } else if (nameToken.type() == StringToken && webkitPrefixed) { |
305 if (m_context.useCounter()) | 305 if (m_context.useCounter()) |
306 m_context.useCounter()->count(UseCounter::QuotedKeyframesRule); | 306 m_context.useCounter()->count(UseCounter::QuotedKeyframesRule); |
307 name = nameToken.value(); | 307 name = nameToken.value(); |
308 } else { | 308 } else { |
309 return nullptr; // Parse error; expected ident token in @keyframes heade
r | 309 return nullptr; // Parse error; expected ident token in @keyframes heade
r |
310 } | 310 } |
311 | 311 |
312 const Vector<RefPtrWillBeMember<StyleRuleBase>>& keyframeRules = consumeRule
List(block, KeyframesRuleList); | 312 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& keyframeRules = c
onsumeRuleList(block, KeyframesRuleList); |
313 | 313 |
314 RefPtrWillBeRawPtr<StyleRuleKeyframes> rule = StyleRuleKeyframes::create(); | 314 RefPtrWillBeRawPtr<StyleRuleKeyframes> rule = StyleRuleKeyframes::create(); |
315 for (const auto& keyframe : keyframeRules) | 315 for (const auto& keyframe : keyframeRules) |
316 rule->parserAppendKeyframe(toStyleRuleKeyframe(keyframe.get())); | 316 rule->parserAppendKeyframe(toStyleRuleKeyframe(keyframe.get())); |
317 rule->setName(name); | 317 rule->setName(name); |
318 rule->setVendorPrefixed(webkitPrefixed); | 318 rule->setVendorPrefixed(webkitPrefixed); |
319 return rule.release(); | 319 return rule.release(); |
320 } | 320 } |
321 | 321 |
322 PassRefPtrWillBeRawPtr<StyleRuleKeyframe> CSSParserImpl::consumeKeyframeStyleRul
e(CSSParserTokenRange prelude, CSSParserTokenRange block) | 322 PassRefPtrWillBeRawPtr<StyleRuleKeyframe> CSSParserImpl::consumeKeyframeStyleRul
e(CSSParserTokenRange prelude, CSSParserTokenRange block) |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 else | 421 else |
422 return nullptr; // Parser error, invalid value in keyframe selector | 422 return nullptr; // Parser error, invalid value in keyframe selector |
423 if (range.atEnd()) | 423 if (range.atEnd()) |
424 return result.release(); | 424 return result.release(); |
425 if (range.consume().type() != CommaToken) | 425 if (range.consume().type() != CommaToken) |
426 return nullptr; // Parser error | 426 return nullptr; // Parser error |
427 } | 427 } |
428 } | 428 } |
429 | 429 |
430 } // namespace blink | 430 } // namespace blink |
OLD | NEW |