Chromium Code Reviews| 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 | 30 |
| 31 namespace WebCore { | 31 namespace WebCore { |
| 32 | 32 |
| 33 class CSSKeyframesRule; | 33 class CSSKeyframesRule; |
| 34 class CSSParserValueList; | 34 class CSSParserValueList; |
| 35 class CSSStyleDeclaration; | 35 class CSSStyleDeclaration; |
| 36 class MutableStylePropertySet; | 36 class MutableStylePropertySet; |
| 37 class StylePropertySet; | 37 class StylePropertySet; |
| 38 class StyleRuleCSSStyleDeclaration; | 38 class StyleRuleCSSStyleDeclaration; |
| 39 | 39 |
| 40 class StyleKeyframe FINAL : public RefCounted<StyleKeyframe> { | 40 class StyleKeyframe FINAL : public RefCountedWillBeGarbageCollectedFinalized<Sty leKeyframe> { |
| 41 WTF_MAKE_FAST_ALLOCATED; | 41 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 42 public: | 42 public: |
| 43 static PassRefPtr<StyleKeyframe> create() | 43 static PassRefPtrWillBeRawPtr<StyleKeyframe> create() |
| 44 { | 44 { |
| 45 return adoptRef(new StyleKeyframe()); | 45 return adoptRefWillBeNoop(new StyleKeyframe()); |
| 46 } | 46 } |
| 47 ~StyleKeyframe(); | 47 ~StyleKeyframe(); |
| 48 | 48 |
| 49 // Exposed to JavaScript. | 49 // Exposed to JavaScript. |
| 50 String keyText() const; | 50 String keyText() const; |
| 51 void setKeyText(const String&); | 51 void setKeyText(const String&); |
| 52 | 52 |
| 53 // Used by StyleResolver. | 53 // Used by StyleResolver. |
| 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 | |
| 64 static PassOwnPtr<Vector<double> > createKeyList(CSSParserValueList*); | 66 static PassOwnPtr<Vector<double> > createKeyList(CSSParserValueList*); |
| 65 | 67 |
| 66 private: | 68 private: |
| 67 StyleKeyframe(); | 69 StyleKeyframe(); |
| 68 | 70 |
| 69 RefPtr<StylePropertySet> m_properties; | 71 RefPtr<StylePropertySet> m_properties; |
|
haraken
2014/03/26 13:17:12
You can make this a Member. StylePropertySet is al
wibling-chromium
2014/03/26 13:31:33
I would rather wait until I have the Mutable and I
| |
| 70 // These are both calculated lazily. Either one can be set, which invalidate s the other. | 72 // These are both calculated lazily. Either one can be set, which invalidate s the other. |
| 71 mutable String m_keyText; | 73 mutable String m_keyText; |
| 72 mutable OwnPtr<Vector<double> > m_keys; | 74 mutable OwnPtr<Vector<double> > m_keys; |
| 73 }; | 75 }; |
| 74 | 76 |
| 75 class CSSKeyframeRule FINAL : public CSSRule { | 77 class CSSKeyframeRule FINAL : public CSSRule { |
| 76 public: | 78 public: |
| 77 virtual ~CSSKeyframeRule(); | 79 virtual ~CSSKeyframeRule(); |
| 78 | 80 |
| 79 virtual CSSRule::Type type() const OVERRIDE { return KEYFRAME_RULE; } | 81 virtual CSSRule::Type type() const OVERRIDE { return KEYFRAME_RULE; } |
| 80 virtual String cssText() const OVERRIDE { return m_keyframe->cssText(); } | 82 virtual String cssText() const OVERRIDE { return m_keyframe->cssText(); } |
| 81 virtual void reattach(StyleRuleBase*) OVERRIDE; | 83 virtual void reattach(StyleRuleBase*) OVERRIDE; |
| 82 | 84 |
| 83 String keyText() const { return m_keyframe->keyText(); } | 85 String keyText() const { return m_keyframe->keyText(); } |
| 84 void setKeyText(const String& s) { m_keyframe->setKeyText(s); } | 86 void setKeyText(const String& s) { m_keyframe->setKeyText(s); } |
| 85 | 87 |
| 86 CSSStyleDeclaration* style() const; | 88 CSSStyleDeclaration* style() const; |
| 87 | 89 |
| 88 virtual void trace(Visitor* visitor) OVERRIDE { CSSRule::trace(visitor); } | 90 virtual void trace(Visitor*) OVERRIDE; |
| 89 | 91 |
| 90 private: | 92 private: |
| 91 CSSKeyframeRule(StyleKeyframe*, CSSKeyframesRule* parent); | 93 CSSKeyframeRule(StyleKeyframe*, CSSKeyframesRule* parent); |
| 92 | 94 |
| 93 RefPtr<StyleKeyframe> m_keyframe; | 95 RefPtrWillBeMember<StyleKeyframe> m_keyframe; |
| 94 mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; | 96 mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; |
| 95 | 97 |
| 96 friend class CSSKeyframesRule; | 98 friend class CSSKeyframesRule; |
| 97 }; | 99 }; |
| 98 | 100 |
| 99 DEFINE_CSS_RULE_TYPE_CASTS(CSSKeyframeRule, KEYFRAME_RULE); | 101 DEFINE_CSS_RULE_TYPE_CASTS(CSSKeyframeRule, KEYFRAME_RULE); |
| 100 | 102 |
| 101 } // namespace WebCore | 103 } // namespace WebCore |
| 102 | 104 |
| 103 #endif // CSSKeyframeRule_h | 105 #endif // CSSKeyframeRule_h |
| OLD | NEW |