|Summary:||:checked pseudo selector not matching selected option|
|Severity:||Normal||CC:||ap, koivisto, mkrp87, shanestephens, simon.fraser, tkent, webkit.review.bot|
|Version:||528+ (Nightly build)|
|Bug Depends on:|
Description karl.bohlmark 2011-06-22 15:17:54 PDT
The :checked pseudo selector is not matched by select options that have the "selected" attribute. The spec clearly states that :checked should match form elements that have the "checked" or "selected" attributes. Test case: http://jsfiddle.net/5dqPv/11/ Tested in webkit nightly.
Comment 1 Shane Stephens 2011-06-22 21:21:00 PDT
Your test case doesn't demonstrate the behavior claimed in this bug - the letter-spacing property doesn't apply to option elements even in the absence of a :checked selector. Please provide a test case that demonstrates the behavior.
Comment 2 karl.bohlmark 2011-06-23 00:38:44 PDT
Ok, I changed the test case to demonstrating it using querySelectorAll http://jsfiddle.net/5dqPv/31/
Comment 3 Alexey Proskuryakov 2011-06-23 00:56:28 PDT
Please attach your test case to the bug. There is no reason to keep tests on jsfiddle.
Comment 5 Shane Stephens 2011-06-23 16:30:33 PDT
Nice test case :) I couldn't find a property that applied to both selected and unselected option elements (e.g. background-color and color apply to the unselected elements but are overridden by the selection highlight).
Comment 6 Sameer Patil 2011-10-11 04:21:21 PDT
Created attachment 110499 [details] Patch Option element selected state need to be checked in PseudoChecked, currently HTMLInput elements are checked on their checked state. I guess option elements do require check here if we want them to be considered as checked when it's state is selected.
Comment 8 Sameer Patil 2011-10-11 20:29:44 PDT
Comment on attachment 110499 [details] Patch Thanks for review. Setting the commit-queue flag.
Comment 9 WebKit Review Bot 2011-10-11 20:44:53 PDT
Comment on attachment 110499 [details] Patch Clearing flags on attachment: 110499 Committed r97224: <http://trac.webkit.org/changeset/97224>
Comment 10 WebKit Review Bot 2011-10-11 20:44:58 PDT
All reviewed patches have been landed. Closing bug.