This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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.
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.
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