id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,blocking,blockedby
3741,Name selector with a context should fallback when context doesn't support getElementsByName [jQuery 1.3 Beta 1],chuyeow,john,"I ran into this bug while testing jQuery 1.3b1:

{{{
$('input[name=foo', '#form');
=> Throws a context.getElementsByName is not a function error.
}}}

Turns out Sizzle will call {{{getElementsByName}}} even when there is a context argument passed to the selector, and this breaks when the context doesn't support {{{getElementsByName}}}. AFAIK this only works on {{{document}}} (i.e. no context).

I also found while fixing this bug that {{{input[name=""foo""]}}} will NOT use the NAME selector (it falls back to the TAG-based selector).

I've a couple of patches to Sizzle that fixes these 2 bugs with tests over at my Github fork: http://github.com/chuyeow/sizzle/commits/context_selector_fixes (commits 19d4277 and be83e65).

I'll be generating a plain old patchfile as well in case that's more convenient :)",bug,closed,major,1.3,selector,1.2.6,fixed,sizzle,chuyeow,,
