Changeset 151488 in webkit


Ignore:
Timestamp:
Jun 12, 2013 12:20:20 AM (11 years ago)
Author:
sergio@webkit.org
Message:

Add CSS parsing recovery to functions
https://bugs.webkit.org/show_bug.cgi?id=117500

Reviewed by Andreas Kling.

From Blink r150205 by <serya@chromium.org>

Source/WebCore:

Add parsing recovery capabilities to functions. Errors were
correctly detected without this change but then the whole
declaration was invalidated. By using expr_recovery to handle them
we can recover from those errors and go on with the parsing.

  • css/CSSGrammar.y.in:

LayoutTests:

  • fast/css/parsing-error-recovery.html: added some test cases for

parsing recovery inside functions.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r151486 r151488  
     12013-06-12  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        Add CSS parsing recovery to functions
     4        https://bugs.webkit.org/show_bug.cgi?id=117500
     5
     6        Reviewed by Andreas Kling.
     7
     8        From Blink r150205 by <serya@chromium.org>
     9
     10        * fast/css/parsing-error-recovery.html: added some test cases for
     11        parsing recovery inside functions.
     12
    1132013-06-11  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    214
  • trunk/LayoutTests/fast/css/parsing-error-recovery.html

    r150803 r151488  
    6161        }
    6262
     63        #test8 {
     64            color: rgb(1,});
     65            display: none;
     66        }
     67
     68        #test9 {
     69            color: rgb(});
     70            display: none;
     71        }
     72
     73        #test10 {
     74            width: calc(1,});
     75            display: none;
     76        }
     77
     78        #test11 {
     79            width: calc(});
     80            display: none;
     81        }
     82
     83        #test12 {
     84            width: -webkit-min(1,});
     85            display: none;
     86        }
     87
     88        #test13 {
     89            width: -webkit-min(});
     90            display: none;
     91        }
     92
    6393        /* Successfully parsed */
    6494        #last {
     
    75105  <div class="to_be_hidden" id="test6">FAIL: Test 6</div>
    76106  <div class="to_be_hidden" id="test7">FAIL: Test 7</div>
     107  <div class="to_be_hidden" id="test8">FAIL: Test 8</div>
     108  <div class="to_be_hidden" id="test9">FAIL: Test 9</div>
     109  <div class="to_be_hidden" id="test10">FAIL: Test 10</div>
     110  <div class="to_be_hidden" id="test11">FAIL: Test 11</div>
     111  <div class="to_be_hidden" id="test12">FAIL: Test 12</div>
     112  <div class="to_be_hidden" id="test13">FAIL: Test 13</div>
    77113  <div class="to_be_shown" id="last">PASS</div>
    78114</body>
  • trunk/Source/WebCore/ChangeLog

    r151487 r151488  
     12013-06-12  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        Add CSS parsing recovery to functions
     4        https://bugs.webkit.org/show_bug.cgi?id=117500
     5
     6        Reviewed by Andreas Kling.
     7
     8        From Blink r150205 by <serya@chromium.org>
     9
     10        Add parsing recovery capabilities to functions. Errors were
     11        correctly detected without this change but then the whole
     12        declaration was invalidated. By using expr_recovery to handle them
     13        we can recover from those errors and go on with the parsing.
     14
     15        * css/CSSGrammar.y.in:
     16
    1172013-06-11  Christophe Dumez  <ch.dumez@sisa.samsung.com>
    218
  • trunk/Source/WebCore/css/CSSGrammar.y.in

    r151424 r151488  
    8989
    9090#if ENABLE_SHADOW_DOM
    91 %expect 33
     91%expect 32
    9292#else
    93 %expect 32
     93%expect 31
    9494#endif
    9595
     
    17011701  }
    17021702  /* FIXME: according to the specs a function can have a unary_operator in front. I know no case where this makes sense */
    1703   | function {
     1703  | function maybe_space {
    17041704      $$ = $1;
    17051705  }
    1706   | calc_function {
     1706  | calc_function maybe_space {
    17071707      $$ = $1;
    17081708  }
    1709   | min_or_max_function {
     1709  | min_or_max_function maybe_space {
    17101710      $$ = $1;
    17111711  }
     
    17541754
    17551755function:
    1756     FUNCTION maybe_space expr closing_parenthesis maybe_space {
     1756    FUNCTION maybe_space expr closing_parenthesis {
    17571757        CSSParserFunction* f = parser->createFloatingFunction();
    17581758        f->name = $1;
     
    17621762        $$.function = f;
    17631763    } |
    1764     FUNCTION maybe_space closing_parenthesis maybe_space {
     1764    FUNCTION maybe_space closing_parenthesis {
    17651765        CSSParserFunction* f = parser->createFloatingFunction();
    17661766        f->name = $1;
     
    17711771        $$.function = f;
    17721772    } |
    1773     FUNCTION maybe_space error {
     1773    FUNCTION maybe_space expr_recovery closing_parenthesis {
    17741774        CSSParserFunction* f = parser->createFloatingFunction();
    17751775        f->name = $1;
     
    18841884
    18851885calc_function:
    1886     CALCFUNCTION maybe_space calc_func_expr calc_maybe_space closing_parenthesis maybe_space {
     1886    CALCFUNCTION maybe_space calc_func_expr calc_maybe_space closing_parenthesis {
    18871887        CSSParserFunction* f = parser->createFloatingFunction();
    18881888        f->name = $1;
     
    18921892        $$.function = f;
    18931893    }
    1894     | CALCFUNCTION maybe_space error {
     1894    | CALCFUNCTION maybe_space expr_recovery closing_parenthesis {
    18951895        YYERROR;
    18961896    }
     
    19081908
    19091909min_or_max_function:
    1910     min_or_max maybe_space calc_func_expr_list closing_parenthesis maybe_space {
     1910    min_or_max maybe_space calc_func_expr_list closing_parenthesis {
    19111911        CSSParserFunction* f = parser->createFloatingFunction();
    19121912        f->name = $1;
     
    19161916        $$.function = f;
    19171917    }
    1918     | min_or_max maybe_space error {
     1918    | min_or_max maybe_space expr_recovery closing_parenthesis {
    19191919        YYERROR;
    19201920    }
Note: See TracChangeset for help on using the changeset viewer.