[Bug 17283] Consider making `null` for reflecting IDL attributes remove the content attribute

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17283

--- Comment #1 from Simon Pieters <simonp@opera.com> 2012-06-01 11:47:17 UTC ---
Opera willfully violates the spec when it comes to setting null to IDL
attributes because we found several sites that broke, e.g. by setting
<input>.max = null which caused the form to be unsubmittable.

We stringify null to "" for *all* DOMString IDL attributes. However, it
occurred to us that the site compat problems were only related to IDL
attributes that reflect content attributes. Gecko seems to stringify to "" for
that case. WebKit seems to remove the content attribute. Either is probably
Web-compatible.

I think removing the content attribute is nicer than setting it to the empty
string. Consider the crossorigin attribute. The empty string is a valid
keyword, so doing crossOrigin = null, if it stringifies to "", sets the
attribute to the Anonymous state. There would be no way of setting it to the No
CORS state, short of using removeAttribute('crossorigin') which is more
verbose.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Friday, 1 June 2012 11:47:22 UTC