| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 const Vector<double>& keys() const; | 54 const Vector<double>& keys() const; |
| 55 // Used by BisonCSSParser when constructing a new StyleKeyframe. | 55 // Used by BisonCSSParser when constructing a new StyleKeyframe. |
| 56 void setKeys(PassOwnPtr<Vector<double> >); | 56 void setKeys(PassOwnPtr<Vector<double> >); |
| 57 | 57 |
| 58 const StylePropertySet& properties() const { return *m_properties; } | 58 const StylePropertySet& properties() const { return *m_properties; } |
| 59 MutableStylePropertySet& mutableProperties(); | 59 MutableStylePropertySet& mutableProperties(); |
| 60 void setProperties(PassRefPtr<StylePropertySet>); | 60 void setProperties(PassRefPtr<StylePropertySet>); |
| 61 | 61 |
| 62 String cssText() const; | 62 String cssText() const; |
| 63 | 63 |
| 64 void trace(Visitor*); | |
| 65 | |
| 66 static PassOwnPtr<Vector<double> > createKeyList(CSSParserValueList*); | 64 static PassOwnPtr<Vector<double> > createKeyList(CSSParserValueList*); |
| 67 | 65 |
| 68 private: | 66 private: |
| 69 StyleKeyframe(); | 67 StyleKeyframe(); |
| 70 | 68 |
| 71 RefPtr<StylePropertySet> m_properties; | 69 RefPtr<StylePropertySet> m_properties; |
| 72 // These are both calculated lazily. Either one can be set, which invalidate
s the other. | 70 // These are both calculated lazily. Either one can be set, which invalidate
s the other. |
| 73 mutable String m_keyText; | 71 mutable String m_keyText; |
| 74 mutable OwnPtr<Vector<double> > m_keys; | 72 mutable OwnPtr<Vector<double> > m_keys; |
| 75 }; | 73 }; |
| 76 | 74 |
| 77 class CSSKeyframeRule final : public CSSRule { | 75 class CSSKeyframeRule final : public CSSRule { |
| 78 public: | 76 public: |
| 79 virtual ~CSSKeyframeRule(); | 77 virtual ~CSSKeyframeRule(); |
| 80 | 78 |
| 81 virtual CSSRule::Type type() const override { return KEYFRAME_RULE; } | 79 virtual CSSRule::Type type() const override { return KEYFRAME_RULE; } |
| 82 virtual String cssText() const override { return m_keyframe->cssText(); } | 80 virtual String cssText() const override { return m_keyframe->cssText(); } |
| 83 virtual void reattach(StyleRuleBase*) override; | 81 virtual void reattach(StyleRuleBase*) override; |
| 84 | 82 |
| 85 String keyText() const { return m_keyframe->keyText(); } | 83 String keyText() const { return m_keyframe->keyText(); } |
| 86 void setKeyText(const String& s) { m_keyframe->setKeyText(s); } | 84 void setKeyText(const String& s) { m_keyframe->setKeyText(s); } |
| 87 | 85 |
| 88 CSSStyleDeclaration* style() const; | 86 CSSStyleDeclaration* style() const; |
| 89 | 87 |
| 90 virtual void trace(Visitor*) override; | |
| 91 | |
| 92 private: | 88 private: |
| 93 CSSKeyframeRule(StyleKeyframe*, CSSKeyframesRule* parent); | 89 CSSKeyframeRule(StyleKeyframe*, CSSKeyframesRule* parent); |
| 94 | 90 |
| 95 RefPtr<StyleKeyframe> m_keyframe; | 91 RefPtr<StyleKeyframe> m_keyframe; |
| 96 mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; | 92 mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; |
| 97 | 93 |
| 98 friend class CSSKeyframesRule; | 94 friend class CSSKeyframesRule; |
| 99 }; | 95 }; |
| 100 | 96 |
| 101 DEFINE_CSS_RULE_TYPE_CASTS(CSSKeyframeRule, KEYFRAME_RULE); | 97 DEFINE_CSS_RULE_TYPE_CASTS(CSSKeyframeRule, KEYFRAME_RULE); |
| 102 | 98 |
| 103 } // namespace blink | 99 } // namespace blink |
| 104 | 100 |
| 105 #endif // CSSKeyframeRule_h | 101 #endif // CSSKeyframeRule_h |
| OLD | NEW |