| 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> |
| 34 | 35 |
| 35 namespace blink { | 36 namespace blink { |
| 36 | 37 |
| 37 StyleRuleKeyframes::StyleRuleKeyframes() | 38 StyleRuleKeyframes::StyleRuleKeyframes() |
| 38 : StyleRuleBase(Keyframes) | 39 : StyleRuleBase(Keyframes) |
| 39 , m_version(0) | 40 , m_version(0) |
| 40 { | 41 { |
| 41 } | 42 } |
| 42 | 43 |
| 43 StyleRuleKeyframes::StyleRuleKeyframes(const StyleRuleKeyframes& o) | 44 StyleRuleKeyframes::StyleRuleKeyframes(const StyleRuleKeyframes& o) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 67 } | 68 } |
| 68 | 69 |
| 69 void StyleRuleKeyframes::wrapperRemoveKeyframe(unsigned index) | 70 void StyleRuleKeyframes::wrapperRemoveKeyframe(unsigned index) |
| 70 { | 71 { |
| 71 m_keyframes.remove(index); | 72 m_keyframes.remove(index); |
| 72 styleChanged(); | 73 styleChanged(); |
| 73 } | 74 } |
| 74 | 75 |
| 75 int StyleRuleKeyframes::findKeyframeIndex(const String& key) const | 76 int StyleRuleKeyframes::findKeyframeIndex(const String& key) const |
| 76 { | 77 { |
| 77 OwnPtr<Vector<double>> keys = CSSParser::parseKeyframeKeyList(key); | 78 std::unique_ptr<Vector<double>> keys = CSSParser::parseKeyframeKeyList(key); |
| 78 if (!keys) | 79 if (!keys) |
| 79 return -1; | 80 return -1; |
| 80 for (size_t i = m_keyframes.size(); i--; ) { | 81 for (size_t i = m_keyframes.size(); i--; ) { |
| 81 if (m_keyframes[i]->keys() == *keys) | 82 if (m_keyframes[i]->keys() == *keys) |
| 82 return i; | 83 return i; |
| 83 } | 84 } |
| 84 return -1; | 85 return -1; |
| 85 } | 86 } |
| 86 | 87 |
| 87 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleKeyframes) | 88 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleKeyframes) |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 210 |
| 210 DEFINE_TRACE(CSSKeyframesRule) | 211 DEFINE_TRACE(CSSKeyframesRule) |
| 211 { | 212 { |
| 212 CSSRule::trace(visitor); | 213 CSSRule::trace(visitor); |
| 213 visitor->trace(m_childRuleCSSOMWrappers); | 214 visitor->trace(m_childRuleCSSOMWrappers); |
| 214 visitor->trace(m_keyframesRule); | 215 visitor->trace(m_keyframesRule); |
| 215 visitor->trace(m_ruleListCSSOMWrapper); | 216 visitor->trace(m_ruleListCSSOMWrapper); |
| 216 } | 217 } |
| 217 | 218 |
| 218 } // namespace blink | 219 } // namespace blink |
| OLD | NEW |