select.add() method using NULL doesn't add to the head of the list

VERIFIED INVALID

Status

()

P3
normal
VERIFIED INVALID
19 years ago
18 years ago

People

(Reporter: jcarpenter0524, Assigned: jst)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

19 years ago
Overview Description: 
The spec says that when using the .add() method of SELECT, NULL should represent 
the head of the list.  So if you are adding multiple items to the select list, 
and use NULL as the before attribute, the item you add should be added to the 
top of the list.  The bug is that it is still adding to the bottom of the list.

From the spec:
add 
  Add a new element to the collection of OPTION elements for this SELECT. 
Parameters 
  element
    The element to add.
  before
    The element to insert before, or NULL for the head of the list.


Steps to Reproduce: 
- see test case

Actual Results: 
item is added to bottom of list

Expected Results: 
item should be added to top of list

Build Date & Platform Bug Found: 
2000-03-21-06-M15-nb1b

Additional Builds and Platforms Tested On: 
Mac 2000-03-21-06
Linux 2000-03-21-09
(Reporter)

Comment 1

19 years ago
Created attachment 6756 [details]
attaching testcase
(Reporter)

Comment 2

19 years ago
changing qa contact to janc
QA Contact: gerardok → janc
Target Milestone: ---
(Reporter)

Comment 3

19 years ago
forgot to set platform/os to all/all
OS: Windows NT → All
Hardware: PC → DEC
(Reporter)

Updated

19 years ago
Hardware: DEC → All
(Assignee)

Comment 4

19 years ago
Janc, this was changed in the DOM Level 2 spec, and, the Level 1 spec doesn't
make sense, if null causes elements to be added to the beginning of the list
then it's impossible to append elements to the select. Actually, I just had a
look at the level 1 errata and this is mentioned in there, marking INVALID,
mozilla already does the right thing.
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → INVALID
(Reporter)

Comment 5

19 years ago
My bad, DOM1 Eratta:
"The description of the before parameter of the add method reads: 
  The element to insert before, or null for the head of the list. 
Instead it should read: 
  The element to insert before, or null for the tail of the list." 
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.