Closed
Bug 22795
Opened 25 years ago
Closed 24 years ago
form not in default namespace of form controls
Categories
(Core :: DOM: Core & HTML, defect, P3)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
WORKSFORME
M16
People
(Reporter: pabloa, Assigned: jst)
References
()
Details
Attachments
(2 files)
231 bytes,
text/html
|
Details | |
16.38 KB,
patch
|
Details | Diff | Splinter Review |
Overview Description: A check box event isn't running. Steps to Reproduce: 1) go to this URL 2) click in checkbox 'Mostrar mensajes ampliados' Actual Results: Nothing The debug window shows: 'JavaScript Error: ReferenceError: frmVerForos is not defined' Expected Results: It must to jump to: http://www.patagon.com.ar/forlf.asp?pI=1&cI=20&fId=2&i=2&tP=1835&a=false&b=&t=1& o=nroMensajeIdioma&s=DESC Build Date & Platform Bug Found: 1999122808 Additional Information: I tested with Communicator 4.77 and IE5 and this checkbox work fine.
Updated•25 years ago
|
Assignee: mccabe → karnaze
Component: Javascript Engine → HTML Form Controls
Comment 1•25 years ago
|
||
In the future, a reduced testcase would be GREATLY appreciated. In addition, see http://www.mozilla.org/js/tests/library.html#PLEASE for a description of what the JavaScript Engine component actually covers. The page relies on an obscure misfeature in 4x browsers. The onClick handler in question attempts to execute javascript:frmVerForos.submit(); in the line: <input type=checkbox value=1 name=t onClick="javascript:frmVerForos.submit();"> This should (at least) be "document.frmVerForos.submit();", and ideally "document.forms.frmVerForos.submit();". The only reason this works in 4x browsers is because the <input> tag is inside a <form> tag. If you were to specify the <input> tag outside of any <form>, you would get the same JavaScript error in 4x. The author of the page has also prefixed the onclick code with a redundant "javascript:" (an onclick attribute is javascript code by default), but apparently the browsers are smart enough to ignore it. Surely this isn't the only page out there which make use of the 'feature'. Attaching a reduced testcase and reassigning to HTML Form Controls.
Comment 2•25 years ago
|
||
Comment 3•25 years ago
|
||
Steps to reproduce: Load the testcase and click on the checkbox. Expected (works in 4x): Alert dialog containing the text: function submit() { [native code] } Actual: JavaScript Error: ReferenceError: form1 is not defined
Updated•25 years ago
|
Assignee: karnaze → pollmann
Comment 4•25 years ago
|
||
Reassigning to Eric.
Updated•25 years ago
|
Assignee: pollmann → vidur
Component: HTML Form Controls → DOM Level 0
OS: Windows 95 → All
Hardware: PC → All
Summary: javascript event checkbox error → form not in default namespace of form controls
Comment 6•25 years ago
|
||
Vidur, wasn't this bug fixed last millenium? (bug 15133 and bug 15185) I'm not too familiar with this area, can you take a look at this bug? If this bug is blocking anyone, one workaround is to prepend document. to the form name: <HTML> <BODY> <FORM NAME="form1"> <INPUT TYPE="button" VALUE="Shorthand" ONCLICK="alert(form1.submit)"> <INPUT TYPE="button" VALUE="Standard" ONCLICK="alert(document.form1.submit)" </FORM> </BODY> </HTML>
Updated•25 years ago
|
Assignee: vidur → brendan
Comment 7•25 years ago
|
||
Checked in a temporary fix on 1/5/2000. The problem was introduced by code in nsJSContext::CompileEventHandler that unconditionally broke the scope link of compiled event handlers. While this is correct in the brutal sharing case, it shouldn't be done for HTML. Keeping the bug alive and passing it along to Brendan for a cleaner fix.
Updated•25 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M13
Comment 8•25 years ago
|
||
I think a flag argument to nsIScriptContext::CompileEventHandler is cleanest. Should be easy, once I update my tree from last year! /be
Comment 9•25 years ago
|
||
Cc'ing brutal sharers. This is P3 priority, but I'll fix it sooner anyway just to get it done right. /be
Crap, this is my fault. I recall talking to Waterson about HTML, but apparently I didn't do the right thing in the end. Sorry, and thanks to brendan for wiping my chin.
Comment 11•25 years ago
|
||
FYI re: rginda's comments: 1. This scope nesting (event handler in event target in form in document in window) is not a misfeature, or particularly obscure. Brevity in event handlers written as attribute values is a virtue! 2. The redundant (or just plain wrong) javascript: at the front of the original test case's event handler attribute value is not ignored by any browser smarts -- it's a valid JS statement label. /be
Comment 12•25 years ago
|
||
Thank you sir, may I have another!
Comment 13•25 years ago
|
||
Comment 14•25 years ago
|
||
Seeking vidur re-review. /be
Comment 15•25 years ago
|
||
Brendan's patch fixes the testcase on my linux build.
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Comment 16•25 years ago
|
||
The cleaner fix vidur and I like better is now in. /be
Guys: similar bug exists on http://tvguide.netscape.com/listings The submit() code doesn't update the pull down JS box (broadcast, cable, satellite).
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 18•24 years ago
|
||
Uh, this is not the bug that was once on my list, and that I closed. But since this bug got revived after death, instead of a new one being filed, I'll let jst have it (or better, make a new one). /be
Assignee: brendan → jst
Status: REOPENED → NEW
Assignee | ||
Comment 20•24 years ago
|
||
Looks like this is working now, I don't know what fixed it tho, marking WORKSFORME
Status: NEW → RESOLVED
Closed: 25 years ago → 24 years ago
Resolution: --- → WORKSFORME
Comment hidden (collapsed) |
You need to log in
before you can comment on or make changes to this bug.
Description
•