- From: Matt Womer <mdw@w3.org>
- Date: Tue, 8 Mar 2011 15:56:04 -0500
- To: "public-geolocation@w3.org Group WG" <public-geolocation@w3.org>
- Cc: Andrei Popescu <andreip@google.com>, Matt Womer <mdw@w3.org>, Cameron McCormack <cam@mcc.id.au>, Lars Erik Bolstad <lbolstad@opera.com>
Hi all, I had an exchange with the editor of the WebIDL spec, Cameron McCormack, and he provided the following excellent feedback on our current usage of WebIDL and how it might effect the Geolocation spec. Cameron McCormack wrote: > > I’m looking at > http://dev.w3.org/geo/api/ and the things that will need to change are: > > * [Optional] has become a first class part of the syntax, so e.g. > getCurrentPosition would become: > > void getCurrentPosition > (in PositionCallback successCallback, > in optional PositionErrorCallback errorCallback, > in optional PositionOptions options); > > * There was never a type “int”, so clearWatch should be > > void clearWatch(in long watchId); > > * Web IDL now itself defines DOMTimeStamp: > > http://dev.w3.org/2006/webapi/WebIDL/#common-DOMTimeStamp > > so there is no need to reference DOM 3 Core for that. > > And here are the risky things: > > * There’s an open issue on whether interface types should include null > as one of their values, or whether the nullable mechanism (the “?” > suffix) should be used to allow null. This would affect the methods > on Geolocation – currently if null is passed for errorCallback, errors > are just not reported. If this change were made, then passing null > explicitly as the second argumnent to getCurrentPosition would throw a > TypeError, probably. If you wanted to allow null explicitly – for > example if the author can specify a PositionOptions but not a > PositionErrorCallback – then you would just need to adjust the type of > the argument to be “PositionErrorCallback?”. > > * There was a proposal to add function types to the IDL language. This > would simplify things like PositionCallback so that a whole interface > wouldn’t need to be specified. It might go something like this: > > typedef void (in Position) PositionCallback; > typedef void (in PositionError) PositionErrorCallback; > > or you could directly use the function types in the operation > declarations. I doubt I would drop Callback=FunctionOnly interfaces > for this, though, so this likely wouldn’t require a change for you. > > * Jonas and I had a proposal for a new way of doing exceptions. > > http://lists.w3.org/Archives/Public/public-script-coord/2010OctDec/0112.html > > Not sure if this has much buy-in yet, but I will try adding it to the > spec. (I’ll keep old-style exceptions working here, too, so this > wouldn’t require a change – it’s mostly for newer specs.) > > That’s all that I can think of right now. > > Maybe the exception thing and function types would be things that could > land in V2. > > I hope the above information is helpful. Thanks Cameron! -Matt
Received on Tuesday, 8 March 2011 20:56:07 UTC