RESOLVED FIXED 63192
:checked pseudo selector not matching selected option
https://bugs.webkit.org/show_bug.cgi?id=63192
Summary :checked pseudo selector not matching selected option
karl.bohlmark
Reported 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.
Attachments
test case (260 bytes, text/html)
2011-06-23 01:48 PDT, karl.bohlmark
no flags
Patch (5.08 KB, patch)
2011-10-11 04:21 PDT, Sameer Patil
no flags
Shane Stephens
Comment 1 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.
karl.bohlmark
Comment 2 2011-06-23 00:38:44 PDT
Ok, I changed the test case to demonstrating it using querySelectorAll http://jsfiddle.net/5dqPv/31/
Alexey Proskuryakov
Comment 3 2011-06-23 00:56:28 PDT
Please attach your test case to the bug. There is no reason to keep tests on jsfiddle.
karl.bohlmark
Comment 4 2011-06-23 01:48:29 PDT
Created attachment 98323 [details] test case
Shane Stephens
Comment 5 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).
Sameer Patil
Comment 6 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.
Kent Tamura
Comment 7 2011-10-11 19:14:44 PDT
Comment on attachment 110499 [details] Patch ok
Sameer Patil
Comment 8 2011-10-11 20:29:44 PDT
Comment on attachment 110499 [details] Patch Thanks for review. Setting the commit-queue flag.
WebKit Review Bot
Comment 9 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>
WebKit Review Bot
Comment 10 2011-10-11 20:44:58 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.