Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 6209

Show
Ignore:
Timestamp:
02/22/07 21:13:35 (2 years ago)
Author:
andrew
Message:

Fixed regressions in :not and :nth-child.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spinoffs/prototype/branches/selector/src/selector.js

    r6208 r6209  
    137137          } 
    138138        } 
    139         return "[not(" + m[4] + ")]"; 
     139        return "[not(" + m[6] + ")]"; 
    140140      }, 
    141141      'nth-child': function(m) { 
    142         return Selector.xpath.pseudos.nth("count(./preceding-sibling::*) + 1 ", m); 
     142        return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m); 
    143143      }, 
    144144      'nth-last-child': function(m) { 
    145         return Selector.xpath.pseudos.nth("count(./following-sibling::*) + 1 ", m); 
     145        return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m); 
    146146      }, 
    147147      'nth-of-type': function(m) { 
     
    484484      var h = Selector.handlers,  
    485485       matches = new Selector(selector).findElements(root); 
    486       h.mark(matches);       
     486      h.mark(matches); 
    487487      for (var i = 0, results = [], node; node = nodes[i]; i++) 
    488488        if (!node._counted) results.push(node);