Bug Tracker

Opened 12 years ago

Closed 12 years ago

#7719 closed bug (worksforme)

:disabled has bugs in Opera

Reported by: MrMamen Owned by: browser-opera
Priority: high Milestone: 1.6
Component: selector Version: 1.4.4
Keywords: browserbug browser-opera Cc: miketaylr
Blocked by: Blocking:


var fields = $('
      <input type="input" disabled="disabled">
      <input type="input" disabled="true">

Expected result is "2". Actual result is "0" in Opera 10.63 and 11 beta. Other browsers work. This bug was introduced in 1.4.3 but is still present in 1.4.4

Change History (14)

comment:1 Changed 12 years ago by MrMamen

The input fields should state "type='text'", but the error is the same.

comment:2 Changed 12 years ago by jitter

Cc: miketaylr added
Priority: undecidedhigh
Status: newopen

Thanks for taking the time to contribute to the jQuery project by writing a bug report. The code you posted has several issues (type="input" and disabled="true" both are invalid values and the inputs are not self closed) but this all doesn't matter, as the issue remains even after fixing these.

After some initial tests to investigate what is going on it looks like this is a bug in Opera (maybe the qSA implementation), but I'm not sure yet.

I made a few different test cases:
reproduction of reporters code
some working tests
test case partially failing (1.4.2!)

These tests tell us:

  • the bug isn't related to the jQuery version (happens in 1.3.x and 1.4.x)
  • the bug is related to qSA and only happens in Opera
  • the bug only happens for specific code and html

The reason you discovered this only with jQuery 1.4.3+ is related to an internal code change (since 1.4.3 qSA is used for Element-rooted queries too).

More investigation is needed on this one. Bringing in our Opera expert on this one.

comment:3 Changed 12 years ago by jitter

Mike did you have time/interest to look at this one?

comment:4 Changed 12 years ago by anonymous

Sorry, time no--interest yes. Last week was consumed by AddOnCon. I'll take some time this week to dig in.

comment:5 Changed 12 years ago by miketaylr

Oops, that was me.

comment:6 Changed 12 years ago by miketaylr

Yikes, 6 weeks has gone by. I've got some bandwidth today to do some investigating.

comment:7 Changed 12 years ago by miketaylr

A few things to note before I forget...

See http://jsfiddle.net/miketaylr/da6p9/4/ which alert()s 1 in Opera, 3 elsewhere. Compare that with http://jsfiddle.net/miketaylr/da6p9/5/ which alert()s 3.

I'm messing with tests here too: http://people.opera.com/miket/2011/1/24/qsa-disabled.html

comment:8 Changed 12 years ago by miketaylr

It just dawned on me, Sizzle's ":disabled" doesn't really use qSA, right? If you update the test to actually use QSA, it seems OK: http://jsfiddle.net/miketaylr/da6p9/6/

@jitter, thoughts?

comment:9 Changed 12 years ago by MrMamen

This bug is still present in Opera 11.01, and jQuery 1.5. Is the conclusion that this is an Opera bug?

comment:10 Changed 12 years ago by anonymous

That it still happens in 11.01 isn't surprising--that release was essentially a security fix. Still not quite sure where the problem is, but like I mentioned in my previous comment, if you don't use ":disabled" it works.

comment:11 Changed 12 years ago by miketaylr

I can confirm this as an Opera NodeSelector bug. CORE-36571 has been reported on our end. We treat dyanamically created (and disabled) elements as not :disabled.

comment:12 Changed 12 years ago by jitter

Component: unfiledselector
Keywords: browserbug added
Owner: set to browser-opera
Status: openassigned

comment:13 Changed 12 years ago by MrMamen

This seems to have been fixed in Opera 11.1.

comment:14 Changed 12 years ago by john

Keywords: browser-opera added
Resolution: worksforme
Status: assignedclosed

Oooh, fixed in a current version of Opera - that's good enough for me!

Note: See TracTickets for help on using tickets.