Bug Tracker

Changeset 1593

Show
Ignore:
Timestamp:
03/25/07 19:02:31 (2 years ago)
Author:
john
Message:

Fixed some more bugs with the test suite, made some minor file size tweaks to the selector code.

Location:
trunk/jquery
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/jquery/build/test/index.html

    r1586 r1593  
    8484            <span id="utf8class1" class="台北Táiběi 台北"></span> 
    8585            <span id="utf8class2" class="台北"></span> 
     86            <span id="foo:bar" class="foo:bar"></span> 
     87            <span id="test.foo[5]bar" class="test.foo[5]bar"></span> 
    8688        </form> 
    8789        <b id="floatTest">Float test.</b> 
  • trunk/jquery/src/selector/selector.js

    r1579 r1593  
    6868    parse: [ 
    6969        // Match: [@value='test'], [@foo] 
    70         /^\[ *(@)([\w-]+) *([!*$^=]*) *('?"?)(.*?)\4 *\]/i, 
     70        /^\[ *(@)([\w-]+) *([!*$^=]*) *('?"?)(.*?)\4 *\]/, 
    7171 
    7272        // Match: [div], [div p] 
     
    7474 
    7575        // Match: :contains('foo') 
    76         /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/i, 
     76        /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/, 
    7777 
    7878        // Match: :even, :last-chlid, #id, .class 
    79         /^([:.#]*)((?:[\w\u0128-\uFFFF*-]|\\.)+)/i 
     79        /^([:.#]*)((?:[\w\u0128-\uFFFF*-]|\\.)+)/ 
    8080    ], 
    8181 
     
    149149            // An attempt at speeding up child selectors that 
    150150            // point to a specific element tag 
    151             var re = /^[\/>]\s*([\w*-]+)/i; 
     151            var re = /^[\/>]\s*([\w*-]+)/; 
    152152            var m = re.exec(t); 
    153153 
     
    169169                    // Attempt to match each, individual, token in 
    170170                    // the specified order 
    171                     var re = jQuery.token[i]; 
     171                    var re = jQuery.token[i], fn = jQuery.token[i+1]; 
    172172                    var m = re.exec(t); 
    173173 
     
    175175                    if ( m ) { 
    176176                        // Map it against the token's handler 
    177                         r = ret = jQuery.map( ret, jQuery.isFunction( jQuery.token[i+1] ) ? 
    178                             jQuery.token[i+1] : 
    179                             function(a){ return eval(jQuery.token[i+1]); }); 
     177                        r = ret = jQuery.map( ret, jQuery.isFunction( fn ) ? 
     178                            fn : new Function( "a", "return " + fn ) ); 
    180179 
    181180                        // And remove the token 
     
    206205                } else { 
    207206                    // Optomize for the case nodeName#idName 
    208                     var re2 = /^(\w+)(#)((?:[\w\u0128-\uFFFF*-]|\\.)+)/i; 
     207                    var re2 = /^(\w+)(#)((?:[\w\u0128-\uFFFF*-]|\\.)+)/; 
    209208                    var m = re2.exec(t); 
    210209                     
     
    216215                        // Otherwise, do a traditional filter check for 
    217216                        // ID, class, and element selectors 
    218                         re2 = /^([#.]?)((?:[\w\u0128-\uFFFF*-]|\\.)*)/i; 
     217                        re2 = /^([#.]?)((?:[\w\u0128-\uFFFF*-]|\\.)*)/; 
    219218                        m = re2.exec(t); 
    220219                    } 
  • trunk/jquery/src/selector/selectorTest.js

    r1592 r1593  
    153153    t( "Only Child", "a:only-child", ["simon1","anchor1","yahoo","anchor2"] ); 
    154154    t( "Empty", "ul:empty", ["firstUL"] ); 
    155     t( "Enabled UI Element", "input:enabled", ["text1","radio1","radio2","check1","check2","hidden1","hidden2","name"] ); 
     155    t( "Enabled UI Element", "input:enabled", ["text1","radio1","radio2","check1","check2","hidden1","hidden2","name","length"] ); 
    156156    t( "Disabled UI Element", "input:disabled", ["text2"] ); 
    157157    t( "Checked UI Element", "input:checked", ["radio2","check1"] ); 
     
    171171    t( "Position Less Than", "p:lt(3)", ["firstp","ap","sndp"] ); 
    172172    t( "Is A Parent", "p:parent", ["firstp","ap","sndp","en","sap","first"] ); 
    173     t( "Is Visible", "input:visible", ["text1","text2","radio1","radio2","check1","check2","name"] ); 
     173    t( "Is Visible", "input:visible", ["text1","text2","radio1","radio2","check1","check2","name","length"] ); 
    174174    t( "Is Hidden", "input:hidden", ["hidden1","hidden2"] ); 
    175175     
    176     t( "Form element :input", ":input", ["text1", "text2", "radio1", "radio2", "check1", "check2", "hidden1", "hidden2", "name", "button", "area1", "select1", "select2", "select3"] ); 
     176    t( "Form element :input", ":input", ["text1", "text2", "radio1", "radio2", "check1", "check2", "hidden1", "hidden2", "name", "button", "area1", "select1", "select2", "select3", "length"] ); 
    177177    t( "Form element :radio", ":radio", ["radio1", "radio2"] ); 
    178178    t( "Form element :checkbox", ":checkbox", ["check1", "check2"] ); 
    179     t( "Form element :text", ":text", ["text1", "text2", "hidden2", "name"] ); 
     179    t( "Form element :text", ":text", ["text1", "text2", "hidden2", "name", "length"] ); 
    180180    t( "Form element :radio:checked", ":radio:checked", ["radio2"] ); 
    181181    t( "Form element :checkbox:checked", ":checkbox:checked", ["check1"] ); 
     
    196196    t( "Attribute Equals", "//a[@rel='bookmark']", ["simon1"] ); 
    197197    t( "Parent Axis", "//p/..", ["main","foo"] ); 
    198     t( "Sibling Axis", "//p/../", ["firstp","ap","foo","first","firstUL","empty","form","floatTest","iframe","sndp","en","sap"] ); 
    199     t( "Sibling Axis", "//p/../*", ["firstp","ap","foo","first","firstUL","empty","form","floatTest","iframe","sndp","en","sap"] ); 
     198    t( "Sibling Axis", "//p/../", ["firstp","ap","foo","first","firstUL","empty","form","floatTest","iframe","lengthtest","sndp","en","sap"] ); 
     199    t( "Sibling Axis", "//p/../*", ["firstp","ap","foo","first","firstUL","empty","form","floatTest","iframe","lengthtest","sndp","en","sap"] ); 
    200200    t( "Has Children", "//p[a]", ["firstp","ap","en","sap"] ); 
    201201