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

Unified Diff: Source/core/css/CSSParser.cpp

Issue 13943004: Avoid reparsing keyframe selectors (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « Source/core/css/CSSKeyframeRule.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSParser.cpp
diff --git a/Source/core/css/CSSParser.cpp b/Source/core/css/CSSParser.cpp
index 63f4985f1b3bc2c8b5277d6e41a0f856b0f58336..5c055599f4e1d7e40ad91d6f7cb9e4d287e1b60a 100644
--- a/Source/core/css/CSSParser.cpp
+++ b/Source/core/css/CSSParser.cpp
@@ -11433,9 +11433,9 @@ void CSSParser::deleteFontFaceOnlyValues()
StyleKeyframe* CSSParser::createKeyframe(CSSParserValueList* keys)
{
- // Create a key string from the passed keys
- StringBuilder keyString;
- for (unsigned i = 0; i < keys->size(); ++i) {
+ Vector<float> keyframeKeys;
+ size_t keyCount = keys->size();
+ for (size_t i = 0; i < keyCount; ++i) {
ASSERT(keys->valueAt(i)->unit == CSSPrimitiveValue::CSS_NUMBER);
float key = static_cast<float>(keys->valueAt(i)->fValue);
if (key < 0 || key > 100) {
@@ -11445,14 +11445,12 @@ StyleKeyframe* CSSParser::createKeyframe(CSSParserValueList* keys)
clearProperties();
return 0;
}
- if (i != 0)
- keyString.append(',');
- keyString.append(String::number(key));
- keyString.append('%');
+
+ keyframeKeys.append(key / 100);
}
RefPtr<StyleKeyframe> keyframe = StyleKeyframe::create();
- keyframe->setKeyText(keyString.toString());
+ keyframe->setKeys(keyframeKeys);
keyframe->setProperties(createStylePropertySet());
clearProperties();
« no previous file with comments | « Source/core/css/CSSKeyframeRule.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698