I've stumbled upon a wicked problem, which appears only in 1.3.2
(works ok in 1.3.1, 1.3.0 and 1.2.6), and only in Safari (3.2.2 on
Windows) (works ok in FF2/3, IE6/7, Opera). To cut a long story short,
here's the test case:

http://tmp.ahlers.com/test/safari-132.html

My application employs FlexiGrid, so I've isolated the chunk of code
to a bare minimum that reproduces the error.

        var sDiv = document.createElement('div');
        sDiv.className = 'sDiv';
        $(sDiv).append("<div class='sDiv2'>Quick Search <input type='text'
name='q'  /> <select name='qtype'><option selected='selected'
value='port'>Port</option></select> <input type='button'
value='Clear' /></div>");
        $('#output3').append(
                $('input[name=q],select[name=qtype]',sDiv).map( function(){ 
return
this.name } ).get().join(', ')
        );
        $('#form .bDiv').after(sDiv);

So, the query $('input[name=q],select[name=qtype]',sDiv) crashes
jQuery 1.3.2 on the line #2118:

        aRange.selectNode(a);

with the error "INVALID_NODE_TYPE_ERR: DOM Range Exception 2". At the
same time, single-selector queries like $('input[name=q]',sDiv) don't
crash. Also, the problem only happens if a context (sDiv) is an
element NOT YET ADDED to DOM.

Seems like quite a hypothetical situation? Nah, as I said I'm using
FlexiGrid and it took me a few hours to track down the reason why my
application no longer works under jQuery 1.3.2 :(

Reply via email to