Changeset 35403 in webkit
- Timestamp:
- Jul 27, 2008 2:08:29 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r35401 r35403 1 2008-07-27 Anatoli Papirovski <apapirovski@mac.com> 2 3 Reviewed by Dave Hyatt. 4 5 Updated layout CSS2.1 test suite tests related to css parsing: 6 https://bugs.webkit.org/show_bug.cgi?id=14346 7 8 * platform/mac/css2.1/t040105-import-01-b-expected.checksum: 9 * platform/mac/css2.1/t040105-import-01-b-expected.png: 10 * platform/mac/css2.1/t040105-import-01-b-expected.txt: 11 * platform/mac/css2.1/t0402-syntax-05-f-expected.checksum: 12 * platform/mac/css2.1/t0402-syntax-05-f-expected.png: 13 * platform/mac/css2.1/t0402-syntax-05-f-expected.txt: 14 * platform/mac/css2.1/t0402-syntax-06-f-expected.checksum: 15 * platform/mac/css2.1/t0402-syntax-06-f-expected.png: 16 * platform/mac/css2.1/t0402-syntax-06-f-expected.txt: 17 1 18 2008-07-26 Mark Rowe <mrowe@apple.com> 2 19 -
trunk/LayoutTests/platform/mac/css2.1/t040105-import-01-b-expected.checksum
r35266 r35403 1 48c586c471d31538fa826a547aa46c60 1 7c6c531b985d3cf4a81611af231d0459 -
trunk/LayoutTests/platform/mac/css2.1/t040105-import-01-b-expected.txt
r35266 r35403 4 4 RenderBlock {HTML} at (0,0) size 800x50 5 5 RenderBody {BODY} at (8,16) size 784x18 6 RenderBlock {P} at (0,0) size 784x18 6 RenderBlock {P} at (0,0) size 784x18 [color=#008000] 7 7 RenderText {#text} at (0,0) size 136x18 8 8 text run at (0,0) width 136: "This should be green." -
trunk/LayoutTests/platform/mac/css2.1/t0402-syntax-05-f-expected.checksum
r35266 r35403 1 3445deb21395438f6e171e928bb89c2f 1 17855c59caf75f290cd968f9b98ed820 -
trunk/LayoutTests/platform/mac/css2.1/t0402-syntax-05-f-expected.txt
r35266 r35403 4 4 RenderBlock {HTML} at (0,0) size 800x50 5 5 RenderBody {BODY} at (8,16) size 784x18 6 RenderBlock {P} at (0,0) size 784x18 [color=# 800000]6 RenderBlock {P} at (0,0) size 784x18 [color=#008000] 7 7 RenderText {#text} at (0,0) size 159x18 8 8 text run at (0,0) width 159: "This text should be green" -
trunk/LayoutTests/platform/mac/css2.1/t0402-syntax-06-f-expected.checksum
r35266 r35403 1 3445deb21395438f6e171e928bb89c2f 1 17855c59caf75f290cd968f9b98ed820 -
trunk/LayoutTests/platform/mac/css2.1/t0402-syntax-06-f-expected.txt
r35266 r35403 4 4 RenderBlock {HTML} at (0,0) size 800x50 5 5 RenderBody {BODY} at (8,16) size 784x18 6 RenderBlock {P} at (0,0) size 784x18 [color=# 800000]6 RenderBlock {P} at (0,0) size 784x18 [color=#008000] 7 7 RenderText {#text} at (0,0) size 159x18 8 8 text run at (0,0) width 159: "This text should be green" -
trunk/WebCore/ChangeLog
r35402 r35403 1 2008-07-27 Anatoli Papirovski <apapirovski@mac.com> 2 3 Reviewed by Dave Hyatt. 4 5 Fix for https://bugs.webkit.org/show_bug.cgi?id=14346 6 Modified the css parser: 7 - not to fail when closing braces are not found for 8 a declaration at the end of the file 9 - not to accept "!important fail" as valid 10 - to keep accepting @import when it comes after invalid @ rules 11 - not to drop the whole @media block when there's an error before the 12 closing brace 13 + some other minor css parsing revisions. 14 15 CSSGrammar.y tweaked by David Kilzer to fix Tiger builds. 16 17 * css/CSSGrammar.y: 18 1 19 2008-07-27 Jan Michael Alonzo <jmalonzo@webkit.org> 2 20 -
trunk/WebCore/css/CSSGrammar.y
r35351 r35403 86 86 %} 87 87 88 %expect 4 688 %expect 49 89 89 90 90 %left UNIMPORTANT_TOK 91 91 92 92 %token WHITESPACE SGML_CD 93 %token TOKEN_EOF 0 93 94 94 95 %token INCLUDES … … 172 173 %type <rule> font_face 173 174 %type <rule> invalid_rule 175 %type <rule> save_block 174 176 %type <rule> invalid_at 177 %type <rule> invalid_at_list 175 178 %type <rule> invalid_import 179 %type <rule> invalid_media 176 180 %type <rule> rule 177 181 %type <rule> valid_rule 182 %type <ruleList> block_rule_list 183 %type <rule> block_rule 184 %type <rule> block_valid_rule 178 185 %type <rule> variables_rule 179 186 %type <mediaList> variables_media_list … … 198 205 %type <mediaQueryExpList> maybe_and_media_query_exp_list 199 206 200 %type <ruleList> ruleset_list201 202 207 %type <integer> property 203 208 … … 313 318 | charset { 314 319 } 315 ; 320 ; 321 322 closing_brace: 323 '}' 324 | %prec maybe_sgml TOKEN_EOF 325 ; 316 326 317 327 charset: … … 335 345 p->m_styleSheet->append($2); 336 346 } 347 | invalid_at_list { 348 } 337 349 ; 338 350 … … 374 386 ; 375 387 388 block_rule_list: 389 /* empty */ { $$ = 0; } 390 | block_rule_list block_rule maybe_sgml { 391 $$ = $1; 392 if ($2) { 393 if (!$$) 394 $$ = static_cast<CSSParser*>(parser)->createRuleList(); 395 $$->append($2); 396 } 397 } 398 ; 399 400 block_valid_rule: 401 ruleset 402 | page 403 | font_face 404 ; 405 406 block_rule: 407 block_valid_rule 408 | invalid_rule 409 | invalid_at 410 | invalid_import 411 | invalid_media 412 ; 413 414 376 415 import: 377 416 IMPORT_SYM maybe_space string_or_uri maybe_space maybe_media_list ';' { 378 417 $$ = static_cast<CSSParser*>(parser)->createImportRule($3, $5); 379 418 } 419 | IMPORT_SYM maybe_space string_or_uri maybe_space maybe_media_list invalid_block { 420 $$ = 0; 421 } 422 | IMPORT_SYM error ';' { 423 $$ = 0; 424 } 380 425 | IMPORT_SYM error invalid_block { 381 $$ = 0;382 }383 | IMPORT_SYM error ';' {384 426 $$ = 0; 385 427 } … … 597 639 598 640 media: 599 MEDIA_SYM maybe_space media_list '{' maybe_space ruleset_list '}'{641 MEDIA_SYM maybe_space media_list '{' maybe_space block_rule_list save_block { 600 642 $$ = static_cast<CSSParser*>(parser)->createMediaRule($3, $6); 601 643 } 602 | MEDIA_SYM maybe_space '{' maybe_space ruleset_list '}'{644 | MEDIA_SYM maybe_space '{' maybe_space block_rule_list save_block { 603 645 $$ = static_cast<CSSParser*>(parser)->createMediaRule(0, $5); 604 }605 ;606 607 ruleset_list:608 /* empty */ { $$ = 0; }609 | ruleset_list ruleset maybe_space {610 $$ = $1;611 if ($2) {612 if (!$$)613 $$ = static_cast<CSSParser*>(parser)->createRuleList();614 $$->append($2);615 }616 646 } 617 647 ; … … 668 698 669 699 ruleset: 670 selector_list '{' maybe_space declaration_list '}'{700 selector_list '{' maybe_space declaration_list closing_brace { 671 701 $$ = static_cast<CSSParser*>(parser)->createStyleRule($1); 672 702 } … … 1081 1111 $$ = $1; 1082 1112 } 1113 | decl_list invalid_block_list { 1114 $$ = $1; 1115 } 1083 1116 ; 1084 1117 … … 1135 1168 } 1136 1169 | 1170 property ':' maybe_space expr prio error { 1171 /* When we encounter something like p {color: red !important fail;} we should drop the declaration */ 1172 $$ = false; 1173 } 1174 | 1137 1175 IMPORTANT_SYM maybe_space { 1138 1176 /* Handle this case: div { text-align: center; !important } Just reduce away the stray !important. */ … … 1147 1185 property ':' maybe_space error { 1148 1186 /* if we come across rules with invalid values like this case: p { weight: *; }, just discard the rule */ 1187 $$ = false; 1188 } 1189 | 1190 property invalid_block { 1191 /* if we come across: div { color{;color:maroon} }, ignore everything within curly brackets */ 1149 1192 $$ = false; 1150 1193 } … … 1294 1337 /* error handling rules */ 1295 1338 1339 save_block: 1340 closing_brace { 1341 $$ = 0; 1342 } 1343 | error closing_brace { 1344 $$ = 0; 1345 } 1346 ; 1347 1296 1348 invalid_at: 1297 1349 ATKEYWORD error invalid_block { … … 1303 1355 ; 1304 1356 1357 invalid_at_list: 1358 invalid_at maybe_sgml 1359 | invalid_at_list invalid_at maybe_sgml 1360 ; 1361 1305 1362 invalid_import: 1306 1363 import { … … 1309 1366 ; 1310 1367 1368 invalid_media: 1369 media { 1370 $$ = 0; 1371 } 1372 ; 1373 1311 1374 invalid_rule: 1312 1375 error invalid_block { 1313 1376 $$ = 0; 1314 1377 } 1378 1315 1379 /* 1316 1380 Seems like the two rules below are trying too much and violating … … 1327 1391 1328 1392 invalid_block: 1329 '{' error invalid_block_list error '}'1330 | '{' error '}'1393 '{' error invalid_block_list error closing_brace 1394 | '{' error closing_brace 1331 1395 ; 1332 1396
Note: See TracChangeset
for help on using the changeset viewer.