Closed
Bug 5852
Opened 26 years ago
Closed 26 years ago
document.getElementById('foo_id').selectedIndex returns negative values.
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
VERIFIED
FIXED
M7
People
(Reporter: sdm, Assigned: kmcclusk)
References
()
Details
Go to the above url, and save the file locally. Then load it in apprunner.
Select something other than Image for Back Button Display, and you will see -1
or -2 printed in the terminal winodw, and on the next line, undefined. It is
counted backwards from 0, instead of forwards. I only tested this on linux.
Reporter | ||
Comment 1•26 years ago
|
||
I described it a bit incorrectly. It does not return the negative index, it
returns -1 if an item is selected that is not the default item. If you set the
default to the 3rd item (none), and click Create Theme, it returns 0, in which
case 0 is the first in the list! This all used to work about a week ago.
Updated•26 years ago
|
Assignee: vidur → pollmann
Comment 2•26 years ago
|
||
Eric, do you know about any regressions (possibly at the widget level)?
Updated•26 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M6
Comment 3•26 years ago
|
||
Haven't heard anything, I'll look into it.
Reporter | ||
Comment 4•26 years ago
|
||
This has since been fixed, atleast on the default build on linux. I think
Ramiro's checkin today fixed this:
http://cvs-mirror.mozilla.org/webtools/bonsai/cvsquery.cgi?module=all&branch=&branchtype=match&dir=&file=&filetype=match&who=ramiro%25netscape.com&whotype=match&sortby=Date&hours=2&date=explicit&mindate=05%2F03%2F99+14%3A00%3A00&maxdate=05%2F03%2F99+15%3A00%3A00&cvsroot=%2Fcvsroot
But I'm not 100% sure. It could be that this is a problem with gfx widgets vs.
native widgets.
Comment 5•26 years ago
|
||
That may be the problem. Ramiro switched Linux over from gfx to native widgets.
Since this bug was only on Linux, and Linux was the only platform using gfx
widgets by default, and the selectedIndex call relys on a widget correctly
implementing getSelectedIndex...
Thanks for the tip!
Updated•26 years ago
|
QA Contact: 4078 → 4015
Comment 6•26 years ago
|
||
Yes, this is a gfx select widget problem. Using viewer, go to this URL:
http://blueviper.mcom.com/forms/selectedIndex.html
The page dumps "Initial selectedIndex=0" to the console.
Change the widget render mode to Gfx (Debug->Style->Widget Render Mode->Gfx)
Go to the same page.
The page dumps "Initial selectedIndex=-1" to the console.
Kevin, in forms/src/nsSelectControlFrame::GetProperty we query for the widget
then call GetSelectedIndex on it. This obviously won't work for Gfx selects as
they have no widget. I'm not familiar with the Gfx select code. What
additional logic is necessary for them to report the correct selected element?
Updated•26 years ago
|
QA Contact: 4015 → 4078
Comment 7•26 years ago
|
||
Opps, I accidentally clobbered the QA Contact change - fixing...
Updated•26 years ago
|
Assignee: pollmann → kmcclusk
Status: ASSIGNED → NEW
Target Milestone: M6
Comment 8•26 years ago
|
||
Reassigning to the GFX widget guru.
Assignee | ||
Updated•26 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M7
Assignee | ||
Updated•26 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 9•26 years ago
|
||
Fixed in 5-27-99 2:46PM build. I added new code to correctly set and get the
selectedindex for a gfx-combo box.
Modified nsListboxControlFrame::SetProperty to toggle the selected index.
Modified nsListboxControlFrame::GetProperty to return the selected index rather
than looking at the selected attribute on the content.
Comment 10•26 years ago
|
||
verified fixed on
1999-07-15-14 RedHat Linux 5.2 kernel 2.2.9
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•