Skip to main content

Bug Tracker

Side navigation

#4328 closed bug (invalid)

Opened March 11, 2009 02:05PM UTC

Closed October 28, 2009 02:38PM UTC

Google Chrome Bug in Form Selectors

Reported by: mckamey Owned by: john
Priority: major Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: Google Chrome, Chrome Cc:
Blocked by: Blocking:
Description

http://groups.google.com/group/jquery-dev/browse_thread/thread/2d7f7cf231aeff29

I've managed to factor out all of "my code" and all that is left is this tiny little snippet which dies only on Google Chrome.

// jQuery 1.3.2
// Google Chrome v1.0.154.48

$(function() {
        try {
                var bugForm = $("<form><input /><input /></form>")[0];
                var bugExpr = $("textarea,input", bugForm);

                alert("Success! found "+bugExpr.length+" items");
        } catch(ex) {
                alert(ex);
        }

});

It appears to die with a cryptic DOM Range exception just as it enters the Array.sort method. Changing the selector from "textarea,input" to ["textarea","input"] appears to fix it.

I suspect that it may be a Chrome bug (which I've reported to them as well) but jQuery might want to implement a workaround as the experience is very confusing.

Attachments (0)
Change History (2)

Changed October 28, 2009 02:34PM UTC by davidserduke comment:1

description: http://groups.google.com/group/jquery-dev/browse_thread/thread/2d7f7cf231aeff29 \ \ I've managed to factor out all of "my code" and all that is left is this tiny little snippet which dies only on Google Chrome. \ \ // jQuery 1.3.2 \ // Google Chrome v1.0.154.48 \ \ $(function() { \ try { \ var bugForm = $("<form><input /><input /></form>")[0]; \ var bugExpr = $("textarea,input", bugForm); \ \ alert("Success! found "+bugExpr.length+" items"); \ } catch(ex) { \ alert(ex); \ } \ \ }); \ \ It appears to die with a cryptic DOM Range exception just as it enters the Array.sort method. Changing the selector from "textarea,input" to ["textarea","input"] appears to fix it. \ \ I suspect that it may be a Chrome bug (which I've reported to them as well) but jQuery might want to implement a workaround as the experience is very confusing.http://groups.google.com/group/jquery-dev/browse_thread/thread/2d7f7cf231aeff29 \ \ I've managed to factor out all of "my code" and all that is left is this tiny little snippet which dies only on Google Chrome. \ \ {{{ \ // jQuery 1.3.2 \ // Google Chrome v1.0.154.48 \ \ $(function() { \ try { \ var bugForm = $("<form><input /><input /></form>")[0]; \ var bugExpr = $("textarea,input", bugForm); \ \ alert("Success! found "+bugExpr.length+" items"); \ } catch(ex) { \ alert(ex); \ } \ \ }); \ }}} \ \ It appears to die with a cryptic DOM Range exception just as it enters the Array.sort method. Changing the selector from "textarea,input" to ["textarea","input"] appears to fix it. \ \ I suspect that it may be a Chrome bug (which I've reported to them as well) but jQuery might want to implement a workaround as the experience is very confusing.

Changed October 28, 2009 02:38PM UTC by davidserduke comment:2

resolution: → invalid
status: newclosed

Looks like this was a Chrome bug. Tried it in 3.0.195.27 (which Google says is the up-to-date version) and it returned 2.