Open Bug 704061 Opened 13 years ago Updated 2 years ago

Shouldn't be able to operate something on <select> element whose mousedown event is called preventDefault()

Categories

(Core :: Layout: Form Controls, defect)

defect

Tracking

()

People

(Reporter: masayuki, Unassigned)

References

()

Details

Load the URL, we shouldn't be able to open dropdown list, select an item by mouse on the <select> elements.

However, we should allow to close the dropdown list by ESC key for security reason (the dropdown list may be topmost window) even if the key event's default is prevented.

And also, we should handle mouseup event even if it was consumed. mouseup event is important for managing mouse capture. If we ignored it, we would miss the chance to release it.
I think the bug you see might be related to the fact that we are selecting items when the mouse hover's them instead of when we click. I guess you want to use ESC to close the dropdown list because mousedown being prevented would prevent the user to close it?
Actually, preventing mousedown would prevent opening the dropdown list... Might be interesting to implement that to allow websites to draw their own dropdown list.
(In reply to Mounir Lamouri (:volkmar) (:mounir) from comment #1)
> I think the bug you see might be related to the fact that we are selecting
> items when the mouse hover's them instead of when we click.

No, nsListControlFrame isn't checking defaultPrevented attribute of any events.

> I guess you want
> to use ESC to close the dropdown list because mousedown being prevented
> would prevent the user to close it?

Yes. The dropdown list may be a topmost window. If user cannot close it forcibly, it may disturb other applications too. Note that we don't allow to create topmost window for XUL panel by same reason if it's in content document.

Resetting assignee which I don't work on in this several months.

Assignee: masayuki → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.