Closed Bug 34656 Opened 24 years ago Closed 24 years ago

[FIX]Forms don't check href base target

Categories

(Core :: Layout: Form Controls, defect, P3)

x86
Windows 2000
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: email1, Assigned: rods)

Details

(Whiteboard: [nsbeta3+]fix in hand)

If the following code is in a frame, the form button will not do the same thing 
as the <a href> even though they both should be "_top".  The form instead acts 
as a "_self".

<base target="_top">
<form action="test2.htm">
<input type="submit" value="Test">
</form>
<br><A href="test2.htm">Test</A>
The HTML spec indicates that <base target...> within the body is illegal, so 
this is not really a bug, but possibly an incompatibility concern.

The correct syntax is to define the target within the <form> attribute.
Severity: normal → minor
Confirming to get rods to decide whether we want to do something about this or 
not :-)

Gerv
Status: UNCONFIRMED → NEW
Ever confirmed: true
reassign
Assignee: rods → pollmann
For Nav 4.x, if the <base target="_top"> tag is moved inside the form it acts 
like "_self" and outside the form it acts like "_top".

If you dump content you can see that Mozilla is putting the "base" tag inside a 
"head" tag. It appears that the submit get ignore it.
This diff seems to fix it:

Index: src/nsHTMLContentSink.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/document/src/nsHTMLContentSink.cpp,v
retrieving revision 3.374
diff -r3.374 nsHTMLContentSink.cpp
1375a1376
>     case eHTMLTag_form:
Rod, this patch looks great, r=pollmann!  (I've seen it before, but for the life
of me I couldn't remember where that AddBaseTagInfo hack was done, great work,
thanks!)

BTW, since it's in your tree, do you want this bug to check this in, or should I
hang on to it?
Whiteboard: fix in hand
taking bug
Assignee: pollmann → rods
Keywords: nsbeta3
Target Milestone: --- → M18
Marking nsbeta3+. There is a category of form submissions which don't work 
because of this. If have basetag and href= and target= it does not go to the 
correct target.

Setting severity from Minor to Major.
Severity: minor → major
Whiteboard: fix in hand → [nsbeta3+]fix in hand
Status: NEW → ASSIGNED
Summary: Forms don't check href base target → [FIX]Forms don't check href base target
fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
email1@bierling.net, would you attach your testcase to this bug?  The HTML
snippet you've kindly added is, unfortunately, not clear enough as to how the
frames should be set up...

Thanks!

-ckritzer
Here's the full HTML that demonstrates the problem. This is four files.  The 
name of the file is contained in the brackets.

[frameset.htm]
<html>
<frameset rows="50%,*">
  <frame Name="period" scrolling="no" noresize target="standardstudent" 
src="frame1.htm">
	<frame name="standardstudent" src="frame2.htm">
  <noframes>
  <body>

  <p>This page uses frames, but your browser doesn't support them.</p>

  </body>
  </noframes>
</frameset>

</html>

[frame1.htm]
<html>
<body>
<form action="frame3.htm">
<base target="standardstudent">
<input type="submit" value="Test">
</form>
<br><A href="frame3.htm">Test</A>
</body>
</html>

[frame2.htm]
<html>
<body>
Frame 2
</body>
</html>

[frame3.htm]
<html>
<body>
Frame 3
</body>
</html>
I was a bit hasty with the example. Frame1.htm should be:

<html>
<body>
<base target="standardstudent">
<form action="frame3.htm">
<input type="submit" value="Test">
</form>
<br><A href="frame3.htm">Test</A>
</body>
</html>
Marking VERIFIED FIXED on:
- LinuxRH62 2000-09-13-08-M18 Commercial
- Win98     2000-09-13-08-M18 Mozilla
- MacOS86   2000-09-13-04-M18 Commercial
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.