Bug Tracker

Ticket #7614 (closed bug: cantfix)

Opened 4 years ago

Last modified 3 years ago

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 4 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

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

Last edited 4 years ago by jitter (previous) (diff)

comment:2 Changed 4 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 4 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 4 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 4 years ago by danheberden

  • Keywords needsreview added
  • Milestone set to 1.next

Still present in opera11 :/

comment:6 Changed 4 years ago by dmethvin

  • Keywords needsreview removed
  • Status changed from open to closed
  • Resolution set to cantfix

I think we clearly established that this was an Opera bug we can't work around, and miketaylr's buddies are hot on the case.

comment:7 Changed 3 years ago by sindresorhus

#10921 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.