[FIX]Forms don't check href base target

VERIFIED FIXED in M18

Status

()

Core
Layout: Form Controls
P3
major
VERIFIED FIXED
18 years ago
18 years ago

People

(Reporter: email1, Assigned: rods (gone))

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [nsbeta3+]fix in hand)

(Reporter)

Description

18 years ago
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>
(Reporter)

Comment 1

18 years ago
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
(Assignee)

Comment 3

18 years ago
reassign
Assignee: rods → pollmann
(Assignee)

Comment 4

18 years ago
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.
(Assignee)

Comment 5

18 years ago
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:

Comment 6

18 years ago
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
(Assignee)

Comment 7

18 years ago
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
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
Summary: Forms don't check href base target → [FIX]Forms don't check href base target
(Assignee)

Comment 9

18 years ago
fixed
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 10

18 years ago
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
(Reporter)

Comment 11

18 years ago
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>
(Reporter)

Comment 12

18 years ago
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>

Comment 13

18 years ago
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.