Bug 80088 - [Forms][CSS] The option element should not match pseudo class :valid
Summary: [Forms][CSS] The option element should not match pseudo class :valid
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: yosin
URL: http://jsfiddle.net/YtJmt/
Keywords:
: 81487 (view as bug list)
Depends on: 79764
Blocks: 80381
  Show dependency treegraph
 
Reported: 2012-03-01 20:11 PST by yosin
Modified: 2012-03-22 23:11 PDT (History)
2 users (show)

See Also:


Attachments
Patch 1 (2.29 KB, patch)
2012-03-22 21:29 PDT, yosin
no flags Details | Formatted Diff | Diff
Patch 2 (2.47 KB, patch)
2012-03-22 22:21 PDT, yosin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description yosin 2012-03-01 20:11:30 PST
Because of the class HTMLOptionElement inherits HTMLFormControlElement, the option element matches CSS pseudo class :valid.
Sample URL shows this bug. List box should contain red color text instead of green color text.
Comment 1 yosin 2012-03-05 20:34:40 PST
Pseudo class :valid and :invalid are defined in
http://www.whatwg.org/specs/web-apps/current-work/multipage/selectors.html#pseudo-classes
Comment 2 yosin 2012-03-18 23:20:21 PDT
*** Bug 81487 has been marked as a duplicate of this bug. ***
Comment 3 yosin 2012-03-19 00:47:41 PDT
The "option" elements match following CSS pseudo classes[1]:
1. enables
2. disabled
3. checked
4. default

I'm not sure 

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/selectors.html#pseudo-classes

== Sample HTML ==


<head>
<style type="text/css">
option:enabled { color: #0000ff; font-size: 30pt; }
option:disabled { color: #808080; font-size: 20pt;}
option:checked { background: #00ffff; }
option:default{ font-style: italic; }
</style>
</head>
<select size="10">
<option id="enabled">enabled #0000ff</option>
<option id="disabled" disabled="disabled">disabled #cccccc</option>
<option id="checcked">checked #00ffff</option>
<option id="default" selected="selected">default #italic</option>
</select>
Comment 4 yosin 2012-03-22 21:29:36 PDT
Created attachment 133425 [details]
Patch 1
Comment 5 Kent Tamura 2012-03-22 22:13:43 PDT
Comment on attachment 133425 [details]
Patch 1

View in context: https://bugs.webkit.org/attachment.cgi?id=133425&action=review

> LayoutTests/fast/css/pseudo-valid-007.html:24
> +shouldBeNull('document.querySelector("option:valid")');

This should be added to pseudo-valid-unapplied.html.  pseudo-valid-007.html is for <select>.
Comment 6 yosin 2012-03-22 22:21:36 PDT
Created attachment 133430 [details]
Patch 2
Comment 7 Kent Tamura 2012-03-22 22:41:07 PDT
Comment on attachment 133430 [details]
Patch 2

ok
Comment 8 WebKit Review Bot 2012-03-22 23:11:52 PDT
Comment on attachment 133430 [details]
Patch 2

Clearing flags on attachment: 133430

Committed r111830: <http://trac.webkit.org/changeset/111830>
Comment 9 WebKit Review Bot 2012-03-22 23:11:56 PDT
All reviewed patches have been landed.  Closing bug.