* Returns a function to use in pseudos for positionals * @param {Function} fn
( fn )
| 1388 | * @param {Function} fn |
| 1389 | */ |
| 1390 | function createPositionalPseudo( fn ) { |
| 1391 | return markFunction( function( argument ) { |
| 1392 | argument = +argument; |
| 1393 | return markFunction( function( seed, matches ) { |
| 1394 | var j, |
| 1395 | matchIndexes = fn( [], seed.length, argument ), |
| 1396 | i = matchIndexes.length; |
| 1397 | |
| 1398 | // Match elements found at the specified indexes |
| 1399 | while ( i-- ) { |
| 1400 | if ( seed[ ( j = matchIndexes[ i ] ) ] ) { |
| 1401 | seed[ j ] = !( matches[ j ] = seed[ j ] ); |
| 1402 | } |
| 1403 | } |
| 1404 | } ); |
| 1405 | } ); |
| 1406 | } |
| 1407 | |
| 1408 | /** |
| 1409 | * Sets document-related variables once based on the current document |