| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "core/css/CSSKeyframesRule.h" | 26 #include "core/css/CSSKeyframesRule.h" |
| 27 | 27 |
| 28 #include "core/css/CSSKeyframeRule.h" | 28 #include "core/css/CSSKeyframeRule.h" |
| 29 #include "core/css/CSSRuleList.h" | 29 #include "core/css/CSSRuleList.h" |
| 30 #include "core/css/CSSStyleSheet.h" | 30 #include "core/css/CSSStyleSheet.h" |
| 31 #include "core/css/parser/CSSParser.h" | 31 #include "core/css/parser/CSSParser.h" |
| 32 #include "core/frame/UseCounter.h" | 32 #include "core/frame/UseCounter.h" |
| 33 #include "wtf/text/StringBuilder.h" | 33 #include "wtf/text/StringBuilder.h" |
| 34 #include <memory> | |
| 35 | 34 |
| 36 namespace blink { | 35 namespace blink { |
| 37 | 36 |
| 38 StyleRuleKeyframes::StyleRuleKeyframes() | 37 StyleRuleKeyframes::StyleRuleKeyframes() |
| 39 : StyleRuleBase(Keyframes) | 38 : StyleRuleBase(Keyframes) |
| 40 , m_version(0) | 39 , m_version(0) |
| 41 { | 40 { |
| 42 } | 41 } |
| 43 | 42 |
| 44 StyleRuleKeyframes::StyleRuleKeyframes(const StyleRuleKeyframes& o) | 43 StyleRuleKeyframes::StyleRuleKeyframes(const StyleRuleKeyframes& o) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 68 } | 67 } |
| 69 | 68 |
| 70 void StyleRuleKeyframes::wrapperRemoveKeyframe(unsigned index) | 69 void StyleRuleKeyframes::wrapperRemoveKeyframe(unsigned index) |
| 71 { | 70 { |
| 72 m_keyframes.remove(index); | 71 m_keyframes.remove(index); |
| 73 styleChanged(); | 72 styleChanged(); |
| 74 } | 73 } |
| 75 | 74 |
| 76 int StyleRuleKeyframes::findKeyframeIndex(const String& key) const | 75 int StyleRuleKeyframes::findKeyframeIndex(const String& key) const |
| 77 { | 76 { |
| 78 std::unique_ptr<Vector<double>> keys = CSSParser::parseKeyframeKeyList(key); | 77 OwnPtr<Vector<double>> keys = CSSParser::parseKeyframeKeyList(key); |
| 79 if (!keys) | 78 if (!keys) |
| 80 return -1; | 79 return -1; |
| 81 for (size_t i = m_keyframes.size(); i--; ) { | 80 for (size_t i = m_keyframes.size(); i--; ) { |
| 82 if (m_keyframes[i]->keys() == *keys) | 81 if (m_keyframes[i]->keys() == *keys) |
| 83 return i; | 82 return i; |
| 84 } | 83 } |
| 85 return -1; | 84 return -1; |
| 86 } | 85 } |
| 87 | 86 |
| 88 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleKeyframes) | 87 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleKeyframes) |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 209 |
| 211 DEFINE_TRACE(CSSKeyframesRule) | 210 DEFINE_TRACE(CSSKeyframesRule) |
| 212 { | 211 { |
| 213 CSSRule::trace(visitor); | 212 CSSRule::trace(visitor); |
| 214 visitor->trace(m_childRuleCSSOMWrappers); | 213 visitor->trace(m_childRuleCSSOMWrappers); |
| 215 visitor->trace(m_keyframesRule); | 214 visitor->trace(m_keyframesRule); |
| 216 visitor->trace(m_ruleListCSSOMWrapper); | 215 visitor->trace(m_ruleListCSSOMWrapper); |
| 217 } | 216 } |
| 218 | 217 |
| 219 } // namespace blink | 218 } // namespace blink |
| OLD | NEW |