Re: WebIDL, optional attributes

On Wed, Jun 10, 2009 at 10:40 AM, Marcin
Hanclik<Marcin.Hanclik@access-company.com> wrote:
> Hi Andrei,
>
> A couple of editorial suggestions:
>
> WebIDL:
> a)The definition of the Geolocation interface could be shortened based on the WebIDL spec:
>
> interface Geolocation {
>    void getCurrentPosition(in PositionCallback successCallback, [Optional] in PositionErrorCallback errorCallback, [Optional] in PositionOptions options);
>
>    int watchPosition(in PositionCallback successCallback, [Optional] in PositionErrorCallback errorCallback, in [Optional] PositionOptions options);
>
>    void clearWatch(in int watchId);
>  };
>

Good idea, thank you. Done.

> b) interface Coordinates uses type "double".
> WebIDL does not know this type. Could we use "float"?
> Or if we need more precision maybe {long, long} (a new interface) should be used?
>

I don't think this is a problem: I haven't seen any implementers
complaining about this. 'double' is pretty clear and maps well to JS's
Number type.

> Optional attributes:
> The word "optional" has two meanings in the spec:
> 1. "The coords attribute contains a set of geographic coordinates together with their associated accuracy, as well as a set of other optional attributes such as altitude and speed."
> "The altitude attribute denotes the height of the position, specified in meters above the [WGS84] ellipsoid. If the implementation cannot provide altitude information, the value of this attribute must be null."
> "The speed attribute denotes the current ground speed of the hosting device and is specified in meters per second. If the implementation cannot provide speed information, the value of this attribute must be null."
> This is ok. "Optional" means that the value is to be set to null by the implementation.
>
> 2. "The enableHighAccuracy, timeout and maximumAge attributes are all optional."
> PositionOptions is used as associative array (NoInterfaceObject) that is specified by the JS developer.
>
> I think that the statement "... are all optional" could get more clarification since the meaning of "optional" is different here.
>

Done.

All the best,
Andrei

Received on Wednesday, 10 June 2009 11:28:33 UTC