Closed Bug 288466 Opened 20 years ago Closed 20 years ago

Page Info fails to show a form's name and/or method when there are input fields named as thes attributes

Categories

(Firefox :: Page Info Window, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: brunoabdon+moziilabugzilla, Assigned: bugs)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2

The 'Forms' tab on the 'Page Info' window shows, on the first panel, a form's
name, method and action. However, if a form has an input field named 'name' or
'method', the string "[object HTMLInputElement]" is shown instead.

I believe this due to a flaw in the file
[browser.jar]content/browser.pageInfo.js (line 520 on my build (1.02))

formView.addRow([elem.name, elem.method,
getAbsoluteURL(elem.getAttribute("action"), elem), elem]);  // use
getAttribute() because of bug 122128

Here, the 'elem' variable is the form. Instead of doing elem.name, and
elem.method,  it should use DOM's getAttribute() method, just like it does with
the form's action. Indeed, the Page Info window doesn't fail do show the form's
action.

The fixed line would be:

formView.addRow([elem.getAttribute("name"), elem.getAttribute("method"),
getAbsoluteURL(elem.getAttribute("action"), elem), elem]);  // use
getAttribute() because of bug 122128

Reproducible: Always

Steps to Reproduce:
1.Go to http://www.stallman.org/
2.Open Tools -> Page Info, then Forms tab.
3.See the value show for the form's method

Actual Results:  
value shown is [object HTMLInputElement]

Expected Results:  
value should be "post"
This minimal valid html file contains a form with input fields with the
offending names.
It's a dupe
can't find it
Whiteboard: DUPEME
Being it a DUPE or not, it would be nice for someone give the proposed fix a try.

I heavly searched for a report on this bug prior to posting this one. I could
find  anything.

The problem seems to be very simple, and I really think the proposed fix will
resolve it. It would be a pitty seeing this bug slipping into oblivion.
Bruno, the line you quoted was replaced as part of the patch in Bug 195492. Both
the testcase and stallman.org appear to work correctly now.

If possible could you download a test build and confirm whether or not this
issue is fixed:

ftp://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk

Thanks.
I just tested with the latest build(*) and it's fixed now. Marking as fixed now.
Thanks!




(*)Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050407
Firefox/1.0+
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: