Changeset 89826 in webkit


Ignore:
Timestamp:
Jun 27, 2011 9:55:38 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-27 Alexandru Chiculita <Alexandru Chiculita>

Reviewed by Ojan Vafai.

css combinator "+" in combination with NAV tag is buggy
https://bugs.webkit.org/show_bug.cgi?id=47971

  • fast/css/div_plus_nav_bug47971-expected.txt: Added.
  • fast/css/div_plus_nav_bug47971.html: Added.

2011-06-27 Alexandru Chiculita <Alexandru Chiculita>

Reviewed by Ojan Vafai.

css combinator "+" in combination with NAV tag is buggy
https://bugs.webkit.org/show_bug.cgi?id=47971

Added a new state in css/tokenizer.flex for the "nth" rule. The state begins
at nth-*( functions and ends at the first ")". It avoids parsing selectors
like "#div+nav" as: "#div" "+n" "av".

Test: fast/css/div_plus_nav_bug47971.html

  • css/maketokenizer:
  • css/tokenizer.flex:
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r89824 r89826  
     12011-06-27  Alexandru Chiculita  <achicu@adobe.com>
     2
     3        Reviewed by Ojan Vafai.
     4
     5        css combinator "+" in combination with NAV tag is buggy
     6        https://bugs.webkit.org/show_bug.cgi?id=47971
     7
     8        * fast/css/div_plus_nav_bug47971-expected.txt: Added.
     9        * fast/css/div_plus_nav_bug47971.html: Added.
     10
    1112011-06-27  Sheriff Bot  <webkit.review.bot@gmail.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r89824 r89826  
     12011-06-27  Alexandru Chiculita  <achicu@adobe.com>
     2
     3        Reviewed by Ojan Vafai.
     4
     5        css combinator "+" in combination with NAV tag is buggy
     6        https://bugs.webkit.org/show_bug.cgi?id=47971
     7
     8        Added a new state in css/tokenizer.flex for the "nth" rule. The state begins
     9        at nth-*( functions and ends at the first ")". It avoids parsing selectors
     10        like "#div+nav" as: "#div" "+n" "av".
     11
     12        Test: fast/css/div_plus_nav_bug47971.html
     13
     14        * css/maketokenizer:
     15        * css/tokenizer.flex:
     16
    1172011-06-27  Sheriff Bot  <webkit.review.bot@gmail.com>
    218
  • trunk/Source/WebCore/css/maketokenizer

    r50583 r89826  
    5050#define mediaquery 1
    5151#define forkeyword 2
     52#define nthchild 3
    5253
    5354/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
  • trunk/Source/WebCore/css/tokenizer.flex

    r83415 r89826  
    55%s mediaquery
    66%s forkeyword
     7%s nthchild
    78
    89h               [0-9a-fA-F]
     
    2425range           \?{1,6}|{h}(\?{0,5}|{h}(\?{0,4}|{h}(\?{0,3}|{h}(\?{0,2}|{h}(\??|{h})))))
    2526nth             [\+-]?{intnum}*n([\t\r\n ]*[\+-][\t\r\n ]*{intnum})?
     27nthfunc         "nth-"("child"|"of-type"|"last-child"|"last-of-type")
    2628
    2729%%
     
    4446{string}                {yyTok = STRING; return yyTok;}
    4547{ident}                 {yyTok = IDENT; return yyTok;}
    46 {nth}                   {yyTok = NTH; return yyTok;}
     48<nthchild>{nth}         {yyTok = NTH; return yyTok;}
     49<nthchild>")"           {BEGIN(INITIAL); yyTok = *yytext; return yyTok;}
    4750
    4851"#"{h}+                 {yyTok = HEX; return yyTok;}
     
    114117"-webkit-min("          {yyTok = MINFUNCTION; return yyTok;}
    115118"-webkit-max("          {yyTok = MAXFUNCTION; return yyTok;}
     119{nthfunc}"("            {BEGIN(nthchild); yyTok = FUNCTION; return yyTok;}
    116120{ident}"("              {yyTok = FUNCTION; return yyTok;}
    117121
Note: See TracChangeset for help on using the changeset viewer.