| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "sky/engine/core/animation/css/CSSAnimationData.h" | |
| 6 | |
| 7 #include "sky/engine/core/animation/Timing.h" | |
| 8 | |
| 9 namespace blink { | |
| 10 | |
| 11 CSSAnimationData::CSSAnimationData() | |
| 12 { | |
| 13 m_nameList.append(initialName()); | |
| 14 m_iterationCountList.append(initialIterationCount()); | |
| 15 m_directionList.append(initialDirection()); | |
| 16 m_fillModeList.append(initialFillMode()); | |
| 17 m_playStateList.append(initialPlayState()); | |
| 18 } | |
| 19 | |
| 20 CSSAnimationData::CSSAnimationData(const CSSAnimationData& other) | |
| 21 : CSSTimingData(other) | |
| 22 , m_nameList(other.m_nameList) | |
| 23 , m_iterationCountList(other.m_iterationCountList) | |
| 24 , m_directionList(other.m_directionList) | |
| 25 , m_fillModeList(other.m_fillModeList) | |
| 26 , m_playStateList(other.m_playStateList) | |
| 27 { | |
| 28 } | |
| 29 | |
| 30 const AtomicString& CSSAnimationData::initialName() | |
| 31 { | |
| 32 DEFINE_STATIC_LOCAL(const AtomicString, name, ("none", AtomicString::Constru
ctFromLiteral)); | |
| 33 return name; | |
| 34 } | |
| 35 | |
| 36 bool CSSAnimationData::animationsMatchForStyleRecalc(const CSSAnimationData& oth
er) const | |
| 37 { | |
| 38 return m_nameList == other.m_nameList && m_playStateList == other.m_playStat
eList; | |
| 39 } | |
| 40 | |
| 41 Timing CSSAnimationData::convertToTiming(size_t index) const | |
| 42 { | |
| 43 ASSERT(index < m_nameList.size()); | |
| 44 Timing timing = CSSTimingData::convertToTiming(index); | |
| 45 | |
| 46 timing.iterationCount = getRepeated(m_iterationCountList, index); | |
| 47 timing.direction = getRepeated(m_directionList, index); | |
| 48 timing.fillMode = getRepeated(m_fillModeList, index); | |
| 49 timing.assertValid(); | |
| 50 return timing; | |
| 51 } | |
| 52 | |
| 53 } // namespace blink | |
| OLD | NEW |