W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2000

Re: Over-tidying <TR>'s

From: <susan_levine@peoplesoft.com>
Date: Fri, 24 Mar 2000 11:45:34 -0600
To: dsr@w3.org
Cc: ac.quick@sympatico.ca, html-tidy@w3.org
Message-ID: <OFDB73D9D2.3FE8A1E4-ON8625686A.005BCCAD@rfdinc.com>

Thanks for your responses, everyone.  Now that I figured out how to read
the DTD, I see that my HTML is illegal, and I'll be sure to fix it.



                    Dave Raggett
                    <dsr@w3.org>          To:
                    Sent by:              cc:     html-tidy@w3.org,
                    html-tidy-requ        Subject:     Re: Over-tidying

                    01/18/00 01:13

On Mon, 17 Jan 2000 susan_levine@peoplesoft.com wrote:

> Hi Tidy People--
> Tidy doesn't like script tags inside a <tr>.  It chooses to move it to
> before the <table> tag.  The problem is that my <script> tag references
> image defined above it using the javascript DOM, so that when it's moved
> before the table, it gets an undefined object error when it executes.  I
> can't find anything in the HTML spec that specifically prohibits the
> <script> tag from living within the <tr> (or any other tag).  I believe
> HTML is correct, and Tidy is providing an unnecessary clean up.
> Is this something you can (or would be willing to) fix, or is there some
> specification that says script tags can only be defined within the <body>
> tag?
> I am actually experiencing this problem with the Java version of Tidy,
> Andy Q. does not want to deviate from your functionality.
> My HTML looks like this:
> <table>
>     <tr>
>         <td>
>             <IMG WIDTH=240 HEIGHT=20 NAME=processing src='IMAGE1.gif'>
>         </td>
>         <SCRIPT LANGUAGE='javascript'>
>           document.processing.src = 'IMAGE2.gif';
>         </SCRIPT>
>     </tr>
> </table>

This is indeed illegal. The simplest fix is to move the script into
the table cell. You could also rewrite your script to avoid the
processing error.

Tidy isn't smart as a human and doesn't have enough common sense to
"know" that this is a good thing to do. For instance, it doesn't
understand hardly anything about JavaScript.


-- Dave Raggett <dsr@w3.org> http://www.w3.org/People/Raggett
tel/fax: +44 122 578 3011 (or 2521) +44 385 320 444 (mobile)
World Wide Web Consortium (on assignment from HP Labs)
Received on Friday, 24 March 2000 13:15:24 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:47 UTC