Bug Tracker

Custom Query (13852 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (25 - 27 of 13852)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Ticket Resolution Summary Owner Reporter
#15222 worksforme cacheLength is ignored in Sizzle's createCache() nessup
Description

It appears that elements are added to Sizzle caches regardless of whether the cache limit has been exceeded. This bug affects 1.9.1 and appears to also affect 2.1.1. Consider:

function createCache() {
	var cache,
		keys = [];

	return (cache = function( key, value ) {
		// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
		if ( keys.push( key += " " ) > Expr.cacheLength ) {
			// Only keep the most recent entries
			cache[ keys.shift() ] = null;
		}
		return (cache[ key ] = value);
	});
}

While the keys array will always be within the cache limit, the actual cache instance will store the cached object regardless of whether the limit has been exceeded.

Barring verbosity, I think that this method should be written as follows:

function createCache() {
	var cache,
		keys = [];

	return (cache = function( key, value ) {
		// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
		if ( keys.push( key += " " ) > Expr.cacheLength ) {
			// Only keep the most recent entries
			delete cache[ keys.shift() ];
			return value;
		}
		else {
			return (cache[ key ] = value);
		}
	});
}

Notice that, now, the cache variable only increases in length when key.length <= Expr.cacheLength. I think this is truer to the intent of cacheLimit. However, I'm not sure whether return value; makes sense in the affirmative branch of the control flow, and need assistance with this particular point.

Am I correct here? Or is cache length only meant to limit the size of the keys array? If so, why?

#15221 notabug :hidden can't set css display martin
Description

$(function () { $(':hidden').css({ 'display': 'block' }); });

Shows function itself on a page


$(function () { $(':hidden').css({ 'display': 'block' });...


It can be used .show() method, but why not to use .css? :)

#15220 wontfix In Chrome Browser event.key is undefined in keydown event amalraj
Description

We are getting event.key as undefined in keydown event. when we use chrome browser. Same code when used on IE,Mozilla works fine. We used Chrome version : 37.0.2062.94 m

Example : http://api.jquery.com/keydown/

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Note: See TracQuery for help on using queries.