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)
Tracking
()
RESOLVED
FIXED
People
(Reporter: volko, Assigned: basic)
Details
Attachments
(3 files, 1 obsolete file)
702 bytes,
patch
|
bzbarsky
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
2.43 KB,
application/x-zip-compressed
|
Details | |
408 bytes,
text/html
|
Details |
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
Comment 2•23 years ago
|
||
Marking NEW. It needs a patch and 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.
Comment 5•23 years ago
|
||
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
Comment 6•23 years ago
|
||
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.
Comment 7•23 years ago
|
||
Would someone care to write a testcase for this bug? Both image and file inputs
please.
Comment 8•23 years ago
|
||
working on testcase
Comment 9•23 years ago
|
||
Comment 10•23 years ago
|
||
Attachment #59901 -
Attachment is obsolete: true
Comment 11•23 years ago
|
||
Comment 12•23 years ago
|
||
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.
Comment 13•23 years ago
|
||
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
Updated•23 years ago
|
Priority: -- → P3
![]() |
||
Comment 15•21 years ago
|
||
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 16•21 years ago
|
||
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+
![]() |
||
Updated•21 years ago
|
Assignee: general → basic
![]() |
||
Comment 17•21 years ago
|
||
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.
Description
•