* Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied if the test fails * @param {Boolean} test The result of a test. If true, null will be set as the handler in leiu of the spec
( attrs, handler, test )
| 1213 | * @param {Boolean} test The result of a test. If true, null will be set as the handler in leiu of the specified handler |
| 1214 | */ |
| 1215 | function addHandle( attrs, handler, test ) { |
| 1216 | attrs = attrs.split("|"); |
| 1217 | var current, |
| 1218 | i = attrs.length, |
| 1219 | setHandle = test ? null : handler; |
| 1220 | |
| 1221 | while ( i-- ) { |
| 1222 | // Don't override a user's handler |
| 1223 | if ( !(current = Expr.attrHandle[ attrs[i] ]) || current === handler ) { |
| 1224 | Expr.attrHandle[ attrs[i] ] = setHandle; |
| 1225 | } |
| 1226 | } |
| 1227 | } |
| 1228 | |
| 1229 | /** |
| 1230 | * Fetches boolean attributes by node |