W3C home > Mailing lists > Public > public-html@w3.org > March 2010

Setting IDL attributes that map enumerated content attributes

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 11 Mar 2010 11:06:00 -0500
Message-ID: <4B9914E8.6040500@mit.edu>
To: HTML WG <public-html@w3.org>
The text at http://dev.w3.org/html5/spec/infrastructure.html#reflect says:

   "If a reflecting IDL attribute is a DOMString whose content attribute
    is an enumerated attribute ...
    on setting, if the new value is an ASCII case-insensitive match for
    one of the keywords given for that attribute, then the content
    attribute must be set to the conforming value associated with the
    state that the attribute would be in if set to the given new value,
    otherwise, if the new value is the empty string, then the content
    attribute must be removed, otherwise, the setter must raise a
    SYNTAX_ERR  exception."

I just tested, and IE seems to be the only browser I have that raises 
such a SYNTAX_ERR exception.  Gecko, Webkit (both Chrome and Safari 
incarnations) and Opera all allow the set to happen, though exact 
behavior after that is not interoperable: Webkit silently ignores the 
set, while Gecko and Opera update the content attribute to the given value.

I would obviously prefer the Gecko/Opera behavior here, since that's 
simplest in terms of implementation complexity for me.  But past that, I 
strongly object to moving from a situation where no exception is thrown 
to one where an exception is thrown.  That's likely to lead to web 
compatibility issues, in my experience, especially given the current 
tendency towards "IE" and "not IE" codepaths and the fact that none of 
the non-IE browsers throw an exception.

Received on Thursday, 11 March 2010 16:06:35 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:45:13 UTC