Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Unified Diff: Source/core/css/CSSKeyframeRule.h

Issue 19037003: Re-use CSSParser logic to parse keyframe keys (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/css/CSSKeyframeRule.h
diff --git a/Source/core/css/CSSKeyframeRule.h b/Source/core/css/CSSKeyframeRule.h
index c6639b0c73803c03939e5c1877f58fc49caf08ad..1d3332349e7f2365ba96a9155ea84bdbafcc7bd7 100644
--- a/Source/core/css/CSSKeyframeRule.h
+++ b/Source/core/css/CSSKeyframeRule.h
@@ -45,13 +45,14 @@ public:
}
~StyleKeyframe();
- String keyText() const { return m_key; }
- // FIXME: Should we trim whitespace?
- // FIXME: Should we leave keyText unchanged when attempting to set to an
- // invalid string?
- void setKeyText(const String& s) { m_key = s; }
+ // Exposed to JavaScript.
+ String keyText() const;
+ void setKeyText(const String&);
- void getKeys(Vector<float>& keys) const { parseKeyString(m_key, keys); }
+ // Used by StyleResolver.
+ const Vector<float>& keys() const;
+ // Used by CSSParser when constructing a new StyleKeyframe.
+ void setKeys(PassOwnPtr<Vector<float> >);
const StylePropertySet* properties() const { return m_properties.get(); }
MutableStylePropertySet* mutableProperties();
@@ -64,12 +65,10 @@ public:
private:
StyleKeyframe();
- static void parseKeyString(const String&, Vector<float>& keys);
-
RefPtr<StylePropertySet> m_properties;
- // FIXME: This should be a parsed vector of floats.
- // comma separated list of keys
- String m_key;
+ // These are both calculated lazily. Either one can be set, which invalidates the other.
+ mutable String m_keyText;
+ mutable OwnPtr<Vector<float> > m_keys;
};
class CSSKeyframeRule : public CSSRule {

Powered by Google App Engine
This is Rietveld 408576698