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

Unified Diff: Source/core/css/CSSGrammar.y.in

Issue 13943004: Avoid reparsing keyframe selectors (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 8 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/CSSGrammar.y.in
diff --git a/Source/core/css/CSSGrammar.y.in b/Source/core/css/CSSGrammar.y.in
index 9543cbead6f9f1da23567ec934cb740a2cb4b194..5ee92d3e7abbd07a9a22b3c42d2eeb373315e78e 100644
--- a/Source/core/css/CSSGrammar.y.in
+++ b/Source/core/css/CSSGrammar.y.in
@@ -847,7 +847,14 @@ key_list:
;
key:
- maybe_unary_operator PERCENTAGE { $$.id = 0; $$.isInt = false; $$.fValue = $1 * $2; $$.unit = CSSPrimitiveValue::CSS_NUMBER; }
+ maybe_unary_operator PERCENTAGE {
+ $$.id = 0; $$.isInt = false;
+ if ($1 > 0 && $2 <= 100) {
+ $$.fValue = $1 * $2; $$.unit = CSSPrimitiveValue::CSS_NUMBER;
+ } else {
+ $$.fValue = 0; $$.unit = CSSPrimitiveValue::CSS_UNKNOWN;
+ }
+ }
| IDENT {
$$.id = 0; $$.isInt = false; $$.unit = CSSPrimitiveValue::CSS_NUMBER;
CSSParserString& str = $1;

Powered by Google App Engine
This is Rietveld 408576698