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
Received on Tuesday, 30 November 2010 15:46:04 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:02 UTC