W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2010

String enum pattern

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 30 Nov 2010 16:45:30 +0100
To: public-script-coord@w3.org
Message-ID: <op.vmzp14rk64w2qv@anne-van-kesterens-macbook-pro.local>
Quite a number of APIs use string values instead of enums as they are more  
flexible when changes occur and such. E.g. this happens in canPlayType,  
quite a few things on the canvas API, and responseType in XMLHttpRequest.

Should this pattern be endorsed by giving it some type in Web IDL? This  
could make it easier to see from the IDL what values are allowed. And for  
attributes that allow setting the behavior of ignoring unknown values and  
such could maybe be defined centrally so that everyone using this pattern  
uses it in the same way.


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Tuesday, 30 November 2010 15:46:04 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:03 UTC