Changeset 36050 in webkit
- Timestamp:
- Sep 2, 2008 11:51:31 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r36047 r36050 1 2008-09-02 Glenn Wilson <wilsong@gmail.com> 2 3 Reviewed by Darin Adler. 4 5 Test for <https://bugs.webkit.org/show_bug.cgi?id=15360> 6 Bug 15360: color:#{predefined colorName} is treated as colorName in Safari 7 8 Added new test to verify that CSS "color" attributes with '#'-preceeded predefined color names 9 are not rendered in those colors. 10 11 * css1/color_and_background/invalid_color.html: Added. 12 * css1/color_and_background/invalid_color-expected.txt: Added. 13 1 14 2008-09-02 Mihnea Ovidenie <mihnea@adobe.com> 2 15 -
trunk/WebCore/ChangeLog
r36047 r36050 1 2008-09-02 Glenn Wilson <wilsong@gmail.com> 2 3 Reviewed by Darin Adler. 4 5 Fix for <https://bugs.webkit.org/show_bug.cgi?id=15360> 6 Bug 15360: color:#{predefined colorName} is treated as colorName in Safari 7 8 We would inappropriately interpret and apply an invalid CSS "color" property 9 when the value is a predefined color preceded by a '#' symbol. For example, 10 style="color:#gray;" would apply the color gray when it should not. 11 12 In the bison template, "hexcolor" was defined as both "HEX maybe_space" OR "IDENT maybe_space". 13 This caused identifiers not fitting the appropriate hex format but preceded by a '#' to be 14 interpreted as a valid color (CSSPrimitiveValue::CSS_PARSER_HEXCOLOR), when it was really just 15 an ignorable token. 16 17 To correct this, "IDENT maybe_space" was removed from "hexcolor" and added under "term" as 18 '#' IDENT maybe_space, which is then processed as a CSSPrimitiveValue::CSS_STRING instead of 19 CSSPrimitiveValue::CSS_PARSER_HEXCOLOR. 20 21 Test: css1/color_and_background/invalid_color.html 22 23 * css/CSSGrammar.y: 24 1 25 2008-09-02 Mihnea Ovidenie <mihnea@adobe.com> 2 26 -
trunk/WebCore/css/CSSGrammar.y
r35580 r36050 1329 1329 | UNICODERANGE maybe_space { $$.id = 0; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_UNICODE_RANGE } 1330 1330 | hexcolor { $$.id = 0; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_PARSER_HEXCOLOR; } 1331 | '#' IDENT maybe_space { $$.id = 0; $$.string = $2; $$.unit = CSSPrimitiveValue::CSS_STRING; } /* Handle error case: "color:#{predefined color name};" */ 1331 1332 | '#' maybe_space { $$.id = 0; $$.string = CSSParserString(); $$.unit = CSSPrimitiveValue::CSS_PARSER_HEXCOLOR; } /* Handle error case: "color: #;" */ 1332 1333 /* FIXME: according to the specs a function can have a unary_operator in front. I know no case where this makes sense */ … … 1407 1408 hexcolor: 1408 1409 HEX maybe_space { $$ = $1; } 1409 | IDSEL maybe_space { $$ = $1; } 1410 ; 1411 1410 ; 1412 1411 1413 1412 /* error handling rules */
Note: See TracChangeset
for help on using the changeset viewer.