option.label should be reflected like option.value

VERIFIED FIXED in mozilla7

Status

()

Core
DOM: Core & HTML
VERIFIED FIXED
6 years ago
a year ago

People

(Reporter: mounir, Assigned: mounir)

Tracking

({dev-doc-complete})

Trunk
mozilla7
dev-doc-complete
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
Currently, option.value and option.label reflection are really different. Having them behaving the same way would be saner and very likely, the web compat way would be to have option.label behaving the same way as option.value.
(Assignee)

Comment 1

6 years ago
Created attachment 535023 [details] [diff] [review]
Patch v1

Having this pushed soon in the release cycle will help us catch any potential regressions.
Assignee: nobody → mounir.lamouri
Status: NEW → ASSIGNED
Attachment #535023 - Flags: review?(Olli.Pettay)
(Assignee)

Updated

6 years ago
Whiteboard: [needs review]

Comment 2

6 years ago
Comment on attachment 535023 [details] [diff] [review]
Patch v1

The change makes a lot of sense, but what do other browsers do?
If all the other browsers have the spec'ed behavior, and have had that
for years, I don't think we should change this.
r+ for that code though.
Attachment #535023 - Flags: review?(Olli.Pettay) → review+
(Assignee)

Comment 3

6 years ago
Hixie told in the spec bug that he wrote this part of the spec that way for retro-compatibility and he would be ok to make this consistent if there were no compat issues involved. I believe we can try that.

IE6 does reflect value and label IDL attributes with the content attribute. So does the last version of Presto.
Webkit, Gecko and IE9 do follow the specs (IOW, only reflect label with the content attribute and value defaults to textContent if the content attribute isn't set).
Gecko has implemented the .value behavior since 2002 (bug 162368).
(Assignee)

Updated

6 years ago
Whiteboard: [needs review]
(Assignee)

Comment 4

6 years ago
Comment on attachment 535023 [details] [diff] [review]
Patch v1

Asking a sr to make sure it's ok to push this change and ask for a spec change after that.
Attachment #535023 - Flags: superreview?(bzbarsky)
Comment on attachment 535023 [details] [diff] [review]
Patch v1

sr=me, but please fix the comment:

s/fallbacks/falls back/ (and do we really fall back to .textContent, or is there whitespace strippting going on?)

s/valued content/ ????? / (what is this trying to say?)

s/method fallback/method falls back/

In general, mayb just nix the first sentence of the comment?
Attachment #535023 - Flags: superreview?(bzbarsky) → superreview+
(Assignee)

Updated

6 years ago
Flags: in-testsuite+
Whiteboard: [fixed in cedar]
(Assignee)

Comment 6

6 years ago
Pushed:
http://hg.mozilla.org/mozilla-central/rev/846bef26a8e6
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [fixed in cedar]
Target Milestone: --- → mozilla7

Updated

6 years ago
Keywords: dev-doc-needed
I apologize for asking, but the spec-speak here is leaving me confused as to how the behavior of option.label has changed for web devs. Can anyone clarify?
Documentation updated:

https://developer.mozilla.org/en/HTML/Element/option
https://developer.mozilla.org/en/DOM/HTMLOptionElement

And mentioned on Firefox 7 for developers.
Keywords: dev-doc-needed → dev-doc-complete

Comment 9

6 years ago
Verified fixed on:
Mozilla/5.0 (Windows NT 6.1; rv:7.0) Gecko/20100101 Firefox/7.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0) Gecko/20100101 Firefox/7.0
Mozilla/5.0 (X11; Linux i686; rv:7.0) Gecko/20100101 Firefox/7.0
Mozilla/5.0 (Windows NT 5.1; rv:7.0) Gecko/20100101 Firefox/7.0
Build ID: 20110902161802

The bug was verified using the test referred in the link from comment #6 (test_bug659596.html), which has passed.
Status: RESOLVED → VERIFIED
(In reply to Eric Shepherd [:sheppy] from comment #8)
> Documentation updated:
> 
> https://developer.mozilla.org/en/HTML/Element/option
> https://developer.mozilla.org/en/DOM/HTMLOptionElement
> 
> And mentioned on Firefox 7 for developers.

FYI, the notes in the two articles were incorrect. I've updated them now.

Sebastian
You need to log in before you can comment on or make changes to this bug.