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

[BUG?] TD inline content not accepted with strict doctype

From: J. David Bryan <dbryan@bcpl.net>
Date: Mon, 1 Jan 2001 19:55:12 -0500 (EST)
Message-Id: <200101020055.TAA04466@mail.bcpl.net>
To: HTML Tidy List <html-tidy@w3.org>
Hello TidyFolks,

The following HTML code:

  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
  <html>
  <head>
  <title>X</title>
  </head>
  <body>
  <table>
  <tr>
  <td>Some text.</td>
  </tr>
  </table>
  </body>
  </html>

...validates as strict HTML 4.01, according to the W3C validator.  However, 
Tidy 4-Aug-00 complains:

  line 17 column 1 - Warning: html doctype doesn't match content
  t.html: Doctype given is "-//W3C//DTD HTML 4.01//EN"
  t.html: Document content looks like HTML 3.2

...and will tidy the resulting output by replacing the doctype with one for 
HTML 3.2.  In order to convince Tidy that this is valid HTML 4.01 Strict, 
one must place "Some text" in a paragraph element:

  <td><p>Some text.</p></td>

This apparently is required by code in the "ParseBlock" routine of 
"parser.c", specifically lines 661-666:

  /*
    HTML4 strict doesn't allow mixed content for
    elements with %block; as their content model
  */
    lexer->versions &= ~VERS_HTML40_STRICT;
    continue;

Is Tidy wrong here, or is the W3C validator?  It appears to me that Tidy is 
in error, as the TD element is not %block but rather %flow:

  <!ELEMENT (TH|TD) - O (%flow;)* -- table header cell, table data cell-->

where %flow is:

  <!ENTITY % flow "%block; | %inline;">

So the inline content should be acceptable in HTML 4.01 strict.

                                      -- Dave
Received on Monday, 1 January 2001 20:03:04 GMT

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