Home | History | Annotate | Download | only in css
      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 #ifndef CSSAnimationData_h
      6 #define CSSAnimationData_h
      7 
      8 #include "core/animation/Timing.h"
      9 #include "core/animation/css/CSSTimingData.h"
     10 #include "core/rendering/style/RenderStyleConstants.h"
     11 
     12 namespace blink {
     13 
     14 class CSSAnimationData FINAL : public CSSTimingData {
     15 public:
     16     static PassOwnPtrWillBeRawPtr<CSSAnimationData> create()
     17     {
     18         return adoptPtrWillBeNoop(new CSSAnimationData);
     19     }
     20 
     21     static PassOwnPtrWillBeRawPtr<CSSAnimationData> create(const CSSAnimationData& animationData)
     22     {
     23         return adoptPtrWillBeNoop(new CSSAnimationData(animationData));
     24     }
     25 
     26     bool animationsMatchForStyleRecalc(const CSSAnimationData& other) const;
     27 
     28     Timing convertToTiming(size_t index) const;
     29 
     30     const Vector<AtomicString>& nameList() const { return m_nameList; }
     31     const Vector<double>& iterationCountList() const { return m_iterationCountList; }
     32     const Vector<Timing::PlaybackDirection>& directionList() const { return m_directionList; }
     33     const Vector<Timing::FillMode>& fillModeList() const { return m_fillModeList; }
     34     const Vector<EAnimPlayState>& playStateList() const { return m_playStateList; }
     35 
     36     Vector<AtomicString>& nameList() { return m_nameList; }
     37     Vector<double>& iterationCountList() { return m_iterationCountList; }
     38     Vector<Timing::PlaybackDirection>& directionList() { return m_directionList; }
     39     Vector<Timing::FillMode>& fillModeList() { return m_fillModeList; }
     40     Vector<EAnimPlayState>& playStateList() { return m_playStateList; }
     41 
     42     static const AtomicString& initialName();
     43     static Timing::PlaybackDirection initialDirection() { return Timing::PlaybackDirectionNormal; }
     44     static Timing::FillMode initialFillMode() { return Timing::FillModeNone; }
     45     static double initialIterationCount() { return 1.0; }
     46     static EAnimPlayState initialPlayState() { return AnimPlayStatePlaying; }
     47 
     48 private:
     49     CSSAnimationData();
     50     explicit CSSAnimationData(const CSSAnimationData&);
     51 
     52     Vector<AtomicString> m_nameList;
     53     Vector<double> m_iterationCountList;
     54     Vector<Timing::PlaybackDirection> m_directionList;
     55     Vector<Timing::FillMode> m_fillModeList;
     56     Vector<EAnimPlayState> m_playStateList;
     57 };
     58 
     59 } // namespace blink
     60 
     61 #endif // CSSAnimationData_h
     62