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

Side by Side Diff: Source/core/css/CSSGrammar.y

Issue 340503002: Initialize all CSSParserValue's variables (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Another CSSParserValue uninit var Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/css/CSSParserValues.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 %{ 1 %{
2 2
3 /* 3 /*
4 * Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org) 4 * Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 App le Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 App le Inc. All rights reserved.
6 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2012 Intel Corporation. All rights reserved. 8 * Copyright (C) 2012 Intel Corporation. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 default: 125 default:
126 return false; 126 return false;
127 } 127 }
128 } 128 }
129 #endif 129 #endif
130 130
131 inline static CSSParserValue makeOperatorValue(int value) 131 inline static CSSParserValue makeOperatorValue(int value)
132 { 132 {
133 CSSParserValue v; 133 CSSParserValue v;
134 v.id = CSSValueInvalid; 134 v.id = CSSValueInvalid;
135 v.isInt = false;
135 v.unit = CSSParserValue::Operator; 136 v.unit = CSSParserValue::Operator;
136 v.iValue = value; 137 v.iValue = value;
137 return v; 138 return v;
138 } 139 }
139 140
140 inline static CSSParserValue makeIdentValue(CSSParserString string) 141 inline static CSSParserValue makeIdentValue(CSSParserString string)
141 { 142 {
142 CSSParserValue v; 143 CSSParserValue v;
143 v.id = cssValueKeywordID(string); 144 v.id = cssValueKeywordID(string);
145 v.isInt = false;
144 v.unit = CSSPrimitiveValue::CSS_IDENT; 146 v.unit = CSSPrimitiveValue::CSS_IDENT;
145 v.string = string; 147 v.string = string;
146 return v; 148 return v;
147 } 149 }
148 150
149 %} 151 %}
150 152
151 %expect 0 153 %expect 0
152 154
153 %nonassoc LOWEST_PREC 155 %nonassoc LOWEST_PREC
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 $$ = '/'; 1587 $$ = '/';
1586 } 1588 }
1587 | ',' maybe_space { 1589 | ',' maybe_space {
1588 $$ = ','; 1590 $$ = ',';
1589 } 1591 }
1590 ; 1592 ;
1591 1593
1592 term: 1594 term:
1593 unary_term maybe_space 1595 unary_term maybe_space
1594 | unary_operator unary_term maybe_space { $$ = $2; $$.fValue *= $1; } 1596 | unary_operator unary_term maybe_space { $$ = $2; $$.fValue *= $1; }
1595 | STRING maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSP rimitiveValue::CSS_STRING; } 1597 | STRING maybe_space { $$.id = CSSValueInvalid; $$.isInt = false; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_STRING; }
1596 | IDENT maybe_space { $$ = makeIdentValue($1); } 1598 | IDENT maybe_space { $$ = makeIdentValue($1); }
1597 /* We might need to actually parse the number from a dimension, but we can't j ust put something that uses $$.string into unary_term. */ 1599 /* We might need to actually parse the number from a dimension, but we can't j ust put something that uses $$.string into unary_term. */
1598 | DIMEN maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPr imitiveValue::CSS_DIMENSION; } 1600 | DIMEN maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.isInt = fals e; $$.unit = CSSPrimitiveValue::CSS_DIMENSION; }
1599 | unary_operator DIMEN maybe_space { $$.id = CSSValueInvalid; $$.string = $2; $$.unit = CSSPrimitiveValue::CSS_DIMENSION; } 1601 | unary_operator DIMEN maybe_space { $$.id = CSSValueInvalid; $$.string = $2; $$.isInt = false; $$.unit = CSSPrimitiveValue::CSS_DIMENSION; }
1600 | URI maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPrim itiveValue::CSS_URI; } 1602 | URI maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.isInt = false; $$.unit = CSSPrimitiveValue::CSS_URI; }
1601 | UNICODERANGE maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_UNICODE_RANGE; } 1603 | UNICODERANGE maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.isInt = false; $$.unit = CSSPrimitiveValue::CSS_UNICODE_RANGE; }
1602 | HEX maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPrim itiveValue::CSS_PARSER_HEXCOLOR; } 1604 | HEX maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.isInt = false; $$.unit = CSSPrimitiveValue::CSS_PARSER_HEXCOLOR; }
1603 | '#' maybe_space { $$.id = CSSValueInvalid; $$.string = CSSParserString(); $$ .unit = CSSPrimitiveValue::CSS_PARSER_HEXCOLOR; } /* Handle error case: "color: #;" */ 1605 | '#' maybe_space { $$.id = CSSValueInvalid; $$.string = CSSParserString(); $$ .isInt = false; $$.unit = CSSPrimitiveValue::CSS_PARSER_HEXCOLOR; } /* Handle er ror case: "color: #;" */
1604 /* FIXME: according to the specs a function can have a unary_operator in front . I know no case where this makes sense */ 1606 /* FIXME: according to the specs a function can have a unary_operator in front . I know no case where this makes sense */
1605 | function maybe_space 1607 | function maybe_space
1606 | calc_function maybe_space 1608 | calc_function maybe_space
1607 | '%' maybe_space { /* Handle width: %; */ 1609 | '%' maybe_space { /* Handle width: %; */
1608 $$.id = CSSValueInvalid; $$.unit = 0; 1610 $$.id = CSSValueInvalid; $$.isInt = false; $$.unit = 0;
1609 } 1611 }
1610 | track_names_list maybe_space 1612 | track_names_list maybe_space
1611 ; 1613 ;
1612 1614
1613 unary_term: 1615 unary_term:
1614 INTEGER { $$.setFromNumber($1); $$.isInt = true; } 1616 INTEGER { $$.setFromNumber($1); $$.isInt = true; }
1615 | FLOATTOKEN { $$.setFromNumber($1); } 1617 | FLOATTOKEN { $$.setFromNumber($1); }
1616 | PERCENTAGE { $$.setFromNumber($1, CSSPrimitiveValue::CSS_PERCENTAGE); } 1618 | PERCENTAGE { $$.setFromNumber($1, CSSPrimitiveValue::CSS_PERCENTAGE); }
1617 | PXS { $$.setFromNumber($1, CSSPrimitiveValue::CSS_PX); } 1619 | PXS { $$.setFromNumber($1, CSSPrimitiveValue::CSS_PX); }
1618 | CMS { $$.setFromNumber($1, CSSPrimitiveValue::CSS_CM); } 1620 | CMS { $$.setFromNumber($1, CSSPrimitiveValue::CSS_CM); }
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1821 ; 1823 ;
1822 1824
1823 rule_error_recovery: 1825 rule_error_recovery:
1824 /* empty */ 1826 /* empty */
1825 | rule_error_recovery error 1827 | rule_error_recovery error
1826 | rule_error_recovery invalid_square_brackets_block 1828 | rule_error_recovery invalid_square_brackets_block
1827 | rule_error_recovery invalid_parentheses_block 1829 | rule_error_recovery invalid_parentheses_block
1828 ; 1830 ;
1829 1831
1830 %% 1832 %%
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/CSSParserValues.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698