summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/css/CSSGrammar.y.in
diff options
context:
space:
mode:
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.