Ticket #7614 (closed bug: cantfix)
Order of selector expression returns different results for .find(selector) in Opera 10.63
| Reported by: | mechismo | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | selector | Version: | 1.4.4 |
| Keywords: | Cc: | miketaylr | |
| Blocking: | Blocked by: |
Description
Working test case: http://jsfiddle.net/hd4NK/
In Opera 10.63 the following return different length collections:
$("#con").find(".required, #bar, #btm :input");
$("#con").find("#btm :input, .required, #bar");
when querying the following mark-up
<fieldset id="cont"> <div id="top"> <input type="text" class="required" /> <input type="text" id="bar" /> </div> <div id="btm"> <input type="text" class="required2" /> <input type="text" id="foo" /> </div> </fieldset>
All other browsers tested (FF 3.6, IE8, Safari5, Chrome8) return expected results. Same issue is in 1.4.4 too.
In 1.4.2 all browsers return the same results.
Change History
comment:1 Changed 2 years ago by jitter
- Status changed from new to open
- Cc miketaylr added
- Component changed from unfiled to selector
- Priority changed from undecided to low
- Version changed from 1.4.3 to 1.4.4
- Milestone 1.5 deleted
comment:2 Changed 2 years ago by miketaylr
Yeah, the bug appears to be that qSA isn't throwing for an unsupported pseudo-class if there is a valid part first. So document.querySelectorAll(':foo, input') will throw, but not document.querySelectorAll('input, :foo').
comment:3 follow-up: ↓ 4 Changed 2 years ago by mechismo
Fair enough. Interesting that is worked OK in 1.4.2 which indicates to me that it's maybe not a bug in Opera but I haven't dug deeply into this. Maybe jQuery wasn't using native qSA in 1.4.2 for Opera.
comment:4 in reply to: ↑ 3 Changed 2 years ago by jitter
Replying to mechismo:
Fair enough. Interesting that is worked OK in 1.4.2 which indicates to me that it's maybe not a bug in Opera but I haven't dug deeply into this. Maybe jQuery wasn't using native qSA in 1.4.2 for Opera.
No it is a bug in Opera. There were some internal changes from jQuery 1.4.2 to 1.4.4 which caused this to become apparent.
comment:5 Changed 2 years ago by danheberden
- Keywords needsreview added
- Milestone set to 1.next
Still present in opera11 :/
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Thanks for taking the time to contribute to the jQuery project by writing a bug report and providing a testcase!
I checked in on your test case and yes Opera does indeed return a different result from all other browsers. It is a a bug in Opera's querySelectorAll implementation.
CC-ing miketaylr on this one. <-- test case for you