summaryrefslogtreecommitdiff
path: root/Source/WebCore/css/CSSGrammar.y.in
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2016-09-28 16:39:37 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-02-02 12:31:01 +0000
commit9daf1655d7e4eaaa6ed5f44055a4b4fd399fd25c (patch)
tree322337ad0acbc75732f916376ec6d36e7ec0e5bc /Source/WebCore/css/CSSGrammar.y.in
parent6882a04fb36642862b11efe514251d32070c3d65 (diff)
downloadqtwebkit-9daf1655d7e4eaaa6ed5f44055a4b4fd399fd25c.tar.gz
Imported WebKit commit eb954cdcf58f9b915b2fcb6f8e4cb3a60650a4f3
Change-Id: I8dda875c38075d43b76fe3a21acb0ffa102bb82d Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebCore/css/CSSGrammar.y.in')
-rw-r--r--Source/WebCore/css/CSSGrammar.y.in26
1 files changed, 15 insertions, 11 deletions
diff --git a/Source/WebCore/css/CSSGrammar.y.in b/Source/WebCore/css/CSSGrammar.y.in
index 8cc70be80..0aad45663 100644
--- a/Source/WebCore/css/CSSGrammar.y.in
+++ b/Source/WebCore/css/CSSGrammar.y.in
@@ -294,12 +294,12 @@ static bool selectorListDoesNotMatchAnyPseudoElement(const Vector<std::unique_pt
%type <keyframeRuleList> keyframes_rule
%destructor { delete $$; } keyframes_rule
-// These parser values never need to be destroyed because they are never functions or value lists.
-%type <value> calc_func_term key unary_term
+// These parser values never need to be destroyed because they are never functions, value lists, or variables.
+%type <value> key unary_term
-// These parser values need to be destroyed because they might be functions.
-%type <value> calc_function function variable_function min_or_max_function term
-%destructor { destroy($$); } calc_function function variable_function min_or_max_function term
+// These parser values need to be destroyed because they might be functions, value lists, or variables.
+%type <value> calc_func_term calc_function function min_or_max_function term variable_function
+%destructor { destroy($$); } calc_func_term calc_function function min_or_max_function term variable_function
%type <id> property
@@ -823,14 +823,18 @@ key_list:
}
| key_list maybe_space ',' maybe_space key {
$$ = $1;
- ASSERT($5.unit != CSSParserValue::Function); // No need to call destroy.
if ($$)
$$->addValue($5);
}
;
key:
- maybe_unary_operator PERCENTAGE { $$.id = CSSValueInvalid; $$.isInt = false; $$.fValue = $1 * $2; $$.unit = CSSPrimitiveValue::CSS_NUMBER; }
+ maybe_unary_operator PERCENTAGE {
+ $$.id = CSSValueInvalid;
+ $$.isInt = false;
+ $$.fValue = $1 * $2;
+ $$.unit = CSSPrimitiveValue::CSS_NUMBER;
+ }
| IDENT {
$$.id = CSSValueInvalid;
$$.isInt = false;
@@ -1838,10 +1842,10 @@ invalid_var_fallback:
'!' | ';';
calc_func_term:
- unary_term
- | variable_function { $$ = $1; }
- | unary_operator unary_term { $$ = $2; $$.fValue *= $1; }
- ;
+ unary_term
+ | unary_operator unary_term { $$ = $2; $$.fValue *= $1; }
+ | variable_function
+ ;
/*
* The grammar requires spaces around binary ‘+’ and ‘-’ operators.