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

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, 3 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
« no previous file with comments | « Source/core/css/CSSGrammar.y.in ('k') | Source/core/css/CSSKeyframeRule.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSKeyframeRule.h
diff --git a/Source/core/css/CSSKeyframeRule.h b/Source/core/css/CSSKeyframeRule.h
index d6f5ad51b4742f03f7415a117a85e3a3b337754e..44e2d753bbd60aa02c3dc906168c2cc265b3a4a0 100644
--- a/Source/core/css/CSSKeyframeRule.h
+++ b/Source/core/css/CSSKeyframeRule.h
@@ -30,11 +30,12 @@
namespace WebCore {
+class CSSKeyframesRule;
+class CSSParserValueList;
class CSSStyleDeclaration;
class MutableStylePropertySet;
class StylePropertySet;
class StyleRuleCSSStyleDeclaration;
-class CSSKeyframesRule;
class StyleKeyframe FINAL : public RefCounted<StyleKeyframe> {
WTF_MAKE_FAST_ALLOCATED;
@@ -45,13 +46,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<double>& keys) const { parseKeyString(m_key, keys); }
+ // Used by StyleResolver.
+ const Vector<double>& keys() const;
+ // Used by CSSParser when constructing a new StyleKeyframe.
+ void setKeys(PassOwnPtr<Vector<double> >);
const StylePropertySet* properties() const { return m_properties.get(); }
MutableStylePropertySet* mutableProperties();
@@ -59,15 +61,15 @@ public:
String cssText() const;
+ static PassOwnPtr<Vector<double> > createKeyList(CSSParserValueList*);
+
private:
StyleKeyframe();
- static void parseKeyString(const String&, Vector<double>& 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<double> > m_keys;
};
class CSSKeyframeRule FINAL : public CSSRule {
« no previous file with comments | « Source/core/css/CSSGrammar.y.in ('k') | Source/core/css/CSSKeyframeRule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698