Closed Bug 96595 Opened 24 years ago Closed 21 years ago

The method nsHTMLInputElement->Click() don't work for Image-Buttons

Categories

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

x86
Windows 2000
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: volko, Assigned: basic)

Details

Attachments

(3 files, 1 obsolete file)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:0.9.2) Gecko/20010726 Netscape6/6.1 BuildID: 20010802 (mozilla 0.9.3) In method nsHTMLInputElement->Click() Image-Buttons are not considered: <snip> (from \mozilla\content\html\content\src\nsHTMLInputElement.cpp) NS_IMETHODIMP nsHTMLInputElement::Click() { [...] // see what type of input we are. Only click button, checkbox, radio, // reset, submit, & image PRInt32 type; GetType(&type); if (NS_FORM_INPUT_BUTTON == type || NS_FORM_INPUT_CHECKBOX == type || NS_FORM_INPUT_RADIO == type || NS_FORM_INPUT_RESET == type || NS_FORM_INPUT_SUBMIT == type) { [...] } } </snip> I think || NS_FORM_INPUT_IMAGE == type is missing! Reproducible: Always Steps to Reproduce: 1. call method nsHTMLInputElement->Click() for an Image-Button 2. 3. Actual Results: nothing Expected Results: The Image-Button should be clicked
SPAM. HTML Element component deprecated, changing component to Layout. See bug 88132 for details.
Component: HTML Element → Layout
QA Contact: bsharma → moied
Marking NEW. It needs a patch and review
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: patch, review
Attached patch untested patchSplinter Review
PLEASE also add the FILE type of user input! IE allows the click() method to be assigned to the FILE input object. It has G R E A T uses for the File input type.
Nothing to do with layout, sending to DOM HTML. Per the W3C DOM Level 1 HTML we do the Right Ting (TM), but I don't understand the reason why images are excluded. Also CC'ing mstoltz for possible security implications of allowing click() on input type="file" elements.
Assignee: clayton → jst
Component: Layout → DOM HTML
QA Contact: moied → stummala
What will calling Click() on a file input element do? Is it the same as calling Submit()? Or does it bring up the filepicker? If the former, then that's OK, because a script can already call Submit(). It it's the latter, that's a little weird. It might be a good spoof or DoS.
Would someone care to write a testcase for this bug? Both image and file inputs please.
working on testcase
Attached file zip file with testcase and image (obsolete) —
Attached file new testcase and image
Attachment #59901 - Attachment is obsolete: true
for the testcase attach id 59906, ie shows the alert and then the dialog for selecting a file when clicked on browse. ns6 does the other way.
This is a problem for us too. We use an IMG element next to an A element. If you click on the A element, it forwards to the IMG click(). Well, it used to... We're going to look at work-arounds, but I thought I add another comment. People use IMG elements a TON, so...
Keywords: mozilla0.9.9
Priority: -- → P3
Mass-reassigning bugs.
Assignee: jst → dom_bugs
Comment on attachment 52110 [details] [diff] [review] untested patch This patch makes sense. The file input discussion does not, to me. So I think we should just go with this...
Attachment #52110 - Flags: superreview?(jst)
Attachment #52110 - Flags: review+
Comment on attachment 52110 [details] [diff] [review] untested patch Like, yeah, just what the comment above this code says. sr=jst
Attachment #52110 - Flags: superreview?(jst) → superreview+
Assignee: general → basic
Checked in. Marking fixed. Please file separate bugs on the <input type="file"> thing if someone actually wants that...
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: