Closed Bug 346371 Opened 18 years ago Closed 15 years ago

Doesn't know about child elements

Categories

(Core :: DOM: HTML Parser, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: otavio, Unassigned)

References

()

Details

(Keywords: testcase)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1b1) Gecko/20060708 BonEcho/2.0b1 (Debian-1.99+2.0b1+dfsg-1) Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1b1) Gecko/20060708 BonEcho/2.0b1 (Debian-1.99+2.0b1+dfsg-1) When running the follwing webpage you don't get the expected behaviour. It doesn't know about the parent elements and return form.length == 0. Reproducible: Always Steps to Reproduce: <html> <head> <script> function vasculha(f) { var form = document.getElementById(f).getElementsByTagName("form"); for (var i = 0; i < form.length; i++) { alert(form[i]); } } </script> </head> <body> <form id="form1"> <form id="form2"> </form> <form id="form3"> </form> <form id="form4"> </form> </form> <form id="form5"> </form> <script> vasculha("form1"); </script> </body> </html> Actual Results: forms.lenght == 0 Expected Results: forms.length == 3
That's because something like this: <form id="form1"> <form id="form2"> </form> <form id="form3"> </form> </form> is constructed in Mozilla with the following DOM: # FORM id="form1" * #text: # #text: # FORM id="form3" As you can see, <form> tags can't be nested currently in Mozilla (and #form2 seems completely 'forgotten'). In Opera9 it is possible now to nest <form> tags. I suspect this is something that also will be possible with the whatwg parsing spec.
Assignee: nobody → mrbkap
Component: Form Manager → HTML: Parser
Keywords: testcase
Product: Firefox → Core
QA Contact: form.manager → parser
Version: unspecified → Trunk
> I suspect this is something that also will be possible with the whatwg parsing > spec. So the problem is that the parsing engine doesn't allow nesting form tags? If it's true how we should do to make this kinda of relationship? Use hiden fields to say which form is the parent tags?
What does IE6 do?
(In reply to comment #3) > What does IE6 do? IE6 has this as innerHTML: <FORM id=form1><FORM id=form2></FORM> <FORM id=form3></FORM></FORM></ The dom view looks like this: FORM id="form1" FORM id="form2" FORM id="form3" /FORM As you can see, form3, is _not_ a child of form1. Personally, I think what Opera9 is doing in this case, makes the most sense.
Since IE doesn't support this, I don't think this counts as a "major" bug, but fixing bug 136397 will make fixing this bug much easier.
Severity: major → normal
Status: UNCONFIRMED → NEW
Depends on: 136397
Ever confirmed: true
OS: Linux → All
Hardware: PC → All
Assignee: mrbkap → nobody
Forms can't nest per HTML5.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.