W3C home > Mailing lists > Public > public-html@w3.org > August 2007

Re: <li value=bogus> (detailed review of Semantics)

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 1 Aug 2007 04:51:13 +0000 (UTC)
To: Simon Pieters <simonp@opera.com>
Cc: public-html <public-html@w3.org>
Message-ID: <Pine.LNX.4.64.0708010450470.9342@dhalsim.dreamhost.com>

On Sun, 15 Jul 2007, Simon Pieters wrote:
> On Sun, 15 Jul 2007 00:22:11 +0200, Simon Pieters <simonp@opera.com> wrote:
> > 
> > (This is part of my detailed review of the Semantics and structure of HTML
> > elements section.)
> > 
> > The spec says about <li value>:
> > 
> >    If the value attribute is present, user agents must parse it as an
> >    integer, in order to determine the attribute's value. If the attribute's
> >    value cannot be converted to a number, it must be treated as if the
> >    attribute was absent. The attribute has no default value.
> > 
> > This matches what Safari does.
> > 
> >    http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0D%0A%3Col%3E%3Cli%3E.%3Cli%20value%3Dx%3E.%3Cscript%3Ew%28document.body.firstChild.firstChild.value+%22%2C%20%22+document.body.firstChild.firstChild.nextSibling.value%29%3C/script%3E
> > 
> > In IE, if the attribute is present but parsing as an integer fails, the used
> > and the default value is 1.
> > 
> > In Opera, if the attribute is present but parsing as an integer fails, the
> > used and the default value is 0.
> > 
> > In Firefox, the default value is -1.
> > 
> > 
> > Rendering-wise there is interop between Firefox and Safari. The lack of
> > interop suggests that pages don't rely on a specific behavior. Perhaps the
> > spec is fine as is, or it should be changed to match Firefox instead, or IE
> > -- I don't have an opinion either way.

Ok, left unchanged.


> Hmm. Negative numbers are also an issue.
> 
>   http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0D%0A%3Col%3E%3Cli%20value%3D-2%3E.%3Cscript%3Ew%28document.body.firstChild.firstChild.value%29%3C/script%3E
> 
> Safari acts as if the attribute was absent and getting .value returns 
> -3. IE acts as if the attribute was absent and getting .value returns 0. 
> Opera uses -3 and getting .value returns -3. Firefox uses 0 and getting 
> .value returns 0.

I don't understand why we wouldn't want to do what the spec says today 
for negative numbers.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 1 August 2007 04:51:16 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:47 UTC