Changeset 150803 in webkit
- Timestamp:
- May 28, 2013 7:31:11 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r150797 r150803 1 2013-05-28 Sergio Villar Senin <svillar@igalia.com> 2 3 Invalid block doesn't make declaration invalid 4 https://bugs.webkit.org/show_bug.cgi?id=115709 5 6 Reviewed by Andreas Kling. 7 8 From Blink r149446 by <serya@chromium.org> 9 10 * fast/css/parsing-error-recovery.html: Added 2 new test cases. 11 1 12 2013-05-28 Ádám Kallai <kadam@inf.u-szeged.hu> 2 13 -
trunk/LayoutTests/fast/css/parsing-error-recovery.html
r147028 r150803 49 49 } 50 50 51 #test6 { 52 display: none !important; 53 display: block !important {invalid_block}; 54 } 55 56 #test7 { 57 display: none !important; 58 } 59 #test7 { 60 display: block !important {invalid_block} 61 } 62 51 63 /* Successfully parsed */ 52 64 #last { … … 61 73 <div class="to_be_hidden" id="test4">FAIL: Test 4</div> 62 74 <div class="to_be_hidden" id="test5">FAIL: Test 5</div> 75 <div class="to_be_hidden" id="test6">FAIL: Test 6</div> 76 <div class="to_be_hidden" id="test7">FAIL: Test 7</div> 63 77 <div class="to_be_shown" id="last">PASS</div> 64 78 </body> -
trunk/Source/WebCore/ChangeLog
r150801 r150803 1 2013-05-28 Sergio Villar Senin <svillar@igalia.com> 2 3 Invalid block doesn't make declaration invalid 4 https://bugs.webkit.org/show_bug.cgi?id=115709 5 6 Reviewed by Andreas Kling. 7 8 From Blink r149446 by <serya@chromium.org> 9 10 Added a new rule "declaration_recovery:" which covers any kind of 11 "invalid_block_list maybe_space" sequence. By appending this new 12 rule to every rule reductable to "declaration:" we can remove some 13 redundant rules and improve error recovery of some others that 14 were only accepting exactly one error. 15 16 One of the rules being removed was preventing invalid blocks in a 17 declaration to invalidate the whole declaration. The rule was 18 reporting the syntax error but at the same time accepting the 19 invalid block as part of a valid declaration. 20 21 * css/CSSGrammar.y.in: 22 1 23 2013-05-28 Andreas Kling <akling@apple.com> 2 24 -
trunk/Source/WebCore/css/CSSGrammar.y.in
r150791 r150803 89 89 90 90 #if ENABLE_SHADOW_DOM 91 %expect 6 891 %expect 65 92 92 #else 93 %expect 6 793 %expect 64 94 94 #endif 95 95 … … 337 337 %type <string> attr_name 338 338 339 %type <location> errors340 339 %type <location> error_location 341 340 … … 1546 1545 $$ = $1; 1547 1546 } 1548 | declaration error_location invalid_block_list maybe_space {1549 parser->syntaxError($2);1550 $$ = false;1551 }1552 | declaration error_location invalid_block_list ';' maybe_space {1553 parser->syntaxError($2);1554 $$ = false;1555 }1556 1547 | decl_list_recovery ';' maybe_space { 1557 1548 parser->markPropertyStart(); … … 1605 1596 } 1606 1597 | 1607 property errors { 1608 parser->syntaxError($2); 1598 property declaration_recovery { 1609 1599 $$ = false; 1610 1600 } 1611 1601 | 1612 property ':' maybe_space errors expr prio { 1613 /* The default movable type template has letter-spacing: .none; Handle this by looking for 1614 error tokens at the start of an expr, recover the expr and then treat as an error, cleaning 1615 up and deleting the shifted expr. */ 1616 parser->syntaxError($4); 1617 parser->markPropertyEnd(false, false); 1618 $$ = false; 1619 } 1620 | 1621 property ':' maybe_space expr prio error { 1602 property ':' maybe_space expr prio declaration_recovery { 1622 1603 /* When we encounter something like p {color: red !important fail;} we should drop the declaration */ 1623 1604 parser->markPropertyEnd(false, false); … … 1625 1606 } 1626 1607 | 1627 IMPORTANT_SYM maybe_space error_location{1608 IMPORTANT_SYM maybe_space declaration_recovery { 1628 1609 /* Handle this case: div { text-align: center; !important } Just reduce away the stray !important. */ 1629 parser->syntaxError($3);1630 1610 $$ = false; 1631 1611 } 1632 1612 | 1633 property ':' maybe_space error_location { 1634 /* div { font-family: } Just reduce away this property with no value. */ 1635 parser->syntaxError($4); 1613 property ':' maybe_space declaration_recovery { 1614 /* if we come across rules with invalid values like this case: p { weight: *; }, just discard the rule */ 1636 1615 parser->markPropertyEnd(false, false); 1637 1616 $$ = false; 1638 1617 } 1639 | 1640 property ':' maybe_space errors { 1641 /* if we come across rules with invalid values like this case: p { weight: *; }, just discard the rule */ 1642 parser->syntaxError($4); 1643 parser->markPropertyEnd(false, false); 1644 $$ = false; 1645 } 1646 | 1647 property error_location invalid_block { 1648 /* if we come across: div { color{;color:maroon} }, ignore everything within curly brackets */ 1618 ; 1619 1620 declaration_recovery: 1621 error error_location { 1649 1622 parser->syntaxError($2); 1650 $$ = false; 1651 } 1623 } 1624 | declaration_recovery invalid_block 1625 | declaration_recovery error 1652 1626 ; 1653 1627 … … 2002 1976 ; 2003 1977 2004 errors:2005 error error_location {2006 $$ = $2;2007 }2008 ;2009 2010 1978 error_location: { 2011 1979 $$ = parser->currentLocation();
Note: See TracChangeset
for help on using the changeset viewer.