Closed Bug 16879 Opened 25 years ago Closed 25 years ago

select.options.length should be read/write.

Categories

(Core :: Layout: Form Controls, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: dbaron, Assigned: pollmann)

References

()

Details

(Whiteboard: Fix in hand, need approval (see bug 12513))

Attachments

(1 file)

DESCRIPTION: I really don't know what the bug is here, but since there's no JS error reported (there used to be, I think), I'm filing this on HTML Form Controls. The bugzilla query page has a bit of JS code that dynamically changes the "Component" list when a "Product" is selected. Right now, that code is taking up about 4 seconds of processor time, and doing nothing. It should be faster and it should work. STEPS TO REPRODUCE: * Load http://bugzilla.mozilla.org/query.cgi * Select "Browser" in the "Prodct" listbox ACTUAL RESULTS: * 4 seconds later, "Browser" is highlighted * The "Component" list is unchanged. EXPECTED RESULTS: * the component list should change (many of the components should be taken out) * "Browser" should be highlighted faster since the whole thing shouldn't take so long. DOES NOT WORK CORRECTLY ON: * Linux, apprunner, 1999-10-19-08-M11 * Linux, viewer, 1999-10- 19-08-M11 WORKS CORRECTLY ON: * NN 4.61 Linux
Assignee: karnaze → pollmann
Reassigning to Eric.
Status: NEW → ASSIGNED
Two problems with this. 1) The following line is used to remove all options from a select. This has no effect in gecko: f.component.options.length = 0; 2) The following line is used to add an option to a select. This has no effect in gecko: f.component[l] = new Option(c, c); Adding an option by setting f.component.option[l] works, so 2) should be easy to fix. Attaching a simplified test case...
OS: Linux → All
Hardware: PC → All
Target Milestone: M11
Attached file Simplified test case (deleted) —
Note that this testcase won't work in Nav because I added some dump() calls to trace execution. It should work like this in Gecko: Clicking on "Browser" in products listbox adds "Autofill" to the components listbox. Clicking on "Calendar" in the products adds "Core" to the components listbox. There should be not duplicates in the components listbox.
See also bug 12513 - the DOM issues there are basically the reverse of (2).
Target Milestone: M11 → M12
I've got a 90% fix for this done in my tree. It involved creating a new content object type, nsHTMLOptionCollection, that derived from nsHTMLGenericCollection. I added the ability to set length, and selected index to objects of this type. Still in a testing phase, so I'm not going to force this in to M11 (non-critical).
Adding an element using add() does not appear to work (build 1999110313). I am not sure if this should be a new bug. The following URL steps through the process, and the process halts upon executing the add() instruction with no error generated. URL: http://worldzone.net/misc/lesch/main.html
Target Milestone: M12 → M14
This fix causes massive performance problems on Bugzilla query page. (Where the version name listbox is dynamically updated to match selected products) It took me 120 sec to open on my P166/64M/NT box whereas without my fix it took 2 seconds. I'm holding off on checking this in for that reason! :) Marking this M14 as it is a Backwards compatability/non-critical issue.
Am I correct to think that the performance problems don't occur if you remove the JS from the Bugzilla query page?
Yes, it is caused by the JS, which currently removes something like 130 options from one select, then reinserts them one at a time. We reframe the entire select box for each of these removals and insertions, which is the real problem.
QA Contact update.
*** Bug 21431 has been marked as a duplicate of this bug. ***
*** Bug 23535 has been marked as a duplicate of this bug. ***
Is there a bug for the performance problems holding up this bug?
No, I don't think so. I'll try to re-add the changes to my tree to verify that there is indeed still a performance problem.
*** Bug 20875 has been marked as a duplicate of this bug. ***
Setting severity to critical
Severity: normal → critical
In this comment it says: ------ 1) The following line is used to remove all options from a select. This has no effect in gecko: f.component.options.length = 0; ------ When this bug is fixed, will this part work in Gecko? This is needed for backwards compatibility with NS 4.x
Yes.
*** Bug 24724 has been marked as a duplicate of this bug. ***
Updating summary.
Summary: Select element DOM modifications not working → select.options.length should be read/write.
*** Bug 26764 has been marked as a duplicate of this bug. ***
Whiteboard: ckritzer
*** Bug 27518 has been marked as a duplicate of this bug. ***
Whiteboard: ckritzer → Fix in hand, need review / approval (see bug 12513)
Got a review from Vidur for this yesterday.
Whiteboard: Fix in hand, need review / approval (see bug 12513) → Fix in hand, need approval (see bug 12513)
Just checked in the fix (part of fix for 12513)
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Marking VERIFIED FIXED on: - Linux6 2000-03-01-13 Commercial build - MacOS9 2000-03-01-13 Commercial build - Win98 2000-03-01-16 Commercial build
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: