Bug Tracker

Modify

Ticket #11273 (closed bug: cantfix)

Opened 16 months ago

Last modified 16 months ago

Indeterminate checkboxes not matched with :checked selector in WebKit browsers

Reported by: lowbatteries Owned by:
Priority: low Milestone: None
Component: selector Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

If a checkbox is checked, but then has the indeterminate property set, it will not be matched with the :checked selector (even though it is still checked, and would be posted with a form submission).

Reduced case here:  http://jsfiddle.net/7TcKF/3/

This seems to boil down to .webkitMatchesSelector(':checked') which has the same incorrect behavior.

The issue does not appear in jQuery 1.2.6 or 1.3.2, but seems to have been introduced in 1.4.4 and onwards.

I confirmed the erronous behavior in Chrome 16, Chrome 18 (Canary), Safari 5.1.2, and WebKit nightly. This bug does not show up in Opera, IE6+, or Firefox.

Change History

comment:1 Changed 16 months ago by dmethvin

May be related to this Chrome ticket, which from a rendering standpoint makes an indeterminate checkbox always appear to be unchecked:  http://code.google.com/p/chromium/issues/detail?id=73233

The spec says indeterminate should only affect visual rendering so I agree this is a bug, but this seems like a Chrome qSA bug to me. We don't have a generalized way to work around it short of looking for ":checked" anywhere in the selector string and sending it down the Sizzle JavaScript path, which is a pretty cruel thing to do performance-wise for such a rare edge case.

comment:2 Changed 16 months ago by dmethvin

#11274 is a duplicate of this ticket.

comment:3 Changed 16 months ago by dmethvin

  • Status changed from new to closed
  • Resolution set to cantfix

This bug should be reported to Webkit, we don't have an effective way to fix it within jQuery.

comment:4 Changed 16 months ago by dmethvin

  • Priority changed from undecided to low
  • Component changed from unfiled to selector

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.