Closed
Bug 115262
Opened 23 years ago
Closed 23 years ago
in some cases forms are not visible by JavaScript being referenced by name
Categories
(Core :: DOM: HTML Parser, defect, P3)
Core
DOM: HTML Parser
Tracking
()
VERIFIED
FIXED
mozilla0.9.8
People
(Reporter: atmjav, Assigned: harishd)
References
Details
(Whiteboard: [fix in hand])
Attachments
(1 file)
1.46 KB,
patch
|
hjtoi-bugzilla
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.6+) Gecko/20011213 BuildID: 2001121313 The code </form> <form></form> or </form></form> before the form makes it invisible by JavaScript when referencing by form name. Reproducible: Always Steps to Reproduce: 1. Create a page with the code below. 2. Try to remove "</form> <form></form>" before the opening tag BODY and place it again to see when script cannot access the form. Actual Results: JavaScript cannot access the form by name. Expected Results: JavaScript should access the form with something like document.forms['form1'] or document.form1 Here is a sample code with 3 forms and 3 scripts (please notice this code - "</form> <form></form>"): <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Mozilla 2001121313 - bug</title> </head> <body bgcolor="#FFFFFF" marginwidth=0 leftmargin=0 rightmargin=0 marginheight=0 topmargin=0 bottommargin=0> </form> <form></form> <form name=form1 action="/m.phtml" method=post><script language=JavaScript> <!-- if(document.forms['form1']!=null) document.write('the form1 form object exists'); else document.write('the form1 form object <font color=red>unavailable</font>'); //--> </script><input type=submit name=submit1 value=" A "></form><br> <form name=form2 action="/m.phtml" method=post><script language=JavaScript> <!-- if(document.forms['form2']!=null) document.write('the form2 form object exists'); else document.write('the form2 form object <font color=red>unavailable</font>'); //--> </script><input type=submit name=submit1 value=" A "></form><br> <form name=form3 action="/m.phtml" method=post><script language=JavaScript> <!-- if(document.form3!=null) document.write('the form3 form object exists'); else document.write('the form3 form object <font color=red>unavailable</font>'); //--> </script><input type=submit name=submit1 value=" A "></form> </body> </html>
Comment 1•23 years ago
|
||
parser. We seem to only create one <form> node in the case when we have </form> before the whole thing... (all the text and inputs are children of that form node; the other <form> nodes are never created).
Assignee: rods → harishd
Status: UNCONFIRMED → NEW
Component: HTML Form Controls → Parser
Ever confirmed: true
OS: Windows 98 → All
QA Contact: madhur → moied
Hardware: PC → All
Status: NEW → ASSIGNED
Priority: -- → P3
Whiteboard: [fix in hand]
Target Milestone: --- → mozilla0.9.8
Comment 3•23 years ago
|
||
I am pretty sure this broke phpmyadmin which of course i am using for a development project woot hope this gets checked in ASAP.
Comment on attachment 61810 [details] [diff] [review] patch v1.0 [ Make sure that mOpenFormCount memeber doesn't go below zero. ] r=heikki I am still not 100% sure this will work always (now and in the future) because we are not checking the value of mOpenFormCount before decrementing. If somebody lied, and we had mFlags & NS_PARSER_FLAG_HAS_OPEN_FORM we would just decrement, which could go into negative. Maybe I am just being overtly cautious. I would probably add an assertion just in case, but if you think this situation will never happen it is fine as is.
Attachment #61810 -
Flags: review+
>I am still not 100% sure this will work always (now and in the future) because
>we are not checking the value of mOpenFormCount before decrementing.
If NS_PARSER_FLAG_HAS_OPEN_FORM is set then mOpenFormCount will be > 0. And
mOpenFormCount value would never go below 0 because we decrement, in CloseForm,
only if NS_PARSER_FLAG_HAS_OPEN_FORM was set.
Updated•23 years ago
|
Attachment #61810 -
Flags: superreview+
Comment 6•23 years ago
|
||
Comment on attachment 61810 [details] [diff] [review] patch v1.0 [ Make sure that mOpenFormCount memeber doesn't go below zero. ] sr=jst
Comment 7•23 years ago
|
||
*** Bug 117054 has been marked as a duplicate of this bug. ***
Comment 8•23 years ago
|
||
*** Bug 119110 has been marked as a duplicate of this bug. ***
Comment 9•23 years ago
|
||
*** Bug 117213 has been marked as a duplicate of this bug. ***
Comment 10•23 years ago
|
||
*** Bug 116218 has been marked as a duplicate of this bug. ***
Comment 11•23 years ago
|
||
*** Bug 115400 has been marked as a duplicate of this bug. ***
Comment 12•23 years ago
|
||
*** Bug 118136 has been marked as a duplicate of this bug. ***
Comment 13•23 years ago
|
||
*** Bug 118169 has been marked as a duplicate of this bug. ***
Comment 14•23 years ago
|
||
*** Bug 118706 has been marked as a duplicate of this bug. ***
Comment 15•23 years ago
|
||
*** Bug 119819 has been marked as a duplicate of this bug. ***
Comment 16•23 years ago
|
||
*** Bug 118089 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 17•23 years ago
|
||
I don't see this bug in 2002011403/Win98! Thank you very much, thank you all!
Comment 18•23 years ago
|
||
*** Bug 119908 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 19•23 years ago
|
||
Forgot to mark this bug fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 20•23 years ago
|
||
*** Bug 120138 has been marked as a duplicate of this bug. ***
Comment 21•23 years ago
|
||
*** Bug 120296 has been marked as a duplicate of this bug. ***
Comment 22•23 years ago
|
||
Verified with build ID 20020117 on win2k and patch checked in CVS (Rev 3.368)
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•