partial interfaces, [NoInterfaceObject]

(please CC me in any responses, as I'm not subscribed to
public-script-coord@w3.org)

Hi, I'm looking for some guidance on the use of partial interfaces, and
also of [NoInterfaceObject]. This came up when reviewing feedback on
snippets of WebIDL in the Geolocation API.

It was suggested that this form:

[NoInterfaceObject]
interface NavigatorGeolocation {
  readonly attribute Geolocation geolocation;
};
Navigator implements NavigatorGeolocation;

Should be replaced by this form:

partial interface Navigator {
  readonly attribute Geolocation geolocation;
};

This change seems to make sense as it is less verbose, and there's no need
for multiple interfaces to implement this. Is there any further guidance on
pros and cons?

The other thing that came up was that generally [NoInterfaceObject] should
be removed unless there is a good reason to have it. For example "The
Geolocation interface should not have [NoInterfaceObject]."

This part makes less sense to me. What are the reasons for exposing an
object like this in the global namespace? It seems to have little use, but
perhaps for feature detection. Still, that can also be done by checking for
the presence of window.navigator.geolocation.

Regards,

Michael

Received on Thursday, 13 February 2014 16:51:14 UTC