RE: PositionOptions

Hi Cameron,

>>Indeed, if the intention is to allow code like:
>>
>>  navigator.getCurrentPosition(a, b, { enableHighAccuracy: true,
>>                                       timeout: 5 });
Yes, this is the case.

>>then you’ll need to use [Callback] on the interface.
>>
>>  http://dev.w3.org/2006/webapi/WebIDL/#Callback

It's a bit weird, but ok.

>>If you specifically need to know whether a given ECMAScript
>>property exists on the native object,
This is our case.

>>then that’s something currently
>>outside the realms of Web IDL.
propertyIsEnumerable and "for .. in" seem to handle the properties in ES, or?

My understanding is that the PositionOptions will never be instantiated like
var p = new PositionOptions();

We would use it only as you quoted:
>>  navigator.getCurrentPosition(a, b, { enableHighAccuracy: true,
>>                                       timeout: 5 });

Shall we then use the following?
[Callback=PropertyOnly]
interface PositionOptions {
  attribute boolean enableHighAccuracy;
  attribute long timeout;
  attribute long maximumAge;
};

If so, then I assume we would need more about "PropertyOnly" including examples in Web IDL spec.

Thanks.

Kind regards,
Marcin

Marcin Hanclik
ACCESS Systems Germany GmbH
Tel: +49-208-8290-6452  |  Fax: +49-208-8290-6465
Mobile: +49-163-8290-646
E-Mail: marcin.hanclik@access-company.com

-----Original Message-----
From: Cameron McCormack [mailto:cam@mcc.id.au]
Sent: Wednesday, June 17, 2009 9:20 AM
To: Marcin Hanclik
Cc: public-geolocation
Subject: Re: PositionOptions

Marcin Hanclik:
> "The enableHighAccuracy, timeout and maximumAge attributes are all
> optional: when creating a PositionOptions object, the developer
> may specify any of these attributes." Since the PositionOptions
> has [NoInterfaceObject] extended attribute, it will not be
> instantiated/created in ES.
>
> So "when creating a PositionOptions object..." seems not to fit here.
>
> I would remove that part as follows:
> "The enableHighAccuracy, timeout and maximumAge attributes are all
> optional: the developer may specify any of these attributes."

Indeed, if the intention is to allow code like:

  navigator.getCurrentPosition(a, b, { enableHighAccuracy: true,
                                       timeout: 5 });

then you’ll need to use [Callback] on the interface.

  http://dev.w3.org/2006/webapi/WebIDL/#Callback


The section on how native objects are considered to implement
interfaces,

  http://dev.w3.org/2006/webapi/WebIDL/#native-objects


currently has wording on how a user agent invokes operations on such a
native object, but doesn’t say anything about getting/setting
attributes.  That should be added, and will probably say that the value
returned from fetching the property will be converted to an IDL value
using the rules in

  http://dev.w3.org/2006/webapi/WebIDL/#dfn-convert-ecmascript-to-idl-value


which would mean false for the boolean attribute and 0 for the long
attributes.  If you specifically need to know whether a given ECMAScript
property exists on the native object, then that’s something currently
outside the realms of Web IDL.

--
Cameron McCormack ≝ http://mcc.id.au/


________________________________________

Access Systems Germany GmbH
Essener Strasse 5  |  D-46047 Oberhausen
HRB 13548 Amtsgericht Duisburg
Geschaeftsfuehrer: Michel Piquemal, Tomonori Watanabe, Yusuke Kanda

www.access-company.com

CONFIDENTIALITY NOTICE
This e-mail and any attachments hereto may contain information that is privileged or confidential, and is intended for use only by the
individual or entity to which it is addressed. Any disclosure, copying or distribution of the information by anyone else is strictly prohibited.
If you have received this document in error, please notify us promptly by responding to this e-mail. Thank you.

Received on Wednesday, 17 June 2009 10:39:52 UTC