Closed Bug 258621 Opened 21 years ago Closed 21 years ago

Input of type image does not submit coordinates if image is not displayed

Categories

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

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED INVALID

People

(Reporter: ben, Unassigned)

References

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3 When you create a form with an input of type image, and the resultant display shows the alternate text rather than the image itself, the form is submitted with empty coordinates in the imagename.x and imagename.y form fields. In my case an ASP.NET ImageButton control is utilized to generate an image input control, and the image happens to not exist yet, but I believe the error would also happen if I disabled image display entirely. The result of this [in my case] is that the ASP.NET infrastructure does not properly generate a "PostBack" event. If I examine the results given from Internet Explorer, it does generate "dummy" coordinates based on the placeholder image that is used, allowing the "PostBack" to be handled properly. Now, in reality, I'm not certain who this bug belongs to [ASP.NET or Mozilla], but the end result is that my application becomes unuseable to anyone with a Mozilla derived browser. What I would like to see is the x and y values being populated with the relative coordinates of the "text box" containing the alternate text. Reproducible: Always Steps to Reproduce: 1. Create a form with a single input field of type image where the image does not exist 2. Click the resulting text [from the alt attribute] Actual Results: field.x and field.y are empty Expected Results: field.x and field.y contain the relative coordinates based on the text bounding box which surrounds the displayed text
Attached file testcase
I can see the bug, using: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a4) Gecko/20040907 Firefox/0.9.1+ When using a debug build, I get an assertion on page load and assertions when I hover over the input image: ###!!! ASSERTION: Form control has a frame, but it's not a form frame: 'Error', file c:/mozilla/mozilla/content/html/content/src/nsGenericHTMLElement.cpp, line 2264
The point of sending coordinates is that the back end may do different things depending on where in the image you clicked. Doing this for the case when the image is replaced means you're sending bogus data to the server, possibly leading to unexpected results (such as having an image control with "delete" and "save" regions which gets replaced and then the user ending up hitting the "delete" region because of where they clicked on the text). So in any case when the original image is not being displayed, sending coordinates is a major bug.... I'd suggest filing a bug on ASP.NET pointing all this out.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
*** Bug 281143 has been marked as a duplicate of this bug. ***
*** Bug 342279 has been marked as a duplicate of this bug. ***
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: