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

Re: width="n*" marked invalid on <COL>

From: Neil Bird <neil@fnxweb.com>
Date: Wed, 09 Jan 2002 09:55:08 +0000
Message-ID: <3C3C137C.60208@fnxweb.com>
To: Terry Teague <terry_teague@users.sourceforge.net>
CC: html-tidy <html-tidy@w3.org>
Around about 01/09/02 08:21, Terry Teague scribbled ...

> Looking at the code, the CheckLength() function in attrs.c doesn't allow
> for the relative form of the multilength attribute value type (n*). The fix
> probably should only allow the relative form for HTML 4.0 or later.

   This fixes it (or, at least, allows it):

--8<--cut-here--
--- src/attrs.c.orig    Sun Dec 30 07:55:05 2001
+++ src/attrs.c Wed Jan  9 09:43:34 2002
@@ -1041,7 +1041,9 @@

          while (*p)
          {
-            if (!IsDigit(*p) && *p != '%')
+            if (!IsDigit(*p) &&
+                *p != '%' &&
+                !(*p == '*' && (lexer->versions & VERS_HTML40)))
              {
                  ReportAttrError(lexer, node, attval, 
BAD_ATTRIBUTE_VALUE);
                  break;
--8<--cut here--


   ... but,

a) is that right for the version check?

b) it doesn't limit it to <COL> (and what else?)

c) shouldn't it stop parsing the length upon the % or *? 
Otherwise "123*456" is deemed valid, isn't it?

-- 
[neil@fnx ~]# rm -f .signature
[neil@fnx ~]# ls -l .signature
ls: .signature: No such file or directory
[neil@fnx ~]# exit
Received on Wednesday, 9 January 2002 04:55:55 GMT

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