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.
Created attachment 535023 [details] [diff] [review] Patch v1 Having this pushed soon in the release cycle will help us catch any potential regressions.
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.
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).
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.
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?
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.
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.
(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