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 12255 - option.label and option.value could be consistent
Summary: option.label and option.value could be consistent
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-06 14:18 UTC by Mounir Lamouri
Modified: 2011-09-22 17:39 UTC (History)
5 users (show)

See Also:


Attachments

Description Mounir Lamouri 2011-03-06 14:18:13 UTC
For the moment, the 'label' of an option element is its label attribute if present, otherwise its textContent. The 'value' of an option element is its value attribute if present, otherwise its textContent.
The label IDL attribute reflects the label attribute and the value IDL attribute (getter) returns the value attribute if present, otherwise the textContent.

I deplore the lack of consistency here: I would have understand that option.value and option.label reflects the content attribute but I don't understand why the former doesn't while the later does.

I think the API would be easier to use if option.label was working like option.value and I wonder if there would be real compat issues if this change was made. (I would say it doesn't)
Comment 1 Ian 'Hixie' Hickson 2011-05-07 18:55:33 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: Did Not Understand Request
Change Description: no spec change
Rationale: Implement it the way that makes sense and if nothing breaks, reopen the bug. I'd be more than happy to change this; as specced, it's just supposed to be backwards-compatible.
Comment 2 Mounir Lamouri 2011-05-27 15:28:13 UTC
Reopening because Firefox 7 might implement this if we don't catch any compat issues in the next few weeks.
Comment 3 Michael[tm] Smith 2011-08-04 05:01:02 UTC
mass-moved component to LC1
Comment 4 Ian 'Hixie' Hickson 2011-08-09 22:21:44 UTC
Mounir: Any news on this?
Comment 5 Mounir Lamouri 2011-08-09 22:44:12 UTC
(In reply to comment #4)
> Mounir: Any news on this?

It's in Firefox 7. IOW, this is currently in the Aurora and Nightly channels and will move to Beta next week.
See: https://bugzilla.mozilla.org/show_bug.cgi?id=659596

We got no report so far but it might be too early to make any conclusion.
Comment 6 Ian 'Hixie' Hickson 2011-09-22 17:38:15 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: Implementation seems to be safe so far, so let's try it. (Could still change.)
Comment 7 contributor 2011-09-22 17:39:54 UTC
Checked in as WHATWG revision r6560.
Check-in comment: Make option.label and option.value more consistent.
http://html5.org/tools/web-apps-tracker?from=6559&to=6560