Closed Bug 1190 Opened 26 years ago Closed 26 years ago

selected and defaultSelected DOM attributes meaning reversed

Categories

(Core :: DOM: Core & HTML, defect, P1)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: karnaze, Assigned: pollmann)

References

()

Details

The url contains a <SELECT> which has an onchange. There doesn't appear to be any javascript/dom support for onchange yet. When there is, the select code will need to be changed to use it.
Assignee: joki → karnaze
Okay, I've added handling of the 'onchange' event into the event system. Now we just need to modify the form code to send the event. Passing the bug to karnaze for that piece.
Status: NEW → ASSIGNED
*** Bug 1550 has been marked as a duplicate of this bug. ***
Assignee: karnaze → pollmann
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
Priority: P2 → P1
*** Bug 1391 has been marked as a duplicate of this bug. ***
Just checked in a fix. Currently, it uses the defaultSelected attribute of a HTMLOptionElement to store the "currently selected" value for that option, which appears to be wrong, until this issue is resolved. Leaving bug open until resolved.
Summary: onchange not implemented → selected and defaultSelected DOM attributes meaning reversed
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Just checked in the fix. The "currently selected" (DOM selected attribute) is now cached in the selectControlFrame, and is set/queried by the DOM correctly. Also wired up selectedIndex.
QA Contact: 4015
gerardok, can you verify this bug?
gerardok, can you verify this bug?
Status: RESOLVED → REOPENED
Tested on the 2/1 build. It looks like the onchange command is not being executed. I wrote some simpler code to test this: <html> <head> <title>MyPage</title> </head> <body> <form> <select name="list" onchange="alert('onchange is working')"> <option selected>Default <option>Foo </select> </form> </body></html> When I select the item "Foo" from the drop-down list, the alert msg isn't displayed. I expected the "onchange is working" text to be displayed. Is there anything missing in the JavaScript side? Reopening bug.
Setting all current Open/Normal to M4.
Status: REOPENED → ASSIGNED
Wow, good catch! To be specific, your testcase demonstrates three bugs. 1) onchange is not sent for selectboxes that don't have "MULTIPLE" selection 2) Javascript altert dialogs don't work yet 3) The mouseclicked event required to send the onchange to the select box is only sent if after selecting a new option, you click on the box again (mouse down and mouse up within the bounds of the rectangle) Bug #2 I don't know about Bug #3 I told Tom Pixley about (I think he's working on a fix) Bug #1 was a typo on my part (= instead of ==) I'll check in a fix.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago26 years ago
Just fixed the typo. Your test page works for me: 1) The alert is a beep followed by output to the console 2) The combo box must be clicked on after the change for the message to be sent.
Status: RESOLVED → VERIFIED
Verified on viewer 3/18 build. Entered bugs 4273 and 4279 for the remaining issues.
Flags: in-testsuite?
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.