Last Comment Bug 659596 - option.label should be reflected like option.value
: option.label should be reflected like option.value
Status: VERIFIED FIXED
: dev-doc-complete
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla7
Assigned To: Mounir Lamouri (:mounir)
:
Mentors:
http://www.w3.org/Bugs/Public/show_bu...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-25 03:30 PDT by Mounir Lamouri (:mounir)
Modified: 2015-12-03 00:30 PST (History)
6 users (show)
mounir: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (7.13 KB, patch)
2011-05-25 04:08 PDT, Mounir Lamouri (:mounir)
bugs: review+
bzbarsky: superreview+
Details | Diff | Splinter Review

Description Mounir Lamouri (:mounir) 2011-05-25 03:30:22 PDT
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.
Comment 1 Mounir Lamouri (:mounir) 2011-05-25 04:08:18 PDT
Created attachment 535023 [details] [diff] [review]
Patch v1

Having this pushed soon in the release cycle will help us catch any potential regressions.
Comment 2 Olli Pettay [:smaug] (vacation Aug 25-28) 2011-05-25 05:51:44 PDT
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.
Comment 3 Mounir Lamouri (:mounir) 2011-05-25 07:58:36 PDT
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 4 Mounir Lamouri (:mounir) 2011-05-26 08:07:46 PDT
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 5 Boris Zbarsky [:bz] 2011-05-26 10:17:09 PDT
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?
Comment 6 Mounir Lamouri (:mounir) 2011-05-27 08:26:05 PDT
Pushed:
http://hg.mozilla.org/mozilla-central/rev/846bef26a8e6
Comment 7 Eric Shepherd [:sheppy] 2011-08-08 10:40:28 PDT
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?
Comment 8 Eric Shepherd [:sheppy] 2011-08-08 13:20:29 PDT
Documentation updated:

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

And mentioned on Firefox 7 for developers.
Comment 9 Ioana (away) 2011-09-08 05:23:37 PDT
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.
Comment 10 Sebastian Zartner [:sebo] 2015-12-03 00:30:34 PST
(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

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