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

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

From: Simon Pieters <simonp@opera.com>
Date: Sun, 15 Jul 2007 00:22:11 +0200
To: public-html <public-html@w3.org>
Message-ID: <op.tvg629ividj3kv@hp-a0a83fcd39d2>

(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.

-- 
Simon Pieters
Opera Software
Received on Saturday, 14 July 2007 22:22:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:02 GMT