| 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 19 matching lines...) Expand all Loading... |
| 30 #include "core/css/CSSRuleList.h" | 30 #include "core/css/CSSRuleList.h" |
| 31 #include "core/css/CSSStyleSheet.h" | 31 #include "core/css/CSSStyleSheet.h" |
| 32 #include "core/css/parser/CSSParser.h" | 32 #include "core/css/parser/CSSParser.h" |
| 33 #include "core/frame/UseCounter.h" | 33 #include "core/frame/UseCounter.h" |
| 34 #include "wtf/text/StringBuilder.h" | 34 #include "wtf/text/StringBuilder.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 StyleRuleKeyframes::StyleRuleKeyframes() | 38 StyleRuleKeyframes::StyleRuleKeyframes() |
| 39 : StyleRuleBase(Keyframes) | 39 : StyleRuleBase(Keyframes) |
| 40 , m_version(0) |
| 40 { | 41 { |
| 41 } | 42 } |
| 42 | 43 |
| 43 StyleRuleKeyframes::StyleRuleKeyframes(const StyleRuleKeyframes& o) | 44 StyleRuleKeyframes::StyleRuleKeyframes(const StyleRuleKeyframes& o) |
| 44 : StyleRuleBase(o) | 45 : StyleRuleBase(o) |
| 45 , m_keyframes(o.m_keyframes) | 46 , m_keyframes(o.m_keyframes) |
| 46 , m_name(o.m_name) | 47 , m_name(o.m_name) |
| 48 , m_version(o.m_version) |
| 47 , m_isPrefixed(o.m_isPrefixed) | 49 , m_isPrefixed(o.m_isPrefixed) |
| 48 { | 50 { |
| 49 } | 51 } |
| 50 | 52 |
| 51 StyleRuleKeyframes::~StyleRuleKeyframes() | 53 StyleRuleKeyframes::~StyleRuleKeyframes() |
| 52 { | 54 { |
| 53 } | 55 } |
| 54 | 56 |
| 55 void StyleRuleKeyframes::parserAppendKeyframe(PassRefPtrWillBeRawPtr<StyleRuleKe
yframe> keyframe) | 57 void StyleRuleKeyframes::parserAppendKeyframe(PassRefPtrWillBeRawPtr<StyleRuleKe
yframe> keyframe) |
| 56 { | 58 { |
| 57 if (!keyframe) | 59 if (!keyframe) |
| 58 return; | 60 return; |
| 59 m_keyframes.append(keyframe); | 61 m_keyframes.append(keyframe); |
| 60 } | 62 } |
| 61 | 63 |
| 62 void StyleRuleKeyframes::wrapperAppendKeyframe(PassRefPtrWillBeRawPtr<StyleRuleK
eyframe> keyframe) | 64 void StyleRuleKeyframes::wrapperAppendKeyframe(PassRefPtrWillBeRawPtr<StyleRuleK
eyframe> keyframe) |
| 63 { | 65 { |
| 64 m_keyframes.append(keyframe); | 66 m_keyframes.append(keyframe); |
| 67 styleChanged(); |
| 65 } | 68 } |
| 66 | 69 |
| 67 void StyleRuleKeyframes::wrapperRemoveKeyframe(unsigned index) | 70 void StyleRuleKeyframes::wrapperRemoveKeyframe(unsigned index) |
| 68 { | 71 { |
| 69 m_keyframes.remove(index); | 72 m_keyframes.remove(index); |
| 73 styleChanged(); |
| 70 } | 74 } |
| 71 | 75 |
| 72 int StyleRuleKeyframes::findKeyframeIndex(const String& key) const | 76 int StyleRuleKeyframes::findKeyframeIndex(const String& key) const |
| 73 { | 77 { |
| 74 OwnPtr<Vector<double>> keys = CSSParser::parseKeyframeKeyList(key); | 78 OwnPtr<Vector<double>> keys = CSSParser::parseKeyframeKeyList(key); |
| 75 if (!keys) | 79 if (!keys) |
| 76 return -1; | 80 return -1; |
| 77 for (size_t i = m_keyframes.size(); i--; ) { | 81 for (size_t i = m_keyframes.size(); i--; ) { |
| 78 if (m_keyframes[i]->keys() == *keys) | 82 if (m_keyframes[i]->keys() == *keys) |
| 79 return i; | 83 return i; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 { | 212 { |
| 209 CSSRule::trace(visitor); | 213 CSSRule::trace(visitor); |
| 210 #if ENABLE(OILPAN) | 214 #if ENABLE(OILPAN) |
| 211 visitor->trace(m_childRuleCSSOMWrappers); | 215 visitor->trace(m_childRuleCSSOMWrappers); |
| 212 #endif | 216 #endif |
| 213 visitor->trace(m_keyframesRule); | 217 visitor->trace(m_keyframesRule); |
| 214 visitor->trace(m_ruleListCSSOMWrapper); | 218 visitor->trace(m_ruleListCSSOMWrapper); |
| 215 } | 219 } |
| 216 | 220 |
| 217 } // namespace blink | 221 } // namespace blink |
| OLD | NEW |