This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 9626 - Elements which can't match :required pseudo-class should not match :optional pseudo-class
Summary: Elements which can't match :required pseudo-class should not match :optional ...
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.w3.org/TR/html5/interactiv...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-30 10:45 UTC by Mounir Lamouri
Modified: 2010-10-04 14:57 UTC (History)
5 users (show)

See Also:


Attachments

Description Mounir Lamouri 2010-04-30 10:45:25 UTC
The :optional pseudo-class matches:
- button  elements
- input elements that are not required
- select elements
- textarea elements that do not have a required attribute

I see two possible behavior for :optional:
 1. it considers every "interactive" elements the user can fill which are not required ;
 2. it considers only elements which can be required but don't have the required attribute specified.

At the moment, the optional pseudo-class doesn't seem to follow any of this rule. Indeed, "button" isn't an element the user can fill so, show it as "optional" sounds weird. The same way, "input elements that are not required" should be changed to "input elements for which the required attribute applies but without the required attribute specified" so button, hidden, image, reset and submit input types don't match the rule.

The difference between behavior 1 and behavior 2 is the the select element and I'm wondering why it can't be required. It sounds reasonable to let it matches :optional but it should be great to have it matches :required too. See bug 9625.

To summarize, button elements should not match the :optional pseudo-class nor input elements for which the required attribute doesn't apply.
Comment 1 Ian 'Hixie' Hickson 2010-09-25 00:35:28 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Concurred with reporter's comments.
Comment 2 contributor 2010-09-25 00:35:51 UTC
Checked in as WHATWG revision r5480.
Check-in comment: Make :optional more strictly match their CSS3 UI definitions.
http://html5.org/tools/web-apps-tracker?from=5479&to=5480