| Index: Source/core/css/CSSParser.cpp
|
| diff --git a/Source/core/css/CSSParser.cpp b/Source/core/css/CSSParser.cpp
|
| index 3f031be541750f04e9dc82f222827a377f7b8f8b..f65a89c952ff1a85ea828e2a17bbc90c44a8d0a9 100644
|
| --- a/Source/core/css/CSSParser.cpp
|
| +++ b/Source/core/css/CSSParser.cpp
|
| @@ -11240,7 +11240,23 @@ StyleKeyframe* CSSParser::createKeyframe(CSSParserValueList* keys)
|
| // Create a key string from the passed keys
|
| StringBuilder keyString;
|
| for (unsigned i = 0; i < keys->size(); ++i) {
|
| + // Just as per the comment below, we ignore keyframes with
|
| + // invalid key values (plain numbers or unknown identifiers)
|
| + // marked as CSSPrimitiveValue::CSS_UNKNOWN during parsing.
|
| + if (keys->valueAt(i)->unit == CSSPrimitiveValue::CSS_UNKNOWN) {
|
| + clearProperties();
|
| + return 0;
|
| + }
|
| +
|
| + ASSERT(keys->valueAt(i)->unit == CSSPrimitiveValue::CSS_NUMBER);
|
| float key = static_cast<float>(keys->valueAt(i)->fValue);
|
| + if (key < 0 || key > 100) {
|
| + // As per http://www.w3.org/TR/css3-animations/#keyframes,
|
| + // "If a keyframe selector specifies negative percentage values
|
| + // or values higher than 100%, then the keyframe will be ignored."
|
| + clearProperties();
|
| + return 0;
|
| + }
|
| if (i != 0)
|
| keyString.append(',');
|
| keyString.append(String::number(key));
|
|
|