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

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