W3C home > Mailing lists > Public > html-tidy@w3.org > April to June 2000

RE: tidy problems on www.altavista.com

From: <html-tidy@war-of-the-worlds.org>
Date: Thu, 22 Jun 2000 10:45:01 -0500
Message-Id: <p04320400b577e0635a20@[216.229.13.10]>
To: html-tidy@w3.org
Alexander Biron <biron@ifh.de> wrote:
>On Thu, 22 Jun 2000, Ittay Freiman wrote:

>> more than that, i think tidy is wrong here. td is an inline tag,

No, td is a table tag only legal inside tr.  It is not legal inside form,
and form is not legal inside tr.

>> while form is a block, so <td> followed by <form> should be converted to
>> <td></td><form>. the same thing goes to the /form.

> Form is block level, correct. TD however may contain flow. flow may
> contain block level. So td may contain form. Please search
> http://www.w3.org/TR/REC-html40/sgml/dtd.html to see this:
:
> So tidy's result is syntax correct here:
> <td><form></td></form> -> <td><form></form</td>
>
> A different question is whether a different correct syntax comes closer
> to what the author intended:
>
> <form><table></table></form>
>
> This is to my understanding a very common syntax when using
> forms.
:
> So tidy has to choose which one of the two legal syntaxes is the one the
> author intended. I am not shure that the second one is _always_
> the better one (in your case it certainly seems so.) But maybe the
> default should be
> <td><form></td></form> -> <form><table></table></form> instead of
> <td><form></td></form> -> <td><form></form></td>

But it is legal to have more than one form in a table, but it isn't legal
to have a form within a form in any way.  You can't even do it with the
ins/del tags.  To do that you'd have to either split or nest tables, and
that would require a whole lot of code just to analyze the table structure
so you'd know how to split it.

Better to have it obviously broken than to make it look deceptively correct
and submitting the wrong fields to the wrong form.  Only if the form is the
only form in the entire table can you make it encompass the entire table,
else Tidy must either reduce its scope to just the td or refuse to do any
more parsing until the user corrects the problem manually.  That could be
reduced by checking to see if there are other formctrl elements that can't
be moved (non-<input type="hidden">) which would be disenfranchised by a
reduction of scope.

This is complicated by the fact that it is legal to have formctrl elements
outside of a form, yet certain browsers don't support their use outside of
forms.
Received on Thursday, 22 June 2000 11:45:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:44 GMT