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

Re: Over-tidying <TR>'s

From: <susan_levine@peoplesoft.com>
Date: Tue, 18 Jan 2000 08:34:33 -0800
To: dsr@w3.org
Cc: ac.quick@sympatico.ca, html-tidy@w3.org
Message-ID: <OF2F36E3C0.CF880199-ON8825686A.005AFA65@peoplesoft.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.

Thanks!!

--susan



                                                                                                                    
                    Dave Raggett                                                                                    
                    <dsr@w3.org>          To:     susan_levine@peoplesoft.com                                       
                    Sent by:              cc:     html-tidy@w3.org, ac.quick@sympatico.ca                           
                    html-tidy-requ        Subject:     Re: Over-tidying <TR>'s                                      
                    est@w3.org                                                                                      
                                                                                                                    
                                                                                                                    
                    01/18/00 01:13                                                                                  
                    AM                                                                                              
                                                                                                                    
                                                                                                                    





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
an
> image defined above it using the javascript DOM, so that when it's moved
to
> 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
my
> 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,
but
> 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.

Regards,

-- 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 Tuesday, 18 January 2000 11:34:43 GMT

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