Changeset 56414 in webkit


Ignore:
Timestamp:
Mar 23, 2010 1:52:50 PM (14 years ago)
Author:
hyatt@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=36272, make sure nth-child can work when the portion with "n" is omitted.

Reviewed by Simon Fraser and Darin Adler.

Added fast/css/nth-child-implied-step.html

  • css/CSSGrammar.y:
  • css/tokenizer.flex:
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r56412 r56414  
     12010-03-23  David Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by Simon Fraser and Darin Adler.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=36272, make sure nth-child can work when the portion with "n" is omitted.
     6
     7        Added fast/css/nth-child-implied-step.html
     8
     9        * css/CSSGrammar.y:
     10        * css/tokenizer.flex:
     11
    1122010-03-23  Darin Adler  <darin@apple.com>
    213
  • trunk/WebCore/css/CSSGrammar.y

    r56383 r56414  
    247247%type <integer> match
    248248%type <integer> unary_operator
     249%type <integer> maybe_unary_operator
    249250%type <character> operator
    250251
     
    767768  | '>' maybe_space { $$ = CSSSelector::Child; }
    768769  ;
     770
     771maybe_unary_operator:
     772    unary_operator { $$ = $1; }
     773    | { $$ = 1; }
     774    ;
    769775
    770776unary_operator:
     
    11301136    }
    11311137    // used by :nth-*
    1132     | ':' FUNCTION maybe_space INTEGER maybe_space ')' {
     1138    | ':' FUNCTION maybe_space maybe_unary_operator INTEGER maybe_space ')' {
    11331139        CSSParser *p = static_cast<CSSParser*>(parser);
    11341140        $$ = p->createFloatingSelector();
    11351141        $$->m_match = CSSSelector::PseudoClass;
    1136         $$->setArgument(String::number($4));
     1142        $$->setArgument(String::number($4 * $5));
    11371143        $$->m_value = $2;
    11381144        CSSSelector::PseudoType type = $$->pseudoType();
  • trunk/WebCore/css/tokenizer.flex

    r56405 r56414  
    2525nl              \n|\r\n|\r|\f
    2626range           \?{1,6}|{h}(\?{0,5}|{h}(\?{0,4}|{h}(\?{0,3}|{h}(\?{0,2}|{h}(\??|{h})))))
    27 nth             ([\+-]?[0-9]*n[\+-][0-9]+)|(-?[0-9]*n)
     27nth             [\+-]?{intnum}*n([\+-]{intnum})?
    2828
    2929%%
Note: See TracChangeset for help on using the changeset viewer.